2014-12-07 55 views
0

我的客户希望他的视频隐藏,并且没有可能被下载或复制(或者至少难以做到)。Flowplayer Secure Streaming“Stream not found”

我正在尝试使用流水游戏安全流式传输,但是我无法使其工作!

我得到这个错误:

200, Stream not found, NetStream.Play.StreamNotFound, clip: '[Clip] 'secure/ad722768cfa6f10b51b7e317c8dd1ca4/1417957647/v.mp4"

它说,视频没有被发现,但它放在安全/ v.mp4,因为它应该(是吗?)

UPDATE1

我忘了提,我所要求的安全文件夹内的Apache重写规则...

安全/的.htaccess

RewriteEngine on 
RewriteBase /secure 

RewriteRule ^(.*)/(.*)/(.*)$ video.php?h=$1&t=$2&v=$3 

RewriteRule ^$ - [F] 
RewriteRule ^[^/]+\.(flv|mp4)$ - [F] 

UPDATE2

我做到了!这是一个愚蠢的简单的事情:

我用的EasyPHP Web服务器测试,该URL是本地主机/ V/index.html的

我做了一个测试,从/ V文件夹移动的所有内容到根和其成功了!

现在我htaccess的教​​训,我需要穿上RewriteBase从根开始的完整路径,在我的情况,我需要设置此:

RewriteBase /v/secure 

的代码:

指数。 HTML

<head> 
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> 
<script type="text/javascript" src="flowplayer-3.2.13.min.js"></script> 
<script> 
    $(document).ready(function() { 
    $f("player", "flowplayer-3.2.18.swf", { 
     plugins: { 
     secure: { 
      url: "flowplayer.securestreaming-3.2.9.swf", 
      timestampUrl: "sectimestamp.php" 
     } 
     }, 
     clip: { 
     baseUrl: "secure", 
     url: "v.mp4", 
     urlResolvers: "secure", 
     scaling: "fit", 
     } 
    }); 
    }); 
</script> 
</head> 
<body> 
<div id="player"></div> 
</body> 

sectimestamp.php

<?php 
echo time(); 
?> 

安全/ video.php

<?php 
$hash = $_GET['h']; 
$streamname = $_GET['v']; 
$timestamp = $_GET['t']; 
$current = time(); 
$token = 'sn983pjcnhupclavsnda'; 
$checkhash = md5($token . '/' . $streamname . $timestamp); 

if (($current - $timestamp) <= 2 && ($checkhash == $hash)) { 
    $fsize = filesize($streamname); 
    header('Content-Disposition: attachment; filename="' . $streamname . '"'); 
    if (strrchr($streamname, '.') == '.mp4') { 
    header('Content-Type: video/mp4'); 
    } else { 
    header('Content-Type: video/x-flv'); 
    } 
    header('Content-Length: ' . $fsize); 
    session_cache_limiter('nocache'); 
    header('Expires: Thu, 19 Nov 1981 08:52:00 GMT'); 
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 
    header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); 
    header('Pragma: no-cache'); 
    $file = fopen($streamname, 'rb'); 
    print(fread($file, $fsize)); 
    fclose($file); 
    exit; 
} else { 
    header('Location: /secure'); 
} 
?> 

我已经尝试过这个>Flowplayer Secure Streaming with Apache但我也得到上述错误。

有没有人使用流水游戏安全流?我究竟做错了什么?

回答

1

我想通了,什么是错的,在htaccess你需要穿上RewriteBase从根开始的完整路径,在我的情况,我需要设置此:

RewriteBase /v/secure

+0

谢谢你很多关于您的帮助解决了我的问题 – Majda 2014-12-15 00:49:44