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 resizeMode not updated on Android #9567

Merged
merged 5 commits into from
Aug 6, 2020

Conversation

IjzerenHein
Copy link
Contributor

@IjzerenHein IjzerenHein commented Aug 5, 2020

Why

Changing the Video resizeMode does not always update the visible content.

In the video you can see how changing the resizeMode quickly causes the video to sometimes display the content with the previously selected resizeMode. This happens in the recording when the "contain" and "cover" modes are chosen.

resizemode3

image

image

How

After investigating it was found that changing the transform on the TextureView does not automatically redraw the view. Instead, the view was redrawn only when the PlayerData sent new data to the underlying surface. When for instance a video was paused or stopped, it would not update the TextureView.

  • Added invalidation call whenever the transform-matrix on the TextureView changed
  • Optimize resize-mode update

Test Plan

  • Verified using NCL on Samsung S20
  • All tests succeed

@IjzerenHein IjzerenHein changed the title [expo-av] Fix resizeMode not updated on Android [expo-av] Fix Video resizeMode not updated on Android Aug 5, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Aug 5, 2020

Native Component List for this branch is ready

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.

Mind adding some CHANGELOG entry for that? 😉

@IjzerenHein IjzerenHein force-pushed the @hein/expo-av/android-resizemode-fix branch from a3bf75c to aac7af9 Compare August 6, 2020 08:41
@IjzerenHein IjzerenHein merged commit 073bda2 into master Aug 6, 2020
@IjzerenHein IjzerenHein deleted the @hein/expo-av/android-resizemode-fix branch August 6, 2020 08:59
Jamedjo pushed a commit to Jamedjo/expo that referenced this pull request Feb 4, 2021
* [expo-av] Fix resizeMode changes not visible

* [expo-av] Update to prev commit, only invalidate when needed

* [expo-av] Only update resizeMode when needed

* [expo-av] Update changelog

* [expo-av] Update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants