Written a small website, using the video tag for video playback, it is necessary to separate the video files (both MP4) and website files, so the video stream is output by reading the video in the background, and can be accessed normally on PC and Android, but It cannot be displayed on Apple, but videos with fixed addresses can be played on Apple, such as /test.mp4. The background code is as follows:
<code> //$name 文件名, $path 文件路径 header("Pragma: public"); header("Expires: 0"); header("Content-Type: application/octet-stream"); //文件mime类型 header("Content-Disposition: attachment; filename=\"".$name."\";" ); header("Content-Length: ".filesize($path)); //文件大小$fsize ob_clean(); flush(); readfile( $path ); </code>
It is said online that Range is not set in the http protocol, but no examples or detailed explanations are given.
Written a small website, using the video tag for video playback, it is necessary to separate the video files (both MP4) and website files, so the video stream is output by reading the video in the background, and can be accessed normally on PC and Android, but It cannot be displayed on Apple, but videos with fixed addresses can be played on Apple, such as /test.mp4. The background code is as follows:
<code> //$name 文件名, $path 文件路径 header("Pragma: public"); header("Expires: 0"); header("Content-Type: application/octet-stream"); //文件mime类型 header("Content-Disposition: attachment; filename=\"".$name."\";" ); header("Content-Length: ".filesize($path)); //文件大小$fsize ob_clean(); flush(); readfile( $path ); </code>
It is said online that Range is not set in the http protocol, but no examples or detailed explanations are given.
You can try changing the location of the video file. This may be a path problem.