client-sdk-swift
client-sdk-swift copied to clipboard
When "Portait Locked" option is activated, VideoView behaves wrong
these are the test steps I did demonstrated in the video: Remembering that the view controller is locked in landscape, which is supposed to be.
- I'm in landscape without "Portait Locked"
- I turn on the camera
- Rotate iPhone to Portait (physically)
- I run back to Landscape
- Turn off camera( we have an observer to turn off the camera when we go to “Control Panel”)
- Enable “Portait Locked” option
- I turn on the camera (I'm physically in landscape with “Portait Locked”), and the camera appears like this, with rotation
- Rotate iPhone to Portait (physically)
- I run back to Landscape
If you can solve the problem as soon as possible, I would really appreciate it, in fact it is something urgent for me. Thanks and keep up the good work.
https://user-images.githubusercontent.com/24411127/195927883-f55c335d-12dc-4345-b08f-f72f0e867b5b.mov
Hello I will try to replicate this one.
As soon as you have feedback, please let me know. Thank you and keep up the good work.
Hi I did a quick check and it seems to be working as expected . Can you explain more details or can you upload example code to reproduce the issue ?
Do you mean you want to rotate even when the OS's rotation is locked ?
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
.landscape
}
override var shouldAutorotate: Bool {
true
}
what happens is that when we have the "portrait Locked" the camera is rotated as you can see. Videoview behaves like portrait.
https://user-images.githubusercontent.com/24411127/196243735-9655dc68-adc2-44ea-888b-09fe891ed444.mov
I can reproduce this one, it looks like related with the CameraCapturer. This will be a bit tricky to fix.
Looks like related to RTCCameraCapturer using UIDeviceOrientation instead of UIInterfaceOrientation .
https://chromium.googlesource.com/external/webrtc/+/branch-heads/62/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m
Related: https://stackoverflow.com/questions/7968451/different-ways-of-getting-current-interface-orientation
I have a few fixes in mind:
- Allow to override rotation to any value the developer prefers.
- Attempt to use UIInterfaceOrientation for applying "real" rotation .
These fixes will need direct changes in WebRTC and may take a while.
Hi @hiroshihorie , first of all, thanks for reply.
I think it's a good approach, as soon as the fix is available can you notify me here in the ticket please?
do you remember about it? There is the same problem. The app only has a horizontal view and the camera is not working properly. It would be nice to rotate the picture for sending.
Hi, sorry for taking so long but this patch should fix it : https://github.com/webrtc-sdk/webrtc/pull/92
It will be in the new release. Please re-open if you still see issues.