0

我已经在 FF/IE 上运行了这段代码,但是在 iPad 上监听器被忽略了。我从“canplay”事件开始,但在 [here][1] 找到了 loadmetadata 事件。不知道如何告诉 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  
4

1 回答 1

0

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

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

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

于 2013-05-09T18:29:46.533 回答