scottschiller / SoundManager2

A JavaScript Sound API supporting MP3, MPEG4 and HTML5 audio + RTMP, providing reliable cross-browser/platform audio control in as little as 12 KB. BSD licensed.
http://www.schillmania.com/projects/soundmanager2/
Other
4.99k stars 768 forks source link

Hide Mp3 URL #240

Open zensabbah opened 5 years ago

zensabbah commented 5 years ago

Hi, I'm using soundmanager2 in my Drupal website. I'd like to hide the full path of my mp3, so I'd like to rename the path in the js before loading the stream. I tried modifying inlineplayer.js and page-player.js but without success. I tried to rename o.href and soundUrl but the player doesn't start any stream and the webpage (the mp3 link wrong) is loaded.

Any help?

Thanks in advance

Cristian

scottschiller commented 5 years ago

@zensabbah Long story short, you cannot hide MP3 URLs, and efforts to do so will not be a good use of your time.

A few examples -

You could try to protect the assets from "hot linking" from other sites, based on the HTTP(s) referrer - but that can be spoofed. You could try preventing right-click -> save as, but people could record the audio playing through the line-out or digitally capture it.

Ultimately, HTML5 Audio() has to get the data from somewhere, and that will be visible in the network panel of the browser's dev tools. From there, it can be opened and saved to disk.

zensabbah commented 5 years ago

Good Morning! Yes, you'right, I need a solution only for "normal users" without IT knowledge :) Any ideas?

liquidotacon commented 5 years ago

Hello, yes I agree with the OP. Everyone knows its always possible to access the files, but not everyone in the world are nerds like us, and most average people would "give up" if they hovered their mouse over a playlist item and saw in their browser status, "/StringOfConfusingWebDevJargon/", rather than "/the/actual/path.mp3" which the average computer user understands the syntax of.

I'm not too experienced with, but am willing to implement, php redirects or other methods to mask the urls somehow, with someone's help. There must be an "easy" front end or back end layer of protection... I hope!

zensabbah commented 5 years ago

I was able to take the URL of the file adding the full url during the SoundManager script process and the song was played. But there are more pieces in the code to modify (for pause, playing another song stopping the last played, for changing the icon ecc.) Should be nice to have documentation of all the script process to easily made modification in the code :)