首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ipad的HTML5视频标签上设置currentTime

在ipad的HTML5视频标签上设置currentTime
EN

Stack Overflow用户
提问于 2011-12-08 03:51:59
回答 1查看 1.5K关注 0票数 5

我正在为ipad上的视频标签编写一个jQuery插件。我的插件所做的其中一件事就是恢复播放你上次停止观看的电影。我在设置当前时间时遇到问题。我发现我只能在"stalled“事件触发后设置它。在一部电影开始播放后(这是一段HTTP直播流视频),ipad上似乎就会响起stalled。我在其他环境中看不到这个事件,比如在PC上的google chrome。所以这段代码可以工作,但是我觉得使用stalled事件很不舒服。我尝试过canplaythroughplaying和其他一些工具,在这些情况下,我对currentTime的更新被忽略了。还有没有人有这方面的经验?

代码语言:javascript
复制
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;
    }
EN

回答 1

Stack Overflow用户

发布于 2012-04-22 11:02:13

这显然是行不通的。iPad对控制视频播放的支持很弱,可能是因为苹果试图创造一种标准的体验(不允许太多的变化)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8421599

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档