我在过去两天尝试在视频在 iPhone 上结束时自动关闭视频 js 播放器的全屏但没有成功。我正在将一个 youtube 视频传递到我的视频 js 播放器中。相同的代码在我的笔记本电脑上正常运行。我开始知道 iPhone 在它的 native 播放器上播放视频,而不是我正在使用的视频 js 播放器。请指导我如何在 iPhone 上自动关闭全屏。我已经为此尝试了每一件事。
这是链接:http://radiations3.com/videojs_hd_plugin/Hussnain/youtube.html
<body>
<video id="vid1" src="" class="video-js vjs-default-skin" controls preload="auto" width="640" height="360">
</video>
<script type="text/javascript">
videojs('vid1', { "techOrder": ["youtube"], "src": "http://www.youtube.com/watch?v=jofNR_WkoCE" });
var id = document.getElementById("vid1");
var myPlayer = videojs("vid1");
videojs("vid1").ready(function(){
this.on("ended", function(){
alert("hello");
myPlayer.exitFullScreen();
});
});
</script>
</body>
最佳答案
使用 exitFullscreen()
小写 s
.
关于jquery - 在iphone上自动关闭播放器的全屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31838492/