I have a bunch of audio files that I want people to be able to listen to. My website has an audio player so that people can listen to them. My audio player looks something like this (though this is simplified):
<audio>
<source src="https://storage.googleapis.com/my-bucket/my-file.mp3">
</audio>
The problem is that it would take almost no work for someone to just grab all of those MP3 urls and download the files.
Is there a way that I can make it so that it's only accessible for streaming, but not for downloading?
How do sites like SoundCloud handle this problem?
For example, SoundCloud lets you play people's songs. However, when I look in Firefox's Network tab I see that when playing a single song it's sending many requests to different MP3 files such as:
/media/3831430/3943025/c9OpfFFp3iYQ.128.mp3
/media/3192789/3352448/c9OpfFFp3iYQ.128.mp3
/media/3033128/3192788/c9OpfFFp3iYQ.128.mp3
Does anyone know what type of system they have going on there? Is this a common anti-piracy pattern for MP3 files that I could, perhaps, implement?