jquery - How to make it harder for people to download mp3s on my website -


i realise impossible totally prevent people downloading mp3s on website know there ways make harder. mean how can prevent them looking @ source code , opening mp3 links, or using developer tools inspect element , seeing link mp3 there?

there many mp3s (up hundreds) on page of short (like 1 second) not make sense think make them streaming.

at moment have mp3s playing id using jquery.

$('a').click(function (e) { e.preventdefault(); var played = $(this).attr("class"); $("audio")[played].play(); }); 

then in html can found , downloaded:

<audio class="0" src="sound.mp3"></audio> 

thanks input.

being have lot of code in place, might not solution, can give you:

using jplayer, change css display: none. remove ability interact player. have handle interactions yourself, prevent downloads.

update:

so real question how hide source code. there number of methods out there, 1 method of doing totally disable right clicking on webpage. this, @ least, makes harder @ source code.

to fair, there no real way hide source code. page still has make use of code, needs in readable format.

<script language="javascript"> document.onmousedown=disableclick; status="right click disabled"; function disableclick(event) {   if(event.button==2)    {      alert(status);      return false;        } } </script> 

or html attribute can handle it:

<body oncontextmenu="return false"> ... </body> 

this should disable right click on page.

another method js encryption, have no experience with. this nice site encryption, how handle you.

good luck, hope helps.


Comments