Video tag on Apple does not correctly read background output stream

Source: Internet
Author: User
Tags readfile
wrote a small website, video playback with video tags, you need to separate the videos (both MP4) and Web files, so the video stream through the background to read the video streaming, on the PC side and Android normal access, but not on the Apple display, but the Apple can play fixed-address video, such as/ Test.mp4, the background code is as follows:

    //$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 );  

The web says that there is no range set in the HTTP protocol, but none of them give an example or a detailed explanation.

Reply content:

wrote a small website, video playback with video tags, you need to separate the videos (both MP4) and Web files, so the video stream through the background to read the video streaming, on the PC side and Android normal access, but not on the Apple display, but the Apple can play fixed-address video, such as/ Test.mp4, the background code is as follows:

    //$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 );  

The web says that there is no range set in the HTTP protocol, but none of them give an example or a detailed explanation.

You can try to change the location of the video file, which may be a problem with the path.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.