apivideo/api.video-reactnative-live-stream

Android Orientation change but video always streaming on Portrait

amitsonit opened this issue · 4 comments

Version

v1.2.3

Which operating systems have you used?

  • Android
  • iOS

Environment that reproduces the issue

  1. Lock Orientation to Landscape and start stream.
  2. If not locking also just start stream and change Device orientation and start live stream
  3. When you watch it, it. always have portrait orientation.

Is it reproducible in the example application?

No

RTMP Server

I have my own server

Reproduction steps

  1. Lock Orientation to Landscape and start stream.
  2. If not locking also just start stream and change Device orientation and start live stream
  3. When you watch it, it. always have portrait orientation.

1080p video resolution

Expected result

Video Orientation and Device orientation must be same.

Actual result

Video Orientation and Device orientation is different on Android. IOS working fine.

Additional context

No response

Relevant logs output

No response

Hi,

It is not really well documented but what you are describing is the expected behavior:

  • The application should lock the orientation while in live in the desired orientation.

There are differences between iOS and Android because we are using 2 different native libraries. This is a corner case difference. Turning a phone during a live is not an expected behavior (you don't do it while recording a MP4).

Hi, In my application I am giving user option to live stream in 2 orientation. user can choose first then start live stream.

Now when user select portrait then it is working fine.

But when user select landscape then from live streamer side orientation is showing correctly and live streaming working fine. but when as a fan user I watch that stream it showing rotated stream. I checked with HLS player also it showing rotated. so this is the issue

User not have option to change the rotation of device if he choose any rotation before. so during the live stream device rotation will not change. because I am locking it on the user selected orientation.

I checked Other libraries they used layoutListeners to handle this issue. But that code in Java, I am not expert of kotlin, maybe anyone can help

I am still not sure what you are trying to achieve.

If you want the live stream in landscape, you can force the orientation of your app in landscape.
Something like this: https://github.com/ThibaultBee/StreamPack/blob/b19933013e1aff319f9ce0cbd706d49d0454412e/demos/camera/src/main/java/io/github/thibaultbee/streampack/app/ui/main/PreviewFragment.kt#L104
But instead of SCREEN_ORIENTATION_LOCKED, you force requestedOrientation to SCREEN_ORIENTATION_LANDSCAPE

This is for Android but you might find a similar code for RN.

User not have option to change the rotation of device if he choose any rotation before. so during the live stream device rotation will not change. because I am locking it on the user selected orientation.

As most player does not support orientation changed, I don't see the point of changing orientation during a live streaming.