android - Jplayer 播放列表无法在 Android 或 iOS 中使用
<p><p>我的 Jplayer 实现似乎可以在任何地方工作,但在移动设备和平板电脑上,基本上是 Android 和 iOS。在 Android 上打开时,播放列表播放按钮被禁用,歌曲链接不可点击。</p>
<p>这是我的脚本:</p>
<pre><code>$(document).ready(function () {
var myPlaylist = new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
}, [
{
title: "Commerical",
mp3: "/content/audio/commercial.mp3"
},
{
title: "Characters",
mp3: "/content/audio/characters.mp3"
},
{
title: "Attitude",
mp3: "/content/audio/attitude.mp3"
},
{
title: "Business",
mp3: "/content/audio/business.mp3"
},
{
title: "Narrator",
mp3: "/content/audio/narrator.mp3"
},
{
title: "Younger",
mp3: "/content/audio/younger.mp3"
},
{
title: "Guy Next Door",
mp3: "/content/audio/guy-next-door.mp3"
},
{
title: "English/British Accent",
mp3: "/content/audio/english-accent.mp3"
},
{
title: "Movie Trailers",
mp3: "/content/audio/movie-trailers.mp3"
},
{
title: "Smooth",
mp3: "/content/audio/smooth.mp3"
},
{
title: "High Energy",
mp3: "/content/audio/stadium-announcing.mp3"
},
{
title: "Phone System",
mp3: "/content/audio/phone-system.mp3"
},
{
title: "Sam Elliot",
mp3: "/content/audio/sam-elliot.mp3"
},
{
title: "Stadium Announcing",
mp3: "/content/audio/stadium-announcing.mp3"
},
{
title: "Cops and Detectives",
mp3: "/content/audio/cops-and-detectives.mp3"
}
],
{
swfPath: "js",
solution: "html,flash",
supplied: "mp3",
wmode: "window",
smoothPlayBar: true,
keyEnabled: true
});
$("#jquery_jplayer_1").bind(jQuery.jPlayer.event.play, function (event) {
var current = myPlaylist.current,
playlist = myPlaylist.playlist;
jQuery.each(playlist, function (index, obj) {
if (index == current) {
$('.audio.active').removeClass('active');
$('.audio').hide();
var audio = $('.audio').get(current);
$(audio).fadeIn('slow');
return false;
}
});
});
});
</code></pre>
<p>还有html:</p>
<pre><code><div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio" style="float:left;">
<div class="jp-type-playlist">
<div class="jp-gui jp-interface">
<ul class="jp-controls">
<li><a href="javascript:;" class="jp-previous" tabindex="1">previous</a></li>
<li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
<li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
<li><a href="javascript:;" class="jp-next" tabindex="1">next</a></li>
<li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
<li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
<li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
<li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
</ul>
<div class="jp-progress">
<div class="jp-seek-bar">
<div class="jp-play-bar"></div>
</div>
</div>
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-current-time"></div>
<div class="jp-duration"></div>
<ul class="jp-toggles">
<li><a href="javascript:;" class="jp-shuffle" tabindex="1" title="shuffle">shuffle</a></li>
<li><a href="javascript:;" class="jp-shuffle-off" tabindex="1" title="shuffle off">shuffle off</a></li>
<li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
<li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat off</a></li>
</ul>
</div>
<div class="jp-playlist">
<ul>
<li></li>
</ul>
</div>
<div class="jp-no-solution">
<span>Update Required</span>
To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
</div>
</div>
</div>
</code></pre>
<p>为了使网站的所有元素都能正常工作,我使用的是 jquery 版本 1.7.2(即使使用迁移脚本,最新的 jquery 也无法识别我的页面 anchor )。</p>
<p>有人对 jplayer 播放列表有经验吗? TIA</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>问题是由于媒体查询将 <code>.panel-container</code> 更改为 <code>float: none</code>。将其更改为 <code>clear: both;</code></p>
<p>例如</p>
<pre><code>@media only screen and (max-width: 767px) and (min-width: 480px)
.panel-container {
width: 400px;
min-height: auto;
clear: both;
</code></pre>
<p>您需要决定该部分的布局,因为 jPlayer 会在较小的分辨率上卡在左侧。</p></p>
<p style="font-size: 20px;">关于android - Jplayer 播放列表无法在 Android 或 iOS 中使用,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/24540321/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/24540321/
</a>
</p>
页:
[1]