Rainbow-CPaaS / Rainbow-iOS-SDK-Samples

All samples of the Rainbow SDK for iOS
Other
4 stars 3 forks source link

How to switch front camera to back ? #1

Closed gersonjanhuel closed 6 years ago

gersonjanhuel commented 6 years ago

Hi

I've been using rainbow webRTC framework before, after update the to Rainbow sdk 1.46.0 my code to switch camera doesn't work anymore :

`

if localVideoTrack != nil {

if let source = localVideoTrack.source as? RTCAVFoundationVideoSource { source.useBackCamera = isRearCameraActive self.localVideoView.captureSession = source.captureSession } }

`

RTCAVFoundationVideoSource is deprecated. How to work around with this ?

vyskocil commented 6 years ago

Hi Gerson,

Due to the WebRTC stack update in the latest iOS Rainbow SDK, which has deprecated RTCAVFoundationVideoSource, the local video part has to be updated with the new provided class : RTCCameraVideoCapturer

The sample app has been updated accordingly : https://github.com/Rainbow-CPaaS/Rainbow-iOS-SDK-Samples/tree/master/Rainbow-iOS-SDK-Sample-WebRTC