Is there any way to minimize full screen video if some state change?
sabit990928 opened this issue · 2 comments
sabit990928 commented
@goto-bus-stop @fawaf @Authchirion. I have a case when there is paused state change(not manually), when it happens I want to minimize the video. Do you have any idea how call it?
goto-bus-stop commented
The YouTube API doesn't have a fullscreen API, but the DOM APIs provided by the browser should do the trick here. You can call document.exitFullscreen()
in an onPause
function:
<YouTube
onPause={() => {
if (document.fullscreenElement)
document.exitFullscreen()
}}
/>
sabit990928 commented
@goto-bus-stop, thanks it works for me