VideoJS - 按播放按钮后禁用自动全屏

Pel*_*lin 5 javascript video.js

由于 JWPlayer 可笑的定价政策,我转向了 VideoJS。

\n\n

问题是,当用户在 iOS 上启动视频时,它会切换本机全屏。我希望控制面板可以在全屏模式下使用,但我还无法管理它。

\n\n

代码:

\n\n
<video id="tvideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" poster="..." data-setup=\'{"language":"en", "controls": true,"autoplay": false, "fluid": true, "aspectRatio": "16:9",   "playbackRates": [0.5, 1, 1.5, 2]}\'>\n   <source src="..." type=\'video/mp4\' label=\'240p\' res=\'240\'/>\n   <source src="..." type=\'video/mp4\' label=\'360p\' res=\'360\'/>\n   <source src="..." type=\'video/mp4\' label=\'720p\' res=\'720\'/>\n   <p class="vjs-no-js">Bu videoyu g\xc3\xb6r\xc3\xbcnt\xc3\xbclemek i\xc3\xa7in l\xc3\xbctfen JavaScript\'i etkinle\xc5\x9ftirin.</p>\n</video>\n<script type="text/javascript">\n    var myPlayer = videojs("#tvideo");\n    myPlayer.videoJsResolutionSwitcher({\n        default: \'high\',\n        dynamicLabel: true\n    });\n    myPlayer.persistvolume({\n        namespace: \'httpswwwseyredelimcom\'\n    });\n    myPlayer.brand({\n        image: "...",\n        title: "...",\n        destination: "...",\n        destinationTarget: "_top"\n    });\n    myPlayer.ready(function() {\n        this.hotkeys({\n            volumeStep: 0.1,\n            seekStep: 5,\n            enableModifiersForNumbers: false\n        });\n        $(".bAd").detach().appendTo(".video-js");\n        $(".plAd").detach().appendTo(".video-js");\n\n        function resizeVideoJS() {\n            var containerWidth = $(\'.video-player\').width();\n            var videoHeight = Math.round((containerWidth / 16) * 9);\n            myPlayer.width(containerWidth).height(videoHeight);\n        }\n        window.onresize = resizeVideoJS;\n        myPlayer.on("ended", function() {\n            startNextVideo();\n        });\n    });\n</script>\n
Run Code Online (Sandbox Code Playgroud)\n\n

我怎样才能设法不获得自动全屏并让用户在全屏上使用控制面板?

\n\n

提前致谢。

\n

big*_*ess 8

要保留内联播放,请playsinline向视频标签添加属性。