如何在wimpy播放器中将.xml文件设置为播放列表?

问题描述 投票:0回答:1

如何将.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>
xml mp3 audio-player
1个回答
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>
© www.soinside.com 2019 - 2024. All rights reserved.