[英]How to play multiple mp3 files with Jplayer?
在这里,我使用的Jplayer是mp3播放器的开源插件。
myPlaylist.add({
title:"Tempered Song",
artist:"Miaow",
mp3:"http://www.jplayer.org/audio/mp3/Miaow-01-Tempered-song.mp3",
});
但是,假设我有three
锚标签,其中包含三种不同的音乐。
<a href="#">This is song 1</a>
<a href="#">This is song 2</a>
<a href="#">This is song 3</a>
显然,我无法将音乐URL放入href
。 单击后,它将自动开始下载或打开窗口媒体播放器。
那么,如何将三个不同的音乐源文件放入该jquery脚本中? 还是您使用mp3文件而不是使用定位标记来播放mp3文件?
myPlaylist.add({
title:"<Song name>",
artist:"<singer name>",
mp3:"<MP3 URL of three different song>",
});
我想将这三个不同的mp3文件播放到一个播放器中,但感到困惑。 我在Google中找不到jplayer倾向于与jplayer使用不同的多个mp3文件。 请帮忙怎么做?
帮助,将不胜感激!
这很容易,而无需使用jquery attr进行锚定。
<a href="#" music-url="songs_music_url">This is song 1</a>
在jQuery中:
myPlaylist.add({
title:"<Song name>",
artist:"<singer name>",
mp3:$('a').attr('music-url'),
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.