Parsing HLS manifest of live stream in Safari to retrieve time-based metadata

1.1k views Asked by At

I am using native Safari player implementation to stream video with HLS streaming protocol.

My goal is to get time-based metadata (such as EXT-X-DATERANGE) from a live stream manifest.

As far as I know, it is not possible to retrieve this data because the streaming logic is fully controlled by the Safari player which does not expose this data.

For now, I came to the 2 possible solutions:

  1. Manually download the manifests and parse out the EXT-X-DATERANGE tag. But with this approach, the download timer should be manually managed too. And, of course, the number of requests for the playlists will be increased.
  2. Desktop Safari browser supports MSE. This means it is possible to have full control over manifest retrieving and parsing. There are awesome libraries that already provide this functionality, such as shaka-player or hls.js. It is possible to implement custom response filter for segments(shaka-player) or listen to Hls.Events.FRAG_CHANGED event (hls.js) in order to have access to the playlist. The problem is that Safari in IOS mobile still does not support the MSE. So it is not possible to apply this solution for mobiles.

Are there any other ways to retrieve time-based metadata (such as EXT-X-DATERANGE) using native Safari player implementation?

Thanks a lot in advance!

0

There are 0 answers