【问题标题】:How to set .xml file as playlist in wimpy player?如何在 wimpy 播放器中将 .xml 文件设置为播放列表?
【发布时间】:2015-02-09 19:14:46
【问题描述】:

如何将.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】:

    您拥有相同的代码,但不是将“媒体”选项设置为 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-17
      • 1970-01-01
      • 2016-05-01
      • 2023-02-05
      • 1970-01-01
      • 1970-01-01
      • 2014-11-25
      • 1970-01-01
      相关资源
      最近更新 更多