我试图用PHP读取mp4文件,我的初始代码是
$file = 'https://s3-sa-east-1.amazonaws.com/onlytestes/video.mp4';
header('Content-type: video/mp4');
readfile($file);
但是这样我就无法使用视频的长度条,跳过甚至返回,直到视频100%加载。 当然,当我直接阅读文件时(video.mp4),一切都很好。
答案 0 :(得分:-1)
获取Amazon请求(curl)的标头并转发它。擦洗将永远不会起作用。
更新:
curl -I https://s3-sa-east-1.amazonaws.com/onlytestes/video.mp4
>>
HTTP/1.1 200 OK
x-amz-id-2: Ykt6rmYagUDTbKW+v2DR63Zb4ZmUJCM8ty7hO+Z/BU9DV5w1PTVEk+khHgMp+eoR7ExxzKy1Ius=
x-amz-request-id: 8F7A552FAB8D8B08
Date: Thu, 13 Jul 2017 08:12:26 GMT
Last-Modified: Wed, 12 Jul 2017 09:46:10 GMT
ETag: "adcafc77564f72b5e21574f4bfc4e927"
Accept-Ranges: bytes
Content-Type: video/mp4
Content-Length: **1386059** < to forward.
Server: AmazonS3