尝试找到一种方法来获取jPlayer播放音频或视频的播放列表。
This page显示了为jPlayer创建播放列表的方法,但这不是用于流媒体目的,而this page显示了流式传输音频的方式。
只是找不到方法..而且我认为没有代码可以粘贴在这里作为非流媒体的播放列表,并且流媒体的方式不能一起使用。
有什么方法吗?
答案 0 :(得分:0)
我遇到与David here相同的问题:它昨天没有用(当我点击播放或点击播放列表中的标题时没有发生任何事情),但今天它奇迹般地按预期工作。我一路上尝试了无数不同的参数组合,但这是最简单的方法,我昨天必须先尝试过。
这里的完整代码现在对我有用。我希望您能找到可能导致您观察到的任何错误的方法有任何不同。
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="UTF-8" />
<title>Your Siblings – Left Embed on Event Page</title>
<link rel="stylesheet" type="text/css" media="all" href="style.css" />
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
<link href="jPlayer/skin/jplayer.blue.monday.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jPlayer/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="jPlayer/add-on/jplayer.playlist.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var playlist = [
{
"title": "Fractured Frequencies",
"mp3": "http://radio.ponyvillelive.com:8032/stream?sid=1;stream.nsv"
},
{
"title": "Brony Radio",
"mp3": "http://dj.bronyradio.com:8000/stream?sid=1;stream.nsv"
},
{
"title": "Alicorn Radio",
"mp3": "http://radio.ponyvillelive.com:8008/stream?sid=1;stream.nsv"
},
{
"title": "Fillydelphia Radio",
"mp3": "http://listen.fillyradio.com:8000/;stream.nsv"
},
{
"title": "Luna Radio",
"mp3": "http://radio.ponyvillelive.com:8002/stream?sid=1;stream.nsv"
},
{
"title": "Everypony Radio",
"mp3": "http://denver5.yourstreamnow.com:8071/;stream.nsv"
},
{
"title": "Ponyville FM",
"mp3": "http://radio.ponyvillelive.com:8014/stream?sid=1;stream.nsv"
},
{
"title": "Sonic RadioBoom",
"mp3": "http://radio.ponyvillelive.com:8020/stream?sid=1;stream.nsv"
}
];
new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
}, playlist, {
swfPath: "jPlayer",
supplied: "mp3",
wmode: "window",
preload: "none",
keyEnabled: true
});
});
</script>
</head>
<body>
<div id="viewer">
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
<div id="jp_container_1" class="jp-audio">
<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>
</div>
</body>
</html>