我在我的站点上使用了http://jplayer.org/的最后一个版本,并且在从线程加载iphone时遇到了问题。
页面非常简单。
<html>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.js" ></script>
<script type="text/javascript" src="script/jquery.jplayer.js" ></script>
<title>Test iphone</title>
</head>
<body>
Test
<script>
$(document).ready(function () {
$("#jquery_jplayer_1").jPlayer();
});
function SuperSimple() {
$("#jquery_jplayer_1").jPlayer("clearMedia");
$("#jquery_jplayer_1").jPlayer("setMedia", { artist: "Queen", mp3: "/test/examples/blue.monday/music/Innuendo.mp3", title: "Innuendo" });
$("#jquery_jplayer_1").jPlayer("play");
}
function SuperSimpleWithDelay() {
setTimeout(function () {
$("#jquery_jplayer_1").jPlayer("clearMedia");
$("#jquery_jplayer_1").jPlayer("setMedia", { artist: "Queen", mp3: "/test/examples/blue.monday/music/Innuendo.mp3", title: "Innuendo" });
$("#jquery_jplayer_1").jPlayer("play");
}, 5000);
}
</script>
<div id="jquery_jplayer_1"></div>
<br>
<button onclick="SuperSimple()"> SuperSimple </button><br><br>
<button onclick="SuperSimpleWithDelay()"> SuperSimple with delay </button><br><br>
</body>
</html>就像你看到的,有两个按钮。他们都做同样的事情-加载媒体和播放它,但第二个功能使用达莱功能。它在任何地方都能工作,但在iphone上不起作用。
我已经在几个设备上尝试过那个页面的http://m.musiclib.org/test/examples/blue.monday/iphone.html
所以我的问题是为什么?实际上,对我来说,如果我尝试从非主thread.Because运行播放器,它看起来就会停止工作--每次我尝试运行播放器时,都会延迟一些时间,例如在ajax请求之后。
这里有什么帮助吗?我能修好它吗?
杜克
发布于 2015-11-10 09:02:33
试一试
$(window).load(function(){}) 而不是文件
$(document).ready(function(){})https://stackoverflow.com/questions/33285552
复制相似问题