diff --git a/src/components/VideoPlayer/index.tsx b/src/components/VideoPlayer/index.tsx index e0cb0f05..e1f4d28a 100644 --- a/src/components/VideoPlayer/index.tsx +++ b/src/components/VideoPlayer/index.tsx @@ -25,24 +25,11 @@ export default function VideoPlayer({ const observer = new IntersectionObserver( async ([entry]) => { - const isVisible = entry.isIntersecting - - if (!isVisible && !video.paused) { + if (!entry.isIntersecting && !video.paused) { await videoManager.enterPiP(video) } - - if (isVisible) { - if ( - document.pictureInPictureElement === video || - (video as any).webkitPresentationMode === 'picture-in-picture' - ) { - await videoManager.exitPiP(video) - } - } }, - { - threshold: 0.5 - } + { threshold: 0.5 } ) observer.observe(container)