/    Sign up×
Community /Pin to ProfileBookmark

amending right click menu to download audio from jPlayer

I am using a javascript audio player on a webpage that has an option to download the track by right clicking on a link called ‘mp3’ at the end of each track in the playlist. When the user right clicks on the track name however all that can be downloaded is an html file.

I am trying to find a way of changing this so that right clicking on the track and choosing the ‘save link as’ option will download the mp3. I have been led to believe that I can use a script such as this one:

[URL=”http://abeautifulsite.net/blog/2008/05/jquery-right-click-plugin/”]http://abeautifulsite.net/blog/2008/05/jquery-right-click-plugin/[/URL]

to generate a custom content menu for downloading tracks, or somehow downloading the mp3, but I am at a loss at to how to do this.

Here’s a screenshot of a track in the playlist:

[url]http://emberapp.com/nickharambee/images/safari-3/sizes/m.png[/url]

And here is the source:

[CODE]{name:”foster manganyi na tintsumi ta tilo – zion (ndzi teke riendzo no. 1) <span style=”color:#BDBDA1; font-size:12px;”>[from nick]</span>”,mp3:”./songs//nick/zion.mp3″}[/CODE]

I would be grateful for any advice on getting this working,

Thanks,

Nick

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@mityaMar 24.2011 — If you're right-clicking on a link that points to an MP3, and trying to save it results in downloading an HTML file rather than an MP3, that's a server issue, not an MP3 issue. You might have some funky HTAccess going on there.

As for custom right-click menus, there's no cross-browser way of doing this. The normal work around is to detect the right-click event, position your own menu-esq list of options at the position of the mouse cursor, and return false from the event handler so the native menu doesn't appear.
×

Success!

Help @nickharambee spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...