HTML video not playing in Safari browser

后端 未结 5 487
情话喂你
情话喂你 2021-01-20 13:07

Below code is working fine in Mozilla & Chrome. But in Safari the video doesn\'t play.

5条回答
  •  情深已故
    2021-01-20 13:34

    In my case i'm using angular with service-worker and Safari is not loading mp4 files.

    The service worker breaks the Byte-range requests, because it is like man in the middle between safari and the server, in the process the SW change the http response code from 206 to 200, this way Safari do not download the mp4.

    To solve this I bypass the service worker when I need to show an mp4 video, using angular 8 is its simple, just add ngsw-bypass=true as a query string in the mp4 url and in works. ( https://....video.mp4?ngsw-bypass=true )

提交回复
热议问题