I am using plyr.io as the video player on my website. However, it does not seem to go fullscreen when I test it on my mobile device (desktop and tablets work perfectly fine).
Does anyone have knowledge about this issue and know a simple way to fix it?
Thanks!
Here is my site Read-Only: [LINK][1]
Here is the javascript
document.addEventListener('DOMContentLoaded', () => {
const controls = [
'play-large',
'restart',
'play',
'progress',
'current-time',
'mute',
'volume',
'settings',
'fullscreen'
];
const player = Plyr.setup('.section-video', { controls });
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
const swiper = new Swiper(".swiper-marquee", {
slidesPerView: 'auto',
spaceBetween: 400,
loop: true,
speed: 32000,
allowTouchMove: false,
autoplay: prefersReducedMotion ? false : {
delay: 0,
disableOnInteraction: false,
},
});
var splide = new Splide(".splide.slider1", {
type: "loop",
perPage: 3,
autoWidth: false,
focus:'center',
gap: 80,
speed: 500,
easing:"cubic-bezier(0.16, 1, 0.3, 1)",
autoplay: true,
interval: 2000,
pauseOnHover: true,
keyboard: true,
reduceMotion: {
speed: 0,
rewindSpeed:0,
autoplay:"paused",
},
breakpoints: {
991: { perPage: 2,}, // Tablet},
767: { perPage: 1,}, // Mobile Landscape
479: { perPage: 1,}, // Mobile Portrait
}
}).mount();
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
entry.target.play();
} else {
entry.target.pause();
}
});
},
{
threshold: 0.2
}
);
const videos = document.querySelectorAll('[wb-embed="video"]');
videos.forEach((video) => {
video.pause();
observer.observe(video);
});
});