Link to home
Start Free TrialLog in
Avatar of VBForever
VBForever

asked on

Allow Play But Prevent Download of MP3

I have a website with mp3.  At the moment, they can be played and downloaded.  Is there some way to allow playing but prevent the right-click 'Save Target As' operation.  

Thanks
Avatar of archrajan
archrajan

This disables right click
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
of course if i disable javascript in my browser settings, the above is useless
>of course if i disable javascript in my browser settings, the above is useless

Well, that could be dealed with by having the mp3 html code being generated by javascript for example. When you turn off javascript, the whole mp3 wouldn't be loadede. But still..

-r-
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Roonaan is right. The only sensible answer is the Flash application, which plays a tune...
(- they still will be able to download this Flash application, mind it! ;-))
Its not possible to prevent the file from being download, as Bustaroom said if you make it as a stream, it's difficult but still i will use"total recorder" to record whatever is being streamed

Partha
Yes, everyone is correct, as soon as they come to your webpage the mp3 then gets transfered to thier machine. It is inescense already downloaded. There is no way to prevent them from doing so
archrajan ,
disabling right click hmm, just by pressing esc i can break it :)

Partha
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
do low quality or only part of song or add some voice every 5 seconds. "this is a demo, piiiiippp" :)
Avatar of VBForever

ASKER

The java script solution only applys to the page itself, but not to the button object clicked to play the file.  This is close to what I'm looking for.  Is there a way to apply the function to the button?

I have a hard time believing it's impossible to achieve this.  Yes, you can use an app like total recorder.  But the object is to prevent downloading the file, not prevent recording.

The comment from justinbillig is both useless and silly.

Playing an mp3 does not save it to disk.  If that were true, all of our hard drives would be full in no time.

Let's hear some solutions.  Is this too hard?  Do I need to offer more points?

Jim


Jim, if you dont want people to get your mp3, don't put it on the internet, that is the only solution that will work 100%.
>The comment from justinbillig is both useless and silly.
I must agree with him, sorry

>Playing an mp3 does not save it to disk.  If that were true, all of our hard drives would be full in no time.
Have you ever heard of "temporarily internet files", well that is a directory that stores file that is beeing listened from your page. This folder is always filled with "temp" files. Old contens get automaticaly deleted when new content arrive (images, mp3s, html). How many files can be stored depends on settings how huge that folder can be.

To prove my "theory" got to your page listen to your song and after that go to your temp internet files (located in document settings...).

If someone can listen to it, it can also have it. End of story. :)

Cheers
ha, so my comment was useless and silly !

if they are listening to it it is on thier machine, if you dont want people to download it, dont put it on hte intenet
I think the suggestion to stream is the most interesting possibility so far.  I often listen to internet radio stations that stream the music via a separate window with Media Player embedded in it.  I do not see any song files saved anywhere with that.

I was aware of temp files of course, but I was thinking of explicit saves.

Jim