Hls Video Streaming on iOS/Safari

Hls video streaming on iOS/Safari

To your question:

Is it some kind of a wishful thinking getting HLS & WebGL to play on iOS?

Yes, wishful thinking :-) The problem/issue/bug is with Apple, not any library. No matter what the JS library, A-Frame, Three, etc, this will always be an issue on any browser in iOS (all browsers on iOS are basically wrappers for Safari), and OSX Safari.

The issue is this (from my understanding):

  1. At some point in the history of WebGL, there were restrictions on cross-origin content (videos, images, etc). I can't find a source for this, but I remember reading it somewhere, so this might not be 100% accurate.
  2. Recently (a couple years ago? 2015?) all major browsers came to the conclusion that cross-origin media for use in WebGL was safe. Except Apple/Safari.
  3. For most browsers, the crossorigin attribute on a <video> element could signal that this content came from another source. In Safari, for whatever reason, this attribute is ignored or not implemented. In fact, it looks like WebKit, which Safari is based on, fixed this as far back as 2015, but Apple still does not implement it. Even Apple refuses to comment on any progress.

Possible workarounds:

  1. WebGL on Safari works with progressive (not a stream like HLS/Dash) .mp4 videos. Check out any 360 video on Facebook (website, not app) in iOS/Safari, and you'll note the source is an .mp4.
  2. Use HLS (or Dash), but play the video flat, without WebGL. Check out any 360 video on YouTube (website, not app), and I think they are using HLS or Dash, but the point is they stream the video, whereas Facebook doesn't.

Here's a good starting point to the real issue: link.

Here's another detailed thread: link.

Why is my HLS stream infinitely loading on iOS 15 safari but works fine on iOS 14?

In the end I couldn't solve the problem with nginx-rtmp module and I simply switched to Node-Media-Server https://github.com/illuspas/Node-Media-Server

With this, the streams work great on all iOS versions

Playback fails on iOS and Mac-Safari for HLS url that has colon

Turns out the issue was with the content of the m3u8.

#EXT-X-STREAM-INF:BANDWIDTH=1128000,CODECS="H264,AAC",RESOLUTION=1024x576

Apple devices didn't like the CODECS that were being specified. The provider removed the CODECS part and the playback started working.

HLS never plays on iPhone with Nginx fed by ffmpeg. Works on Desktop Safari and iPad

I solved this issue by moving away from Nginx entirely and using node-media-server instead



Related Topics



Leave a reply



Submit