开发者

let flash play media from a site that needs you to be authenticated

开发者 https://www.devze.com 2023-04-12 15:45 出处:网络
I have a website when requires the user to be logged in to access the contents. I need to embed some music player which can play some mp3.开发者_如何学JAVA But the mp3 download link cannot be public,

I have a website when requires the user to be logged in to access the contents. I need to embed some music player which can play some mp3.开发者_如何学JAVA But the mp3 download link cannot be public, so is there any way to pass the PHP session to any flash based players so that the user can listen to it.

Edit: I would want a ready made flash player which has this functionality. Ideally something like the yahoo media player which can be embedded easily


First, you need to remember that if you're serving MP3 files via straight download (not streaming) anyone can simply download the file and then share it (even if the originally-used URL itself expires). So if you really need to protect your files, then use e.g. Flash Media Server to stream the files.

If you don't need that level of protection, you can still protect the link. Instead of linking the media player directly to your MP3 file, link it to a .php script that serves the MP3 file. The PHP script will check the session; if it's valid, it will serve the correct file; otherwise, it will serve a this link is expired MP3. Here's a topic covering that.

Again, though, if you're serious about protecting the files you need to use a streaming server.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号