Allow User To Download Mp3 Files When They Click On The Link Rather Than Streaming The Audio In The Browser?
Feb 9, 2011
I need to allow user to download mp3 files when they click on the link rather than streaming the audio in the browser. Need to use only Javascript to download the file.
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]
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]
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"}
I wanna play streaming audio (an asx.file) trough javascript. I allready found a tutorial on the net. Till so far it works (I can push play, pause and stop), but I want to change the volume to. An example: Code:
Do you know where the problem is? One thing that I must say is that the tutorial (where I took it from) worked with a wav-file, as you can see I work with a streaming file (asx-file).
im1music.net has a download page which is a javascript. Basically when you click on the song title it redirects you to a page which gives you a preview player and a download link. I was just wondering what Javascript this is, as I wish to have it on my site.
How can I play midi and/or audio files using JavaScript? I'm hoping there are some calls/APIs I can use that I am unaware of. My JavaScript book from O'Reilly seems rather lacking in this area.
My computer seems to have problems with its javascript when opening new windows from certain sites that are either audio or video files. I simply have not got a clue where to begin.
When the user visits a page, an iframe will be displayed. What is the best way to force the user to click something in this iframe? I suppose I could do that thing where the mouse always has a part of a div "glued" to it, so wherever they click, the certain area is clicked. But, then they could just hit the back button.
Im trying to prevent the user from clicking any other links on my page when the user have selected/clicked a href once.
Sometimes it takes a while before the next page loads so some user will try clicking other links or the same link.
I can prevent this when i use buttons by calling onclick and in a javascript getElementsByTagName("input") and then check the type to be type of "button" or "submit" which i then disable. It works.
This also works for href html tags by calling onclick and in a javascript remove all href, BUT it also stops everything, even the request that is about to happen.
If i use disable getElementsByTagName("a") on href like with buttons it does not get unclickable just get a grey color but you can click on it.
Any workaround to this? This is a seriuos web app so I want the solution where i disable ALL links on my page so it is not possible to click on any after the first time.
All the links is NOT in a form only links using <a href="gosomeplace"> click this link</a> .
Just wondering if it's possible to use JQuery to create a 'download all' link? I have a number of .zip files linked to in a page and I want to offer a quick way to download all of them at once or specific sets based on the id of the link. That possible?
I have a website that I am maintaining that was built some time ago. There is a little speaker icon on a page that allows a user to click to hear the pronunciation of a word.
I am trying to get started using JQuery, but I find I can't even get to lesson #1. When I go to jquery.com and click to download the latest version (or any version) it doesn't "download" anything. It opens the file as a webpage in my browser and I see all the JQuery in one big string. Why won't the file just download? Is it the browser I am using? Is it my Mac?
I have an array that is made and modified in a function. At the end of the function I want to have the array to be sent as a file to be downloaded to the user. How can I go about doing this?
I am trying to trigger the download of a file from the browser (at the moment a word file!).
But when I supply the link as an '<a href='...'>' html tag the document appears in the browser. Although this is quite good I unfortunately need to open up the download dialog box.
How to download a pdf link? suppose we have a pdf url [URL] now i have to create a button on click of which it downloads that pdf. i have tried window.open() method in javascript but it opens it in another window. is there a way to download a pdf link using javascript or ajax.
I got a contact form written out and it is working and it was integrated from this site:Download link at the bottom to whoever needs it. and I integrated it into my site:But how can I set it so once someone successfully sends a message, the textareas get automatically erased?
is it possible to track whether user is typing in the browser's address bar or aside google search box ( which appears in most of the browsers besides address bar)? if yes, I would like to know HOW? references are welcome.
I have several .js files that are included in various jsp pages.
I've read somewhere(can't remember where?) that the browser caches .js files.
If this is the case is it better to include all of them in the 1st page of my app regardless if they're used in this page & take a performance hit once? - or am I missing something?
I have a tabular html form where users can enter a number of titles and file specifications in columns. Having the users actually ENTER the full filespec (path AND filename) has proven problematic so I'd like to give them a way to browse around the local system on which the browser is running, and select the file. When done, they hit Submit and the filespec get sent to php along with everything else on the form.....
So far I've gotten lots of "you can't do that" (I stupidly thought the input type="file" would actually work), and found a few javascript samples that MIGHT do it if I could get any of them to work. I CAN'T be the first person ever to need a way for users to do this to upload or email files or whatever. I"m sure I'm missing something important, but I'm astonished there isn't a reasonable way to do this in html.
First, CAN THIS be done in javascript - Display the form. Show any previously entered values in the fields. Let the user change existing filespecs, enter new filespecs, or browse the system to select filespecs. Put whatever they select in the field. When they hit submit send the filespec (the WHOLE filespec) along with the other data back to php for storage?
If so, does anyone have a pointer to a good, simple, idiot-proof example? Unfortunately, at this time I know VERY little about javascript, so I need something that can be understood and quickly implemented...
I've been tasked with the javascript and layout for an application that uses the browser engine (embedded browser I supposed it is). So it's not the actual browser, it looks like an application. Problem is, you know how you can drag and drop an image or html file into a browser and it will open it? Well, can this be prevented via javascript?
I want to use jquery to detect what type of browser you are using and display a link to a .wmv file if you are on IE or display a link to a .mp4 file if you are any other type of browser.I have this script declaration in my <head> section.