<video> plays in other browsers, but not Safari

后端 未结 11 1381
清酒与你
清酒与你 2020-12-06 04:30

We have an MP4 video on our site; it plays fine in IE9+, Firefox, Chrome, and Chrome on mac. However, on Safari, the video doesn\'t play at all - it does trigger a \"stalled

相关标签:
11条回答
  • 2020-12-06 04:54

    This could indeed be an issue of missing byte-range support, depending on the version you are using. It was added to the DMSDownloadServlet in MAGNOLIA-3855 (Magnolia fix version 4.4.6).

    0 讨论(0)
  • 2020-12-06 04:54

    ...

    On a side note, does charset make any sense on the video/mp4 type at all? Try removing the charset on it.

    EDIT: Yes, charset might be the problem, see: Specify content-type for documents uploaded in Magnolia

    EDIT2: Not charset, woops, reading comprehension fail. Might be byte range? To quote: "[...] we found out that Safari/iOS "uses HTTP byte-ranges for requesting audio and video files." Now we guess that the Magnolia DMS file serving doesn't support this feature, and hence the streaming fails."

    0 讨论(0)
  • 2020-12-06 04:56

    Please, forgive me if you already solve this issue! I've had the same problem with my server videos in Safari. I was abled to solve this using POSTMAN/INSOMNIA for check the headers that my server is sending. Chrome may can trick your, once that in this browser the video works fine!

    If the video is not ranged(full video request) your server must return status(200) and check it out if the 'Accept-Ranges:bytes' is sent from your server. Header sample status 200:

    Server: nginx
    Date: Wed, 25 Jul 2018 17:34:18 GMT
    Content-Type: video/mp4
    Content-Length: 22995782
    Connection: keep-alive
    X-Powered-By: Express
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE
    Access-Control-Allow-Headers: X-Requested-With,content-type
    Access-Control-Allow-Credentials: true
    Accept-Ranges: bytes
    

    if the video is ranged your server must return status(206) with range headers correctly. Header sample status 206:

    Server: nginx
    Date: Wed, 25 Jul 2018 18:13:07 GMT
    Content-Type: video/mp4
    Content-Length: 1023
    Connection: keep-alive
    X-Powered-By: Express
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, DELETE
    Access-Control-Allow-Headers: X-Requested-With,content-type
    Access-Control-Allow-Credentials: true
    Accept-Ranges: bytes
    Content-Range: bytes 1-1023/22995782
    

    I hope this help you! my best regards, Paulo Durço

    0 讨论(0)
  • 2020-12-06 04:58

    Just ran into the same issue. All headers, range, etc. were correct. However, I had a poorly constructed service worker. All other browsers handled the failure, Safari did not. Temporarily removed the service worker, and things are back to normal.

    0 讨论(0)
  • 2020-12-06 05:00

    I uploaded a new MP4 file, but it played in SAFARI only (on both my MAC and my iPhone), not Chrome, Oasis, Firefox, or Brave. HTML code was identical to previous successes. File size and Dimensions were fine. But the Codecs on the old, working files were "H.264, AAC". The Codecs on the new, not working files were "MPEG-4, AAC". I edit my video files on VideoPad. So I looked at the specification selections on the "Export file as" options, and, sure enough, the Codecs was defaulted to MPEG-4. I selected H.264 and exported the file. Uploaded to AWS and made public. Retried my new files in the four failure browsers and BINGO!, they all worked. There is a God!

    0 讨论(0)
提交回复
热议问题