在iPad上的特定时间加载并播放playlist.m3u8到START?

时间:2013-05-09 18:25:33

标签: javascript html5 ipad html5-video

我已经在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  

1 个答案:

答案 0 :(得分:0)

您是否尝试过使用DOM事件?

document._video.onloadedmetadata = document._video.currentTime = start_seconds;

http://www.w3schools.com/tags/av_event_loadedmetadata.asp