用于流式传输wmv视频文件的PHP标头

时间:2013-12-14 21:32:01

标签: php header video-streaming wmv

当我直接指向它在浏览器中播放的文件时,但是如果我尝试通过PHP播放它则不起作用。我的代码是:

<?php
$file = 'videos/video.wmv';
$file_name = 'video.wmv';
$file_type = 'video/x-ms-wmv';

header('Content-Description: File Transfer');
header('Content-Disposition: filename="'.$file_name.'"');
header('Content-Type: '.$file_type);
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
header('Cache-Control: post-check=0, pre-check=0');
header('Pragma: public');
header("Accept-Ranges: bytes");
header('Expires: 0');
readfile($file);
?>

它适用于PDF,rar和zip文件,但不适用于流媒体视频。出现WMP窗口但视频不播放。

感谢您的帮助。

0 个答案:

没有答案
相关问题