[英]jplayer bug for iphone
我在我的网站上使用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>
就像你可以看到有2个按钮。 它们都做同样简单的事情 - 加载媒体并播放它,但第二个函数使用dalay函数。 它可以在任何地方使用但在iphone上没有。
我在几台设备上尝试过该页面http://m.musiclib.org/test/examples/blue.monday/iphone.html
所以我的问题是为什么呢? 实际上对我来说,如果我尝试从非主线程运行播放器,它看起来像是停止为iphone工作。因为它在每次尝试运行播放器后都会停止工作,例如在ajax请求之后。
这里有什么帮助? 我能以某种方式修复它吗?
公爵
尝试
$(window).load(function(){})
而不是文件
$(document).ready(function(){})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.