Comments (3)
I ran into a similar issue. If you're using a RTCCameraPreviewView for your local video stream you could try something like this:
if let previewLayer = localVideoView.layer as? AVCaptureVideoPreviewLayer,
let connection = previewLayer.connection,
connection.isVideoOrientationSupported {
switch UIDevice.current.orientation {
case .landscapeLeft:
connection.videoOrientation = .landscapeLeft
localVideoView.transform = CGAffineTransform.init(scaleX: 1, y: -1)
break
case .landscapeRight:
connection.videoOrientation = .landscapeRight
localVideoView.transform = CGAffineTransform.init(scaleX: 1, y: -1)
break
case .portrait:
connection.videoOrientation = .portrait
localVideoView.transform = CGAffineTransform.identity
break
case .portraitUpsideDown:
connection.videoOrientation = .portraitUpsideDown
localVideoView.transform = CGAffineTransform.identity
break
default:
print("unsupport orientation")
}
}
Basically need to translate UIDeviceOrientation to AVCaptureVideoOrientation and perform the transform so localVideoView is rotated correctly.
Hope this helps.
Also just found that there is a feature request related to this issue:
https://bugs.chromium.org/p/webrtc/issues/detail?id=6749
from webrtc.
Yea the behaviour is a bit different with android,
Whenever you rotate the app even though your app set autoRotate false,
The view created always rendering agian,
For now like @obaskanderi said, we can manipulate the view by change rotation or y axis.
from webrtc.
I assume it's fixed in the upstream.
from webrtc.
Related Issues (20)
- Linker command failed with exit code 1 - only with WebRTC dependency HOT 11
- New build (release M61) HOT 1
- Will this library ever support screen sharing for ios?
- RTCVideoTrack setIsEnable to NO disables the camera auto rotation.
- Change codec ? HOT 5
- cannot execute HOT 1
- How to use the method to show localstream in videoview? - for iOS HOT 2
- webrtc related variables are deallocated before view dismiss causing crash.
- Require Only App-Extension-Safe API
- Library not loaded problem HOT 1
- Remote stream is not rendered. HOT 1
- Fatal error in ../../video/video_receive_stream.ccafter calling webrtc from my application iOS HOT 1
- Call iOS to iOS Not Connected
- Podspec: The minimal iOS platform should be iOS 9.0 HOT 1
- sdpMid always audio
- disable video in call
- macOS?
- Crash in WebRTCFlleName HOT 1
- How to build framework with bitcode?
- You're probably looking for GoogleWebRTC - not this pod
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webrtc.