I think I have everything configured correctly, but I can not stream any video with flowplayer and this plugin actived.
The structure of the files is:
index.php
sectimestamp.php
secure/
--.htaccess
--video.mp4 <-- Mi video (2.4 MB)
--video.php
flowplayer/
--flowplayer-3.2.18.swf
--flowplayer.controls-3.2.16.swf
--flowplayer.securestreaming-3.2.9.swf
(All files and dirs set with 755 permission)
In index.php:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- A minimal Flowplayer setup to get you started -->
<!--
include flowplayer JavaScript file that does
Flash embedding and provides the Flowplayer API.
-->
<!-- flowplayer depends on jQuery 1.7.1+ (for now) -->
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="flowplayer/flowplayer-3.2.13.min.js"></script>
<script>
$(document).ready(function() {
$f("player", "flowplayer/flowplayer-3.2.18.swf", {
plugins: {
secure: {
url: "flowplayer/flowplayer.securestreaming-3.2.9.swf",
timestampUrl: "sectimestamp.php"
}
},
clip: {
baseUrl: "secure",
url: "video.mp4",
autoPlay: false,
urlResolvers: "secure",
scaling: "fit",
}
});
});
</script>
</head><body>
<div id="player"></div>
</body></html>
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');
}
?>
.htaccess:
RewriteEngine on
RewriteBase /secure
RewriteRule ^(.*)/(.*)/(.*)$ video.php?h=$1&t=$2&v=$3
RewriteRule ^$ - [F]
RewriteRule ^[^/]+\.(flv|mp4)$ - [F]
Mod Rewrite is enabled in apache.
Server info:
PHP Version 5.6.0-1 Apache/2.4.10 (Debian)
What is my problem? Thanks in advance.
Ps. Sorry for my bad english.