dounie5475 2014-09-29 01:08
浏览 92

使用FlowPlayer的安全HTTP流媒体插件始终显示“未找到流”

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)

Test URL

What is my problem? Thanks in advance.

Ps. Sorry for my bad english.

  • 写回答

1条回答 默认 最新

  • dongshukou0240 2015-03-20 16:51
    关注
       RewriteRule ^(.*)/(.*)/(.*)$ /FULLPATH/video.php?h=$1&t=$2&v=$3
    
    评论

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用