Search code examples
safarihttp-live-streaminghls.js

hls playlist works everywhere except Safari


This is playlist I'm using:

https://stream.rusticdisco.com/5c92eab9c8bef43d77f2b5a0/vod_master.m3u8

It plays back in all kinds of players (jwplayer, videojs, etc) but when playing back in Safari it breaks right away. Here's an example of the same playlist working in videojs on CodeSandbox: https://codesandbox.io/s/o5p5920j06

Steps to reproduce:

  • copy/paste into the URL bar in Safari
  • see the playback fails right away

Other playlists (like this one for example: https://content.jwplatform.com/manifests/yp34SRmf.m3u8) work directly in the URL bar in Safari but this one fails.


Solution

  • Your variant playlists are invalid:

    • the EXT-X-TARGETDURATION must be a decimal-integer and you have a floating point value.
    • for EXTINF the correct format is EXTINF:<duration>,[<title>]. The title is optional but you're missing the comma.

    See RFC 8216 and the examples provided by Apple.