webrtc / samples

WebRTC Web demos and samples
https://webrtc.github.io/samples
BSD 3-Clause "New" or "Revised" License
13.94k stars 5.71k forks source link

iOS 11: Webrtc video stream does not working in PWA (Progressive Web App) #933

Closed ruslan-mystore closed 6 years ago

ruslan-mystore commented 7 years ago

Webrtc video stream does not working in PWA (Progressive Web App) as standalone APP on iOS. Tested devices: iphone7, iphone 6, ipad pro 2017

When you accessing to the Web Page via Safari 11 it's working fine, but not as pwa standalone app

KaptenJansson commented 7 years ago

Not sure how PWA works on iOS. Is it safari that packages it?

Lucassifoni commented 6 years ago

Hey,

When you have a apple-mobile-web-app-capable meta tag, both getUserMedia and photo upload with an <input type="file"> tag stop working. iOS 11 supposedly brought WebRTC, but broke the main previous way to upload pictures (the input tag) and didn't bring getUserMedia in a PWA context.

For now, the only "solution" is to remove the meta tag and access the page from Safari, not the homescreen.

Edit : see https://stackoverflow.com/questions/46228218/how-to-access-camera-on-ios11-home-screen-web-app/46350136

šŸ˜•

To be honest, I'm quite angry. They even broke file inputs in PWAs. No communication whatsoever, only spare threads showing this problem on stackoverflow/github.

Pablo-Aldana commented 6 years ago

Any chance to have this issue / feature solve/done? In my company we are doing a PWA face recognition and unfortunately we cannot use it as PWA in iOS because of this issue.

Lucassifoni commented 6 years ago

Sadly, for internal apps, we're looking to buy Android devices as a workaround. The lack of communication is deceiving.

KaptenJansson commented 6 years ago

Please file a bug to the people packaging PWA apps, we do not in this repo have anything to do with that.

ruslan-mystore commented 6 years ago

@Lucassifoni According to your link in stackoverflow , seems like this feature should work on iOS 11.3. I updated my devices to iOS 11.3 and webrtc camera not working . May be i miss something ?

Lucassifoni commented 6 years ago

@ruslan-mystore well it's fixed, ensure you give video tags a playsinline attribute, and that you run your code on either localhost or a secured domain :) . You can test webrtc features here : https://test.webrtc.org/ Edit : oh, well, i'm unsure for the PWA context part. StackOverflow indicates getUserMedia is still undefined in this context, but file input media capture has been restored. I won't be able to test this since I downgraded all my PWAs to standard pages while I'm waiting for Apple.

PrItHvI7 commented 6 years ago

Does Progressive Web Apps on iOS support ā€œgetUserMedia/Stream APIā€ ? i am developing an application using Quagga barcode scanner, where it works fine on ios safari browser but while accessing through its webApp, it crashes with error below. [Error] ERRORā€Šā€”ā€ŠError: Uncaught (in promise): TypeError: undefined is not an object (evaluating ā€˜k.inputStream.typeā€™)

Lucassifoni commented 6 years ago

@PrltHvl7 you won't be able to access the Media API through an "installed" PWA on iOS at the time sadly. Use a standard <input type="file"> with instructions as a fallback, or force users to access the webpage in safari.

odahcam commented 6 years ago

That's annoying. Is there any decent reason why @apple is doing this shit?

derappelt commented 5 years ago

That's annoying. Is there any decent reason why @apple is doing this shit?

Because they don't want web apps to replace app store apps. If a web app is capable of everything an installed app is, no one will ever use the app store again. It's embarrassing and childish but that's @apple .

odahcam commented 5 years ago

That's sad, they say that webkit has a security bug with the cameras. If they could get this to work, I wouldn't mind if they monetize the PWAs or make the developers pay to offer it. It's just too odd that Apple (the giant Apple) can't solve that.

Lucassifoni commented 5 years ago

Well, I see with your notifications my first comment in this thread will be two years old next week. The project I needed this for has been canceled, others have been started and finished, some are ongoing, and we haven't released a PWA since because of our Apple-centric userbase... That's for sure one way of handling standards.

Ferigit commented 4 years ago

for react pwa, it works on browser mode on ios , but it does not work on home screen mode. Does any body could solve this propbelm?

mordka commented 4 years ago

Obviously Apple is not going to change, so we implemented a popup to notify users that safari is not a recommended browser informing about better browsers following web standards. This reminds me famous popup on Youtube about Internet Explorer, soon after that many big websites repeated this and soon Internet Explorer died. I hope the same will happen with Safari (and iOS).

odahcam commented 4 years ago

The problem is not Safari, but @apple's WebKit that does not make it possible to expose WebRTC device access in standalone apps. There's a security bug that blocks that and the WebKit team seems to be facing some trouble to fix it. That's why there's no WebRTC in iOS running PWAs.

a-m-dev commented 4 years ago

its so damn confusing, yesterday i tested camera on my iphone 8 in a pwa app -> does NOT worked, today i checked it , it works....

odahcam commented 4 years ago

@a-m-dev you sure?

jogibear9988 commented 4 years ago

@a-m-dev youre sure you installed the pwa to homescreen?

lacchain-stamping commented 4 years ago

You are using webRTC or the <input type = "file" ...>?

jogibear9988 commented 4 years ago

for me itā€˜s not workin...

jogibear9988 commented 4 years ago

issue i created at safari is still open after 3 years

AnotherStar commented 3 years ago

@apple, come on!

gmpassos commented 1 year ago

@apple, come on!

ScottAgirs commented 1 year ago

@apple, come on!

@apple, come on! +1