简体   繁体   English

如何使用flumotion保护url视频流?

[英]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. 它们存储在mysql数据库中。 The server side is running PHP. 服务器端正在运行PHP。 Inside my website I have a video player that plays a video from a localhost flumotion video streaming server. 在我的网站内部,我有一个视频播放器,可播放来自localhost flumotion视频流服务器的视频。

I want to protect my video streaming url in order to only registered users can access it. 我想保护我的视频流URL,以便只有注册用户才能访问它。 If anyone copy the video URL, it won't be able to play outside my website. 如果有人复制了视频URL,它将无法在我的网站之外播放。

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. 编辑:我的意思是“视频URL”作为这样的URL:192.168.1.221/myvideo.mp4(我在本地主机上运行的flumotion视频流)这是html5视频播放器获取的URL。 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");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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