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

MIT No Attribution
10 stars 8 forks source link

How to make the preview screen full screen #22

Closed xlg closed 2 years ago

xlg commented 2 years ago

Hi,I have mobile phones with multiple resolutions. On 1080x1920, there will be black borders on the left and right when previewing, and on 1080x2340, there will be black borders on the top and bottom when previewing. I tried tweaking the parameters of BroadcastConfiguration Vec2, but it only seems to have an effect on the launched stream. TextureView has been set to full screen, I guess it is the surface output by the camera, which is not scaled and cropped proportionally. If there is a way to set the preview to be full screen please let me know, thanks.

caleighm commented 2 years ago

Hi @xlg, please try getting the preview with the FILL AspectMode:

imageDevice.getPreviewView(BroadcastConfiguration.AspectMode.FILL);

(ref)

You can read more about AspectMode here.

Hope this helps! Please let us know if you have other questions.

xlg commented 2 years ago

Thanks a lot @caleighm ,it worked for me. Indeed, I also encountered a problem, I raised another issue