关于使用flowplayer在php中安全地流式传输视频

时间:2014-06-12 16:13:48

标签: php flowplayer

我使用了以下教程flow player secure streaming with Apache,我现在面临的问题是只能播放某些mp4文件。我是流媒体播放器的新手,我搜索谷歌这个问题,并没有解决我的问题。

我检查上传了一个50 MB的文件,它运行正常,但是当67 mb的相同视频文件无法播放时...请对此有任何帮助将不胜感激,任何特定原因导致播放器无法播放?

我的代码如下 file upload.php page

<?php
$videofilename = $name;
$hash = md5('1234');
$timestamp = time();
$videoPath = $hash.'/'.$timestamp.'/'.$videofilename;
$baseUrl = “uploads/”;
$videoPath = $baseUrl. $videoPath ;
echo $videoPath;
echo“<script src='scripts/flowplayer-3.1.4.min.js' type='text/javascript'></script> ”;
echo “<a href='$videoPath' style='display:block; width:400px; height:300px;' id='player'></a>”;
echo“<script language='javascript'>
flowplayer('player', ‘swf/flowplayer-3.1.5.swf’);
</script>”;
?>

video.php里面的上传文件夹

<?php
$hash = $_GET['h'];
$streamname = $_GET['v'];
$originaltimestamp = $_GET['t'];
header('Content-Description: File Transfer');
header('Content-type: video/mp4');
header(“Content-length: ” . filesize($streamname));
header(“Expires: 0”);
header(“Content-Transfer-Encoding: binary”);
$file = fopen($streamname, ‘r’);
echo streamgetcontents($file);
fclose($file);
?>

.htaccess里面上传文件夹

RewriteEngine on
RewriteRule ^(.)/(.)/(.*)$ 127.0.0.1/…/video.php?h=$1&t=$2&v=$3
RewriteRule ^$ – [F]
RewriteRule ^[^/]+\.(mov|mp4|flv)$ – [F]

我没有关于.htaccess的更多信息,只知道它用于限制对uploads文件夹的访问。 video.php由fileuload.php页面调用href tag。

我收到以下错误 200,未找到流,NetStream.Play.StreamNotFound,剪辑:&#39; [Clip]&#34;视频文件路径&#34;

0 个答案:

没有答案