我想知道,当用户在 iPhone 上的 Safari 中观看视频后,点击“完成”按钮时是否有回调?
当视频播放完毕时,有一些方法可以在视频元素上获得回调,但如果视频设置为循环播放则不行。在尝试检测用户是否已完成观看视频时,循环会带来问题。
有点晚了抱歉:)但这是解决方案:
player = document.getElementById('videoplayer');
//when a user press DONE or PAUSE the first time is triggered the paused event so you can control with:
player.addEventListener("pause", function() {
//desired "done or puase button" behavior defined here
}, false);
//this is triggered when exit the fullscreen, or for example whrn the user First press PAUSE and THen press DONE
player.addEventListener('webkitendfullscreen', function() {
//desired "done button" behavior defined here
}, false);