twilio / twilio-video-ios

Programmable Video SDK by Twilio
http://twilio.com/video
Other
64 stars 22 forks source link

The screen broadcast ratio can't be adjusted correctly after rotating the device in ReplayKitExample. #166

Open Fanpei920 opened 3 years ago

Fanpei920 commented 3 years ago

Description

The screen broadcast ratio can't be adjusted correctly after rotating the device

Steps to Reproduce

  1. Launch ReplayKit example Screen Shot 2020-12-07 at 15 24 05

  2. Rotate deivce the capture ratio didn't be adjusted as showed in capture below. Screen Shot 2020-12-07 at 15 24 17

Code

ReplayKitExample.

Expected Behavior

the ratio should be adjusted correctly after rotating.

Actual Behavior

Capture above.

Reproduces How Often

always

Versions

All relevant version information for the issue.

Video iOS SDK

3.7 via CocoaPods

Xcode

12.2

iOS Version

14.2

iOS Device

iPad Pro 12.9 inch

timrozum commented 3 years ago

Hi @Fanpei920,

Are you still having this issue?

To start the screen capture are you tapping the "Start Broadcast" or "Start Conference" button?

Thanks!

Fanpei920 commented 3 years ago

@timrozum

Yes, I still have this issue.

Following these steps and it can be reproduced.

  1. Launch video-quickstart-js in other device's browser and launch ReplayKit-example.
  2. Join same room.
  3. Start Conference in ReplayKit-example. and launch webview.
  4. Rotate the ReplayKit-example's device
  5. The stream in the video-quickstart-js' device is displayed in a wrong ratio.

Thanks!

timrozum commented 3 years ago

@Fanpei920 thank you very much for reporting this issue!

I am able to reproduce it on the iPad. I don't think it is an issue on the iPhone because orientation is automatically locked by the system when capturing the app screen. I don't know why iOS and iPadOS behave differently. I am looking into a solution.

timrozum commented 3 years ago

Hi @Fanpei920,

I have transferred this issue to our video SDK repo since the SDK is impacted.

After looking into this more I believe that this problem is caused by an Apple bug. I have submitted a bug report to Apple.

Unfortunately I don't think there is a reliable workaround that we can apply inside the SDK.

You could consider locking the UI orientation during screen capture on iPad to prevent the issue. The system does this automatically on iPhone.