简体   繁体   中英

How to protect an url video streaming using flumotion?

This is my scenario: I have a localhost website that only logged in users can visit. They are stored on a mysql database. The server side is running PHP. Inside my website I have a video player that plays a video from a localhost flumotion video streaming server.

I want to protect my video streaming url in order to only registered users can access it. If anyone copy the video URL, it won't be able to play outside my website.

How can I do it?

EDIT: I mean "video url" as url like this: 192.168.1.221/myvideo.mp4 (my flumotion video streaming running on localhost) This is the url that the html5 video player get. And I want to protect it from copy and paste in another browser tab. Because if i do it, I can play it without need my website.

You could check if the user is logged in, by checking if a session is set depending on how your login system works.

function is_logged_in(){
    if (!isset($_SESSION['you_session_name']))//user is not logged in..
        return false;

    return true;
}

Then in your video page check if the user is actually logged in, and if it's not redirect him on another page:

if (!is_logged_in()) header("Location: http://redirectsite.com/page");

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