开发者

Streaming an mp4 with php

开发者 https://www.devze.com 2023-04-11 13:21 出处:网络
I am looking for a way to stream the contents from a mp4-file to mediaelement - the problem here is that I need to make sure that people who access the files are logged in - and they must not be able

I am looking for a way to stream the contents from a mp4-file to mediaelement - the problem here is that I need to make sure that people who access the files are logged in - and they must not be able to easily decode the url and post it elsewhere.

I've got the login system taken care of - just not sure how to combine it with streaming an mp4.

I have been 开发者_如何学Csearching around and have yet to find any soulutions, unfortunatly. All ideas are welcome.

Regards, Anders


A quick search has yielded this result for me: http://www.devshed.com/c/a/PHP/Video-Streaming-PHP-Script-Tutorial/

I see no need to write out what it says, just read it there. I'll expand on it here however. Once you've got your script fully working (streaming) then you implement the authentication methods. To do this you'll probably want to include your login checking script and check whether they're logged in or not - if they aren't logged in then just do something like die('authentication error');.

Then, if you place all the videos in a single sub-directory, you could use a .htaccess rule to completely stop users accessing videos directly! (not that they could realistically find the real URL anyway).

This does not stop users downloading to share your videos - but it would mean they had to be logged in to watch them (like you want). As for downloading to share; perhaps a watermark?

0

精彩评论

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

关注公众号