如何将.xml
播放列表放入wimpy播放器中,我的代码适用于单个MP3,如下所示:
<div id="MyTarget">
<script>
// Create a "new" wimpy player and set the "target" option
// to match the Target Element's "id".
var myPlayer = new wimpyPlayer({
Target: "MyTarget",
media: "../ppa/1/101/song1.mp3",
skin: "/play/wimpy.skins/038.tsv",
startUpText : "hello"
});
</script>
</div>
答案 0 :(得分:0)
您拥有相同的代码,但不是将“media”选项设置为MP3文件,请将URL设置为XML文件:
media: "/path/to/playlist.xml",
Wimpy还允许您将Javascript直接合并到“媒体”选项中。所以你可以将javascript播放列表作为:
<!-- The DIV to put wimpy into -->
<div id="MyTarget"></div>
<script>
// A javascript playlist:
var playlist = [
{
file : "../song1.mp3",
title : "Song One"
},
{
file : "../song2.mp3",
title : "Song Two",
}
];
// Create the player
var myPlayer = new wimpyPlayer({
target : "MyTarget",
media : playlist, // Setting the javascript "playlist" var here
startUpText : "hello"
});
</script>