I'm looking to build a jukebox and I am wo开发者_如何学运维ndering how one would secure songs that are in <audio>
tags with HTML 5. I don't want people to be able to download the song, but I'd like to stream it via those <audio>
tags. Any suggestions?
you could check referer, use some hashing mechanism (unique ID) to verify the streaming player is your jukebox, not the stream saver etc.
BUT: whatever you do, some people will figure it out (or using the last resort - catching the whole stream, following on what kind of data your jukebox sends etc.)
Whatever you give people to listen via a stream can be saved to disk too.
It's possible using Amazon S3 (similar to the way Soundcloud does it) to generate secure mp3 links for use in your HTML5 player. You generate a secure mp3 on S3 that is valid for a very short time (seconds or minutes), there by prevent someone from copying and sharing the link. You will need to generate the link dynamically using SDK/API.
See example of how to use PHP to generate secure links.
This is not possible. In order for the client computer to be able to play the song, the song has to be transferred there. Period.
精彩评论