The main video is rotated 90 degrees when the phone is in landscape mode

Description
When I rotate the phone, I will execute render user:

await mediaStream.attachVideo(userId, quality);

However, sometimes I encounter the issue where my own video is displayed correctly at first, but after about 2–3 seconds, it gets rotated 90 degrees.

Which Web Video SDK version?
2.2.5

Device:

  • Device: Iphone 15
  • OS: IOS 18.6.2
  • Browser: Safari
  • Browser Version: 18.6.2

Hey @phuongnv1

Thanks for your feedback.

Could you share some problematic session IDs with us?

Thanks
Vic

@vic.yang

Here are the session IDs where I encountered the error: I5sP9FaYTJuidM8jIEIxMA==

I look forward to your response.

Thanks

Phuong

Hi @phuongnv1

I5sP9FaYTJuidM8jIEIxMA==

From the logs, the video doesn’t seem to have any issues. Sorry, since we can’t see the video content, we can’t determine whether the image has rotated.

I’m not sure what you meant by ‘When I rotate the phone, I will execute render user’, because after rendering the video with a video player, you can treat it as a regular HTML element. When rotating, there’s actually no need to detach/attach it—it will automatically adapt to portrait and landscape modes.

Thanks
Vic

Hey @vic.yang

Thank you for your response.

I will clarify my logic further.

When I rotate the phone from portrait mode to landscape mode, I make the UI responsive according to the mode. Therefore, I detach the user and then reattach them. (According to your suggestion, detaching/attaching is not necessary, but I don’t think that is the issue.)

it will automatically adapt to portrait and landscape modes.

This is my expectation, but I don’t know the cause of the error. (It’s very hard to reproduce.)

Here is an image showing the video before and after the error (already in landscape mode

Before:

After:

Here are two sessions where I also encountered the same issue:

lf4e8YN5Rsai6FURU4QmYg==

6R90UynlRHmMbTqnhl6JMQ==

I look forward to your response.

Thanks

Phuong