I am making a site which will have music playing on the site using HTML5 tags and was wondering if there was any way to protect the files from being downloaded?
I am calling the music file through PHP and if needed it selects an OGG file for browsers that don't support MP3.
The actual files are inaccessible to the public but the PHP file can be downloaded and played.
I was wondering if there was anything I could do which would stop people downloading the file but allow it to be played through the tags?
EDIT:
I know that the user must be able to access the URL for the file to play.
I am wondering how to prevent download when the user accesses the file without the tag.
I believe YouTube do a similar thing with the HTML5 video tag (either that or all YouTube videos are now free to download)
EDIT 2:
I have noticed that when a file is downloaded by the user, it does not get passed a HTTP_CACHE_CONTROL variable in the $_SERVER array.
Would this be able to prevent people downloading the file by returning a blank file if they directly download it?