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

[expo-av] Fix Video blank after unlocking screen #9586

Merged
merged 2 commits into from Aug 6, 2020

Conversation

IjzerenHein
Copy link
Contributor

Why

When unlocking the screen, the Video component sometimes displays nothing (blank) after unlocking the phone.
Fixes #2527

How

After investigation and debugging it was found that the Android TextureView contains a bug which causes the hardware layer to be destroyed, but not recreated. Only after certain events such as a Frame update on the surface, or detecting a visibility change, the layer would be recreated.

  • Add workaround to force update of hardware layer after it was destroyed due to backgrounding the app

Test Plan

Reproduction steps

  • Set unlock mode of Android phone to "none"
  • Open NCL and navigate to Video component
  • Press hardware lock button
  • Quickly press hardware lock button again to unlock

before

blank-error

  • after*

blank-fixed

@IjzerenHein IjzerenHein force-pushed the @hein/expo-av/android-fix-blank-on-resume branch from 8de6279 to 7deab42 Compare August 6, 2020 09:04
Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice way for solving this issue 😉
I like it 🥳 💪

@IjzerenHein IjzerenHein force-pushed the @hein/expo-av/android-fix-blank-on-resume branch from 7deab42 to 44b4109 Compare August 6, 2020 13:37
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2020

Native Component List for this branch is ready

@IjzerenHein IjzerenHein force-pushed the @hein/expo-av/android-fix-blank-on-resume branch from 44b4109 to 08100c6 Compare August 6, 2020 14:07
@IjzerenHein IjzerenHein merged commit ea9962f into master Aug 6, 2020
@IjzerenHein IjzerenHein deleted the @hein/expo-av/android-fix-blank-on-resume branch August 6, 2020 14:07
Jamedjo pushed a commit to Jamedjo/expo that referenced this pull request Feb 4, 2021
* [expo-av] Fix Video blank after unlocking screen

* [expo-av] Update changelog
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

Successfully merging this pull request may close these issues.

[Android] Video preview disappear after locking and unlocking phone
2 participants