OpenVidu / openvidu

OpenVidu Platform main repository
https://openvidu.io
Apache License 2.0
1.87k stars 463 forks source link

OVP 2.22.0 - Changing orientation on iPhones behaves weirdly and unpredictably #752

Open mallikarjungurav opened 1 year ago

mallikarjungurav commented 1 year ago

Describe the bug We have a use-case wherein user can change the orientation of his mobile phone while live streaming. Due to discrepancies in Android and iPhones, we handle orientation change in different ways. For Android devices, when orientation is changed, we do not do anything and the live stream works properly without any issues, but iPhones do not support this behaviour and black out the screen when the orientation is changed and video is not recorded. To handle this, we first stop the video and then create a new live stream wherein we unpublish the previous stream and release the camera and again obtain the camera and publish the stream, which works fine in existing OVP 2.17.0. But since the time we upgraded it to OVP 2.22.0 it is creating issues for iPhone, where after orientation change:

  1. Sometimes stream gets blacked out,
  2. Sometimes it continuously stream the video
  3. At times it stops the running stream, obtain the camera again and starts the stream (which is correct behaviour for iPhone).

We have already raised a bug related to switching camera on OVP 2.22.0. Link for the bug is https://github.com/OpenVidu/openvidu/issues/751 This might be related to switching camera issue.

Expected behavior When orientation is changed, stream should be stopped, camera should be released and then again obtain the camera and start a new stream.

Wrong current behavior

  1. Sometimes stream gets blacked out,
  2. Sometimes it continuously stream the video
  3. At times it stops the running stream, obtain the camera again and starts the stream (which is correct behaviour for iPhone).

OpenVidu tutorial where to replicate the error This is an EXTREMELY IMPORTANT STEP. If we are able to replicate the error in any of the official OpenVidu Tutorials or OpenVidu Demos, then we will be able to quickly fix it. If you are getting the error in your own application, please try to add the necessary changes to the most similar tutorial so it fails with the same error (try to keep those changes as contained as possible, so that the original tutorial maintains its integrity). Once you have an application to replicate the error, explain in detail the steps to get it like this:

  1. Clone repository [...]
  2. Compile the application like this [...]
  3. Run OpenVidu Server like this [...]
  4. Run the application like this [...]
  5. Join 1 user... Publish a video stream [...]
  6. See error

OpenVidu deployment info How is your OpenVidu Server instance deployed when you get the bug. A couple of possible examples are listed below:

IMPORTANT NOTE: please, if you think the bug might be related to OpenVidu Server side, specify here if you are also getting the error by using OpenVidu Server Demos instance. This instance is publicly available (use it only for this test, because it is not secure!!!): URL: https://demos.openvidu.io:4443, SECRET: MY_SECRET

Client device info (if applicable) iPhones

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here. For example, attach any useful logs related to the issue.

mallikarjungurav commented 1 year ago

@cruizba Any help on this please. Video gets blacked out intermittently, when orientation is changed on iPhone wherein it works well with Androids.

micaelgallego commented 1 year ago

How can we reproduce the error?

mallikarjungurav commented 1 year ago

@micaelgallego Start streaming with iPhone with back camera by default and then within 1-2 secs change orientation from portrait to landscape, the video stream will be blacked out. This is intermittent issue so you may need to do it multiple times to reproduce it.

micaelgallego commented 1 year ago

Are you using Kurento or mediasoup media server?

mallikarjungurav commented 1 year ago

@micaelgallego

We upgraded OpenVidu Professional from 2.17.0 to 2.22.0. So, we still use Kurento media server internally and not mediasoup.

cruizba commented 1 year ago

Solved here

cruizba commented 1 year ago

Sorry wrong issue. Reopening again...