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

bug: Camera freeze in iOS safari browser (PWA) #3656

Closed
dodomui opened this issue Oct 8, 2020 · 15 comments
Closed

bug: Camera freeze in iOS safari browser (PWA) #3656

dodomui opened this issue Oct 8, 2020 · 15 comments

Comments

@dodomui
Copy link

dodomui commented Oct 8, 2020

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 2.4.2
  @capacitor/core: 2.4.2
  @capacitor/android: 2.4.2
  @capacitor/electron: 2.4.2
  @capacitor/ios: 2.4.2

Installed Dependencies:

  @capacitor/ios 2.4.2
  @capacitor/core 2.4.2
  @capacitor/android 2.4.2
  @capacitor/cli 2.4.2
  @capacitor/electron not installed

[success] Android looking great! 👌
  Found 11 Capacitor plugins for ios:
    @capacitor-community/apple-sign-in (0.0.12)
    @capacitor-community/facebook-login (1.0.2)
    @capacitor-community/firebase-crashlytics (0.3.0)
    @capacitor-community/firebase-remote-config (0.1.3)
    @capacitor-community/http (0.2.1)
    @capacitor-community/twitter (1.0.1)
    @codetrix-studio/capacitor-google-auth (2.1.1)
    capacitor-apple-login (0.0.7)
    capacitor-firebase-auth (2.3.2)
    cordova-plugin-compat (1.2.0)
    cordova-plugin-qrscanner (3.0.1)
[success] iOS looking great! 👌

Platform(s)

iOS Safari (PWA)

Current Behavior

Camera freeze after camera launch for 1-2 seconds.
Need press on the safari video recording button twice (disable and enable back the video recording) to make it working properly.

Expected Behavior

It should be work as normal.

Code Reproduction

Other Technical Details

npm --version output:
6.14.8
node --version output:
v12.16.1
pod --version output (iOS issues only):

Additional Context

@zsyphon
Copy link

zsyphon commented Oct 9, 2020

@dodomui have you made any progress on this issue? I am having the same problem

@dodomui
Copy link
Author

dodomui commented Oct 11, 2020

Nope, it still not working.

@zsyphon
Copy link

zsyphon commented Oct 12, 2020

@dodomui Unfortunately, I have not made any progress either.

@andrewrains
Copy link

@dodomui Unfortunately, I have not made any progress either.

Me neither.

@AlexKvazos
Copy link

AlexKvazos commented Oct 31, 2020

Screen Shot 2020-10-31 at 11 36 34
I connected my iPhone to Safari inspector to see if an error was throwing to the console and nothing shows up when the stream freezes.

@zsyphon
Copy link

zsyphon commented Oct 31, 2020 via email

@dacrypt
Copy link

dacrypt commented Nov 5, 2020

I can confirm this bug is happening to me too

@raevenbauto
Copy link

Confirming that this bug is happening to me as well.

@cyril-petit
Copy link

cyril-petit commented Nov 16, 2020

Same here, somebody has any idea ? It's a pretty bad bug
here are some details :
npm: '6.14.5',
"@capacitor/core": "^2.4.2",
using :
const image = await Camera.getPhoto({
quality: 100,
allowEditing: false,
resultType: CameraResultType.Base64,
encodingType: 1,
mediaType: 0
})

@zsyphon
Copy link

zsyphon commented Nov 16, 2020

@jcesarmobile have you had a moment to look at this issue? Thank you for any guidance you can provide!!

@dotNetkow
Copy link
Contributor

dotNetkow commented Dec 4, 2020

Note that this is likely an issue with PWA Elements, which Capacitor Camera plugin uses when running on the web. Please don't open other issues, there's already several.

Can confirm running Ionifits app in Safari browser or as installed PWA.

Specs:

To repro, open https://ionifits.ionicframework.com on an iOS device. On login screen, take SKIP button, tap Expenses tab, tap FAB button at bottom to open modal, then tap the Camera FAB to open the device camera. The front facing camera loads and the image freezes right away. after about 2 seconds, the camera window turns to black.

Running on the web (desktop), get this error in console: Uncaught (in promise) TypeError: Cannot read property 'length' of undefined at o.initPhotoCapabilities

separate note @cyril-petit - we highly recommend using CameraResultType.Uri (File URI) instead of base64 to capture images for the best performance. iOS devices these days take incredibly high quality photos, so loading that much base64 data into memory can be too much, even causing the app to crash. See Ionifits or the official First App tutorial for ways to use File URI.

@imhoffd imhoffd added this to Backlog 🤖 in Capacitor Engineering ⚡️ via automation Dec 4, 2020
@imhoffd imhoffd moved this from Backlog 🤖 to In progress 🤺 in Capacitor Engineering ⚡️ Dec 4, 2020
@theproducer
Copy link
Contributor

I was able to repro this in 14.2, and after some investigation, the camera freezes seem to be a bug in iOS Safari. Others are reporting similar issues:
twilio/twilio-video.js#1281
https://developer.apple.com/forums/thread/667453

14.3 RC was released today and after some tests the problem seems to be resolved. Rumor is 14.3 will go live next week.

Running on the web (desktop), get this error in console: Uncaught (in promise) TypeError: Cannot read property 'length' of undefined at o.initPhotoCapabilities

That's a separate issue we are tracking here:
ionic-team/pwa-elements#66

@imhoffd
Copy link
Contributor

imhoffd commented Jan 13, 2021

Anyone able to verify this is fixed with iOS 14.3?

@AlexKvazos
Copy link

AlexKvazos commented Jan 13, 2021 via email

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

No branches or pull requests