gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 01:54:08 42 4
gpt4 key购买 nike

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

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

代码:

<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]}'>
<source src="..." type='video/mp4' label='240p' res='240'/>
<source src="..." type='video/mp4' label='360p' res='360'/>
<source src="..." type='video/mp4' label='720p' res='720'/>
<p class="vjs-no-js">Bu videoyu görüntülemek için lütfen JavaScript'i etkinleştirin.</p>
</video>
<script type="text/javascript">
var myPlayer = videojs("#tvideo");
myPlayer.videoJsResolutionSwitcher({
default: 'high',
dynamicLabel: true
});
myPlayer.persistvolume({
namespace: 'httpswwwseyredelimcom'
});
myPlayer.brand({
image: "...",
title: "...",
destination: "...",
destinationTarget: "_top"
});
myPlayer.ready(function() {
this.hotkeys({
volumeStep: 0.1,
seekStep: 5,
enableModifiersForNumbers: false
});
$(".bAd").detach().appendTo(".video-js");
$(".plAd").detach().appendTo(".video-js");

function resizeVideoJS() {
var containerWidth = $('.video-player').width();
var videoHeight = Math.round((containerWidth / 16) * 9);
myPlayer.width(containerWidth).height(videoHeight);
}
window.onresize = resizeVideoJS;
myPlayer.on("ended", function() {
startNextVideo();
});
});
</script>

我如何才能避免自动全屏并让用户在全屏上使用控制面板?

提前致谢。

最佳答案

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

关于javascript - VideoJS - 按播放按钮后禁用自动全屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50304601/

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