我已经在FF / IE上使用了这段代码,但是在iPad上却忽略了监听器。我从“canplay”事件开始,但发现了loadmetadata事件[here] [1]。不知道怎么告诉ipad去起点 - 任何建议?
<video id='video' controls preload='none' >
<p>Your user agent does not support the HTML5 Video element.</p>
</video>
// For firefox and develpent
var src = 'http://media.w3.org/2010/05/video/movie_300.webm';
// For actual IPad production environment using our Wowza media server
var src = 'http://www.ourwowzaserver/videos/mp4:ourvideo.mp4/playlist.m3u8';
var start_seconds = 45;
document._video = document.getElementById("video");
document._video.setAttribute("src", src);
document._video.play();
document._video.addEventListener('loadedmetadata', function() {
this.currentTime = start_seconds;
}, false);
[1]: http://stackoverflow.com/questions/5981427/start-html5-video-at-a-particular-position-when-loading
答案 0 :(得分:0)
您是否尝试过使用DOM事件?
document._video.onloadedmetadata = document._video.currentTime = start_seconds;