0
我有以下的PHP腳本PHP返回一個MP4視頻文件
$file_name = 'Videos/'.$_GET['fileName'].'.mp4';
$file_size = (string)(filesize($file_name));
header('Content-Type: video/mp4');
header('Accept-Ranges: bytes');
header('Content-Length: '.$file_size);
header("Content-Disposition: inline;");
header("Content-Range: bytes .$file_size");
header("Content-Transfer-Encoding: binary\n");
header('Connection: close');
readfile($file_name);
有趣的是它僅適用以及服務一些視頻文件,但沒有記錄的人用不同的比特率。此外,如果視頻文件直接訪問,然後Chrome瀏覽器顯示視頻沒有問題。 我錯過了一些標題?
這裏有什麼問題? – Eric
爲什麼不與所有視頻一起工作,爲什麼只適用於某些視頻。 –
由於某些比特率可能與瀏覽器中支持的mp4比特率不兼容。查看https://app.zencoder.com/docs/guides/encoding-settings/html5 – Eric