Search code examples
javascriptjqueryjplayeraudio-player

Add a download button on jplayer playing track


I am successfully initializing jplayer in:

$("#jquery_jplayer_1").jPlayer({
    ready: function() {
        $(this).jPlayer("setMedia", {
            title: options.title || '',
            mp3: options.mp3[scope.activeTrack] || null,
        });
    }
});

I know I can get the data with:

jQuery("#jquery_jplayer_1").data('jPlayer')

What I don't know is how can I get the current streaming url in order to create a download button?


Solution

  • $(yourSelector).data().jPlayer.status.src
    

    It's all on the website: http://jplayer.org/latest/developer-guide/#jPlayer-event-object