2014-12-07 52 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