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

Run onLayout when video dimensions change (Android) #242

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brian-pitsch
Copy link

For issue #241
Currently on Android the aspect ratio of the video will be off if they are not the Twilio default, and nothing changes the container view.
This addition will run onLayout when the dimensions change so the video will always have the correct aspect ratio.

Copy link
Collaborator

@slycoder slycoder left a comment

Choose a reason for hiding this comment

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

Cool, thanks again for investigating and putting this PR together. Sorry for taking so long to look at it!

@@ -44,6 +46,13 @@ public void onFrameDimensionsChanged(int vw, int vh, int rotation) {
videoWidth = vw;
RNVideoViewGroup.this.forceLayout();
}
new Handler(Looper.getMainLooper()).post(new Runnable(){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this just be runOnUiThread?

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.

2 participants