保护视频不被浏览器窃取 [英] protecting videos from being stolen in browser

查看:116
本文介绍了保护视频不被浏览器窃取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的逻辑下面,我试图阻止视频被盗,但我被困在某个地方。



i创建了一个页面index.php



Below i logic i am trying to prevent video from being stole but i got stuck some where.

i created a page index.php

<?php

    session_start();

    $_SESSION["check"]="aaa";

?>
<video width="320" height="240" controls>
    <source src="video.php" type="video/mp4">
</video>







和video.php






and video.php

$file = "a.mp4";
    $file_size = filesize($file);
    $fp = fopen($file, "rb");
    $data = fread ($fp, $file_size);
    fclose($fp);
    header ("Content-type: video/mp4");

    if(md5($_SESSION["check"])=="aaa"){
       echo $data;
    }else{

    }





但是我希望当用户打开video.php他应该只是得到一些消息或错误而不是视频

因为用户可以获得关于video.php的会话价值

他仍然能够以任何方式查看和保存视频来实现此目的



but i want when user open video.php he should simply get some message or error but not videos
as user can get value of session on video.php
he still is able to see and save video any way to pervent this

推荐答案

_SESSION [check] = aaa ;

>
< video 宽度 = 320 height = 240 控件 >
< 来源 src = video.php type = video / mp4 >
< / video >
_SESSION["check"]="aaa"; ?> <video width="320" height="240" controls> <source src="video.php" type="video/mp4"> </video>







和video.php






and video.php


file = a.mp4;
file = "a.mp4";


file_size = filesize(
file_size = filesize(


这篇关于保护视频不被浏览器窃取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆