video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.73k stars 2.56k forks source link

Hls.js on iOS > 17.1 (Simulator) #6161

Open lucabergamini opened 8 months ago

lucabergamini commented 8 months ago

What do you want to do with Hls.js?

This might be a quite naive question, but now that ManagedMediaSource is available on iOS >= 17.1 and hls.js supports it, should safari be able to use hls.js for videos?

My understanding was that the absence of MSE was the main blocker for hls.js, but I'm testing with a 17.2 simulator in xcode and I'm still receiving false from Hls.isSupported

What have you tried so far?

I'm running with the latest hls.js on iOS 17.2 safari:

by reading the latter function comments, this might be because isTypeSupported returns false

robwalch commented 8 months ago

Hi @lucabergamini,

Have you tried a real device?

The demo page with v1.5.3 is passing support checks and playing video with an iPhone 15 Pro (and other physical iPhone devices) on latest iOS.

This issue sounds specific to Simulator. Let me know if you find any configurations that do pass the ManagedMediaSource.isTypeSupported check on the simulator.

lucabergamini commented 8 months ago

I've not tried but I can do that tomorrow and report back. I will try the demo page too just to rule out any issue in our application.

I would not be surprised if Apple had missed something in the simulator honestly.

Part of the confusion was because the readme page of hls.js still reads

Please note: iOS Safari on iPhone does not support the MediaSource API. This includes all browsers on iOS as well as apps using UIWebView and WKWebView.

Safari browsers (iOS, iPadOS, and macOS) have built-in HLS support through the plain video "tag" source URL. See the example below (Using HLS.js) to run appropriate feature detection and choose between using HLS.js or natively built-in HLS support.

which is still true, but maybe could be amended to mention that now hls.js can use ManagedMediaSource

robwalch commented 8 months ago

I will try the demo page too just to rule out any issue in our application.

I tried, and got the "not supported" error. I don't consider this an issue with HLS.js, but an issue with the Simulator that you must report to Apple.

but maybe could be amended to mention that now hls.js can use ManagedMediaSource

Please consider contributing this change if you think it would help you and other users. I'd gladly accept a PR that updates the docs.

lucabergamini commented 8 months ago

I tried, and got the "not supported" error. I don't consider this an issue with HLS.js, but an issue with the Simulator that you must report to Apple.

Oh sorry I didn't realised you tried that already. Cool, I'll just check with a real device tomorrow then.

Please consider contributing this change if you think it would help you and other users. I'd gladly accept a PR that updates the docs.

Will do!

lucabergamini commented 8 months ago

@robwalch I just tested the demo page on an iOS device with 17.2.1 and it works there, so I expect our app to work too. I'll report the bug to apple

niklaskorz commented 5 months ago

@lucabergamini Did you end up reporting the simulator issue to Apple, and did you get any response already?

lucabergamini commented 5 months ago

Hi @niklaskorz I did report that. I got a response where they asked me to upload some data, which I did. After that they stopped replying to my following requests for updates