jplayer2.9.2搜索/播放时间在Firefox中不工作



这在最近的firefox(桌面,仅在osx上测试)中不起作用:

$("#jpId").jPlayer("play", 42); // seek 42sec. not working
$("#jpId").jPlayer("play"); // works

它什么也不做。这里是测试用例。想法赞赏。

编辑:解决方法是

// load sound and start play without time, then again with time. odd. 
$("#jpId").jPlayer("play");
$("#jpId").jPlayer("play", 42);
<

解决方案/strong>

试试这个:

setTimeout(function(){ 
    $("#jpId").jPlayer("play", 42);
}, 100);

需要调用setTimeoout,因为根据play方法的文档:

如果在setMedia命令之后立即发出time参数,并且当浏览器使用HTML5解决方案时,该命令将最初失败,并设置内部超时以每100毫秒重试命令,直到成功。

最新更新