aws-samples / amazon-ivs-broadcast-android-sample

MIT No Attribution
9 stars 8 forks source link

How to support landscape mode #35

Closed KunNiu closed 1 year ago

KunNiu commented 1 year ago

When switch to landscape, the video looks like the screenshot attached, how to make it fill screen? I already set the aspect to fill. Screenshot_20230508-120723

KunNiu commented 1 year ago

I made such changes in demo, and got simular behavior

图片 图片 图片
bclymer commented 1 year ago

In the screenshot of the config your last message, it looks like the aspect ratio is being set to FIT and not FILL. Can you confirm the issue still happens when setting toFILL`?

KunNiu commented 1 year ago

Hi @bclymer, thanks for your reply. The issue still exist after change to FILL

图片
KunNiu commented 1 year ago

Hi @bclymer , do we have any updates here?

bclymer commented 1 year ago

@KunNiu Sorry for the delay, when you create the preview view, what aspect ratio are you creating it with? You can call

session.getPreviewView()

but you can also call

session.getPreviewView(BroadcastConfiguration.AspectMode.FILL)

Which will cause the preview to fill the contents of its bounds. It's important to note that using a preview as FILL might cause the broadcast to look different than what you see because content will be cropped differently if you view's aspect ratio is different than the broadcast aspect ratio. Using FIT for the preview allows you to always see the full content on the broadcasted stream.

KunNiu commented 1 year ago

@bclymer thanks. I can solve the issue with your solution, close this issue.