我有一个基本的 HTML5 视频设置,我从中加载四个视频之一。我遇到的问题是,当我加载下一个视频时,它会从上一个时间位置继续播放。设置currentTime
属性的努力似乎要么是短暂的,要么是完全被忽视的。
我已将侦听器添加到事件集合中,并且每个事件中都有类似的内容;
myPlayer.addEventListener("loadeddata", function() {
console.log(" loadeddata: before = " + myPlayer.currentTime);
myPlayer.currentTime = 0.1;
console.log(" loadeddata: after = " + myPlayer.currentTime);
}, false);
有时我看到一个事件的时间发生了变化,但没有正确持续;
durationchange: before = 19.773332595825195
durationchange: after = 0.10000000149011612
loadedmetadata: before = 0.10000000149011612
loadedmetadata: after = 19.773332595825195
loadeddata: before = 19.773332595825195
loadeddata: after = 0.10000000149011612
canplay: before = 0.10000000149011612
canplay: after = 19.773332595825195
有时它甚至似乎根本没有凝固;
durationchange: before = 50.66666793823242
durationchange: after = 50.66666793823242
loadedmetadata: before = 50.66666793823242
loadedmetadata: after = 50.66666793823242
loadeddata: before = 50.66666793823242
loadeddata: after = 50.66666793823242
canplay: before = 50.66666793823242
canplay: after = 50.66666793823242
这似乎与此处的问题相似,但似乎没有任何解决方案。有没有人在 iPhone 上遇到过这个问题?