0

I am working on a metro-looking asp.net application right now. It's a mp3 player where you choose artist (clicking on a tile), then album (same) and you pick a song from the list.

Now I want to pass the picked song's filename and location to jPlayer so that it replaces the actual played song. I know how to play one song specified in the players constructor but have no idea how to change it dinamically.

I don't need to stick to jPlayer, if You can recommend me any other player that can do above in easier way there is no problem :)

(English is not my main tounge, sorry for mistakes, I hope it is understandable).

user1968259
  • 3
  • 1
  • 3

2 Answers2

0

Have you tried this?

$("#jquery_jplayer_1").jPlayer("setMedia", {mp3: url}).jPlayer("play");

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

Community
  • 1
  • 1
Kaizen Programmer
  • 3,798
  • 1
  • 14
  • 30
0

Ok, here is the code that is working for me (set id of a button to 'myPlayButton'):

$("#myPlayButton").click(function () {
             $("#jquery_jplayer_1").jPlayer("setMedia", {mp3: "/Music/a.mp3"}).jPlayer("play");
         });

I have folder named 'Music' in a root catalog of the server.

user1968259
  • 3
  • 1
  • 3