我正在为ipad上的视频标签编写一个jQuery插件。我的插件所做的其中一件事就是恢复播放你上次停止观看的电影。我在设置当前时间时遇到问题。我发现我只能在"stalled“事件触发后设置它。在一部电影开始播放后(这是一段HTTP直播流视频),ipad上似乎就会响起stalled。我在其他环境中看不到这个事件,比如在PC上的google chrome。所以这段代码可以工作,但是我觉得使用stalled事件很不舒服。我尝试过canplaythrough、playing和其他一些工具,在这些情况下,我对currentTime的更新被忽略了。还有没有人有这方面的经验?
var theClass = this;
$(this.videoElement).bind("pause play stalled error abort progress waiting playing webkitfullscreenchange canplaythrough", null, function (e) {
///<summary>bind to the various events we are interested in during playback. event state changes will be saved to
///local storage. If we detect the media has finished playing we will exit fullscreen and trigger our mediaDone event</summary>
if (e.type == "stalled" && theClass.resumeTriggered) {
theClass.resumeTriggered = false;
theClass.resumeTime = theClass.resumeTime + 0.1;
$("#smpPlayerDebug").append("<p> seeking to time " + theClass.resumeTime + "</p>");
e.srcElement.currentTime = theClass.resumeTime;
}发布于 2012-04-22 11:02:13
这显然是行不通的。iPad对控制视频播放的支持很弱,可能是因为苹果试图创造一种标准的体验(不允许太多的变化)。
https://stackoverflow.com/questions/8421599
复制相似问题