gpt4 book ai didi

javascript - 是否可以在 Vimeo Player (Froogaloop) 中打开和关闭视频全屏?

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:47:59 25 4
gpt4 key购买 nike

我正在使用 Vimeo API 并且我需要在播放器“完成”事件后关闭全屏 视频模式。我知道如何捕捉“完成”,但是否可以从全屏切换?

这里是 froogaloop 播放器示例的链接 - jsfiddle.net/bdougherty/HfwWY/light/

最佳答案

找到答案 - https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode

跨浏览器解决方案

function toggleFullScreen() {
if (!document.fullscreenElement && // alternative standard method
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.msRequestFullscreen) {
document.documentElement.msRequestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
}

关于javascript - 是否可以在 Vimeo Player (Froogaloop) 中打开和关闭视频全屏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23779196/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com