Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HLS streaming doesn't work on Safari / iOS #713

Closed
supermafete opened this issue Apr 9, 2018 · 13 comments
Closed

HLS streaming doesn't work on Safari / iOS #713

supermafete opened this issue Apr 9, 2018 · 13 comments

Comments

@supermafete
Copy link

supermafete commented Apr 9, 2018

Hi there,

I'm developing a live streaming PWA using angular and videogular2. Everything works fine, desktop web browsers, android browsers, etc... except in iOS 11. The console shows this error.

imagen

We see a 404 (not found) error loading hls.min.js.map. I think this is because hls.js is a Media Source Extension, and that MSE's are not supported by iOS. BTW, it doesn't work on chrome nor firefox neither, although the important browser for PWAs is Safari.

So, how can I implement HLS with videogular2 in iOS devices without doing browser version checks?

Thanks.

@Elecash
Copy link
Member

Elecash commented Apr 9, 2018

HLS is supported natively in iOS and Safari, you should not need HLS plugin at all I think.

BTW, Chrome and Firefox (and other browsers) in iOS are using the Safari Webkit, so if you solve your problem in one browser, it would be fixed in all of them.

@supermafete
Copy link
Author

supermafete commented Apr 9, 2018

Sure, the thing is I want my code agnostic from the browser. If videogular2 hls does not work in iOS, then I must check it at every load and use videogular2 for some users and native for others. Maybe videogular2 can do this check natively and be completely agnostic.

For example, I have my stream navigation implemented in videogular2. This thing forces me to do another stream navigation system for iOS, so I can't use videogular2 in all systems.

@Elecash
Copy link
Member

Elecash commented Apr 9, 2018

Makes sense! I thought HLS did that for me.

Ok, I'll take a look to it and try to work on a fix.

@supermafete
Copy link
Author

Gracias Raúl! ;)

I'll keeping an eye to this thread.

@Elecash
Copy link
Member

Elecash commented Apr 22, 2018

I've tested with my iPad on iOS 10 and it works as expected on the demo website:
https://videogular.github.io/videogular2-showroom/#/streaming-player

I can change between VOD and HLS without any problem. Maybe is a problem with your HLS source file, can you try this one?

https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_varian.m3u8

@wdspider
Copy link

@Elecash while I can confirm that the HLS stream on the linked showroom page plays on iPhone 7 (iOS 11.3), I'm having trouble finding the source of the showroom to confirm whether that showroom page is also using VgControls.

My experience has been that videogular2 will successfully play HLS videos on iOS so long as you use the default controls. It is the VgPlayPause control that does not work on iOS, likely due to it attempting to always use MSE rather than falling back to native.

@Elecash
Copy link
Member

Elecash commented Apr 22, 2018

@wdspider I can confirm that it also works with Videogular controls in iOS with HLS and VOD.

e895e284-21a7-4ddb-836b-4e74ad9414a1

@wdspider
Copy link

wdspider commented Apr 23, 2018

Yep, something somewhere has changed since I had to code into my project the work-around of showing the default controls (instead of the custom ones) when on Safari. Both the default and the custom controls do seem to work now.

@Sampath-Lokuge
Copy link

I have the same issue. Do you have any solution here? @supermafete

@supermafete
Copy link
Author

supermafete commented Jan 26, 2019 via email

@Sampath-Lokuge
Copy link

Sampath-Lokuge commented Jan 26, 2019

@supermafete Thanks.
I'm working on Ionic 3 mobile app. Now it is working perfectly fine on iOS devices. iPhoneX 12.1 and etc.

I use these versions:

"videogular2": "6.1.1",
"@types/core-js": "2.5.0",
"hls.js": "0.12.2",

.html

<vg-player>
<video #media [vgMedia]="media" [vgHls]="videogularSrc" preload="metadata" id="my-video" muted playsinline autoplay controls crossorigin>
</video>
</vg-player>

@supermafete
Copy link
Author

@Sampath-Lokuge are you getting troubles when trying to play streams with restricted CORS?

@Sampath-Lokuge
Copy link

@supermafete No. I have used crossorigin attribute. We get the stream using Wowza service.

Wowza: https://www.wowza.com/products/streaming-cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants