azure-sdk-for-android icon indicating copy to clipboard operation
azure-sdk-for-android copied to clipboard

[BUG] [AzureCommunicationCalling] Local video render seems stuck in portrait mode

Open tompi opened this issue 3 years ago • 7 comments

Describe the bug On some android devices, the camera does not respect the orientation of the app(when in landscape), and just shows a stretched portrait image. This is SEMI consistent, I have at least one test phone, huawei, where this USUALLY happens, but NOT always...

To Reproduce Steps to reproduce the behavior: start the app with the device oriented in landscape. Goto a page with a LocalVideoStream, and check the preview.

Code Snippet var camera = _deviceManager.Cameras.First(c => c.CameraFacing == _cameraFacing); _localVideoStream = new LocalVideoStream(camera, MainActivity.Instance); _localVideoRenderer = new VideoStreamRenderer(_localVideoStream, MainActivity.Instance); var renderingOptions = new CreateViewOptions(ScalingMode.Fit); var nativeView = _localVideoRenderer.CreateView(renderingOptions);

Expected behavior Camera renderer should show regular landscape preview.

Screenshots Working ok on an old samsung galaxy s7, android 8 IMG_1845

Not looking good on a samsung galaxy tablet s6, android 11. Image is stretched, so MIGHT be landscape just rotated? IMG_1846

Setup (please complete the following information):

  • OS: Android 8 and 11, probably a lot more, have seen it on a lot of phones
  • IDE : Rider
  • Version of the Library used: 2.3.0-beta.1

tompi avatar Jul 08 '22 08:07 tompi

Hi @tompi, thanks for reporting this, I will pass it along to the team.

//cc @jsaurezlee-msft @gaobob-msft

vcolin7 avatar Jul 12 '22 02:07 vcolin7

Hi @tompi thanks for the report. When you have this scenario and you are in a call with other participants, those participants see the video sideways and stretched also? I'm trying to see if this is something that happens only in the preview video of the phone, or if it's also affecting the way other participants see your video.

Also, did you started experiencing this on 2.3.0-beta.1 or it's happening on other versions of the SDK?

jsaurezlee-msft avatar Jul 19 '22 00:07 jsaurezlee-msft

@jsaurezlee-msft sorry about the late reply, this happens only in local preview. Just tested on galaxy s8, still happening.

Not sure if this applies to previous versions of sdk.

This is probably related to the way Im managing orientation, my start page is portrait only, when I go to the page with video, I flip orientation to landscape only, probably this that creates a problem on some phones/tablets. Do you need a minimal repro app maybe?

tompi avatar Sep 23 '22 07:09 tompi

@tompi can you please do a quick check and see if the following listener is being triggered when you from portrait only to landscape only? https://developer.android.com/reference/android/view/OrientationEventListener

gaobob-msft avatar Nov 10 '22 06:11 gaobob-msft

is there any update for this? I do have the same behaviour. When I have my phone on a table and check for the orientation (by context.resources.configuration.orientation) the phone will print portrait. But the view does look like it renders in landscape. After I move the orientation (I pick up the phone) the view is updated correctly for both landscape and portrait. So, the initial state is wrong.

By the way, it's just a preview issue. The other participant doesn't see the wrong state.

rbuiten avatar Jul 25 '23 07:07 rbuiten

@rbuiten what version of the SDK are you using? CC: @yassirbisteni

gaobob-msft avatar Jul 25 '23 07:07 gaobob-msft

currently we are on 2.2.2, but we will go to the latest stable within a few weeks.

rbuiten avatar Jul 25 '23 14:07 rbuiten

Hi @tompi, we deeply appreciate your input into this project. Regrettably, this issue has remained unresolved for over 2 years and inactive for 30 days, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

github-actions[bot] avatar Jul 08 '24 18:07 github-actions[bot]