我有这个文件PHP:
$url = 'http://page.com/file.flv';
header('Content-Type: application/x-flv');
header ("Content-Length: " . filesize($url));
header('Accept-Ranges: bytes');
header('Content-Transfer-Encoding: binary');
header ("Content-Disposition: attachment; filename=file.flv");
$fd = fopen($url, "r");
while(!feof($fd))
{
echo fread($fd, 4096);
ob_flush();
}
然后我尝试在我的网页上开始观看此视频:
<video width="320" height="240" controls>
<source src="file.php" type="video/x-flv">
Your browser does not support the video tag.
</video>
但我总是得到错误&#39;无法打开文件&#39;。当我试图在url字符串(而不是.php)的末尾添加包含.flv的url时 - 一切正常。
哪里有问题?