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

Switching between front and rear cameras causes Chrome to freeze on Android 11 #77

Closed
jaymemi opened this issue Mar 17, 2021 · 2 comments

Comments

@jaymemi
Copy link
Contributor

jaymemi commented Mar 17, 2021

npm list @stencil/core
-- @stencil/[email protected]

I'm submitting a ...
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:
While using Android 11's Chrome browser, any attempt to switch between front and rear cameras causes the entire browser to freeze.

Expected behavior:
The user should be able to switch between cameras without causing the browser to freeze.

Steps to reproduce:

  1. Open the pwa-camera overlay, the camera initializes and starts streaming as expected.
  2. Attempt to switch to rear camera, the browser becomes unresponsive without any errors showing on the console.

Tested in a fresh project, against both Capacitor v2 and v3, and using the latest pwa-elements version:
@capacitor/core": "^2.4.7"
@ionic/pwa-elements": "^3.0.2"

The issue can be reproduced on:

  • Samsung Galaxy s10 Android 11, Chrome 89.0.4389.90
  • Samsung Galaxy S21 Android 11, Chrome Beta 90.0.4430.19
  • Xiaomi Mi 10T, Android 11 (MIUI 12.1.2)
  • OnePlus Nord, Android 11

Workign as expected on:

  • Samsung Galaxy s10 Android 11 on Chrome Beta 90.0.4430.19

Related code:
rotate() attempts to stop previous streams and it seems to be the causing the issue:

stopStream() {
this.stream && this.stream.getTracks().forEach(track => track.stop());
}

Other information:
Twilio's issue tracker shows the same issue and some possible solutions:
twilio/twilio-video-app-react#355

I intend to submit a pull request with one of the possible workarounds.

@jaymemi
Copy link
Contributor Author

jaymemi commented Mar 19, 2021

PR #78 fixes this issue, please consider it.

@jcesarmobile
Copy link
Member

closing as #78 was merged

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

2 participants