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

How to setResizeMode to AspectRatioFrameLayout.RESIZE_MODE_FIT, When displayMode="landscape" #180

Open
arunmano86 opened this issue Feb 20, 2025 · 0 comments

Comments

@arunmano86
Copy link

Hi,
The Aspect Ratio set defaults to FILL When I play the video taken by a portrait in landscape screen mode. How do you set the default setResizeMode to RESIZE_MODE_FIT?
I checked your code in Android code, can you get this as an option from 'capVideoPlayerOptions'? it's beneficial for us

Thanks

android/src/main/java/com/jeep/plugin/capacitor/capacitorvideoplayer/FullscreenExoPlayerFragment.java

private void adjustAspectRatio() {
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
      styledPlayerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FILL);
    } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
      styledPlayerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIT);
    }
  }

Image
Image
Image

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

1 participant