这在最近的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毫秒重试命令,直到成功。
演示strong>