'How to hide audio source in viewpage source just like spotify or soundcloud does?

I am making a music player using javascript but want to hide the music source in the view page source code. How do I make sure that no one is able to download the EXCLUSIVE music?

Thanks !



Solution 1:[1]

The short answer: You simply cannot! On the internet everything is freely accessible.

The long answer: All you can do is make it pretty hard for someone to get to that information. This can be done by code obfuscation (Try https://obfuscator.io/) and hiding the information, so it is not obviously visible. (Some websites add enough whitespace at the top of their source code, so if the source code view is opened by a non expert, it looks like it is empty.) But any expert with enough time and effort will find the content in the end.

If someone uses the network tab in the browsers developer tools (CTRL + SHIFT + I), the incoming and outgoing requests are visible. There are even more sophisticated network sniffers, like Fiddler or Wireshark, which offer to save packages to the harddisk.

Some modern streaming websites provide the content with streaming servers, which makes it a little bit harder to get the streamed content, but even that is possible, by downloading all the chunks and combining them. (Even content poisened with DRM can be downloaded, by just playing it and recording the screen.)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1