简体   繁体   中英

HTML5 <audio> Hiding the audio source

I'd like to be to use the HTML5 <audio> tag to stream mp3 files from my website. The problem is, any ol' Joe can view the page source and see the location of the streaming mp3 file, then they'd be able to download the whole file directly (as opposed to 'streaming' via the player).

Is there anything I can do to keep the user from being able to view the location of the mp3 files on my server? What options do I (or don't I) have?

I'm using Apache with PHP, if that's relevant.

you could use a php script to pull the audio file for you. set the source to a php script rather than the actual file. Then in the php script you could do checks to make sure the request is valid before returning the mp3 file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM