我正在编写下面的代码以使用 jwplayer 播放音频
<?php
$extension="m4a";
$audiopath="http://myapp.com/player.php";
?>
<div id="jquery_jplayer_1" class="media" autoplay></div>
<div id="jp_container_1" class="player">
<div class="controls">
<div class="playback">
<a href="#" class="jp-play" tabindex="1"><i class="icon icon-play"></i></a>
<a href="#" class="jp-pause" tabindex="1"><i class="icon icon-pause"></i></a>
</div>
</div>
<div class="controls jp-no-solution">
<div class="playback">
<i class="icon icon-warning-sign warning"></i>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", { "<?php echo $extension ?>": "<?php echo $audiopath ?>" });
$(this).jPlayer("play");
},
supplied: "<?php echo $extension ?>"
});
$("a").click(function(event) {
event.preventDefault();
});
});
</script>
音频在桌面自动播放,但在 iphone 和 ipad 设备中不自动播放。谁能告诉我如何解决这个问题