Changing songs on jPlayer by clicking a link, hosted on Amazon S3

大城市里の小女人 提交于 2019-11-29 04:29:17
Jacob Terry

Well it appears that the only issue was a lack of brackets around the mp3: url part of jPlayer("setMedia"....

so it should have been (...).jPlayer("setMedia", {mp3: url}).(...)

After Searching a lot it could be one of the solutions too.

 function songs(json1) {
$("#jquery_jplayer_1").jPlayer("destroy"); //this will destroy previous jplayer content and then if you again call this function it will add the new url of you audio song to the jplayer
var audio_url_inside = json1.audio_url;
$('#jquery_jplayer_1').jPlayer({
ready:function (event) {
$(this).jPlayer("setMedia", {
mp3:audio_url_inside,
oga:audio_url_inside
}).jPlayer("play"); //attemp to play media
},
swfPath:"http://www.jplayer.org/2.1.0/js",
supplied:"mp3, oga"
});
}

:Hope it will help.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!