这对我最近的firefox(桌面版,仅在osx上测试)不起作用:
$("#jpId").jPlayer("play", 42); // seek 42sec. not working
$("#jpId").jPlayer("play"); // works
它什么都不做。 test case here。 赞赏的想法。
编辑: 解决方法是
// load sound and start play without time, then again with time. odd.
$("#jpId").jPlayer("play");
$("#jpId").jPlayer("play", 42);
答案 0 :(得分:0)
<强>解强>
请改为尝试:
setTimeout(function(){
$("#jpId").jPlayer("play", 42);
}, 100);
<强>原因强>
需要调用setTimeoout
,因为根据play
方法的文档:
如果在
setMedia
命令之后立即使用time
参数发出,并且当浏览器使用HTML5解决方案时,此命令将最初失败并设置内部超时以重试每个命令100毫秒,直到成功。
<强>样本强>
请参阅this jsFiddle进行演示。