Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).

how switch camera in ios?

snow__fly
Beginner
2,021 Views

      hi!

            how switch camera in ios? 

          I use :

               self.myCamera = AVCaptureDevice.defaultDevice(withDeviceType: .builtInWideAngleCamera, mediaType: AVMediaTypeVideo, position: .front)

              let cameraid=self.myCamera?.uniqueID

              self.myCameraPar=RTCLocalCameraStreamParameters(videoEnabled: true, audioEnabled: true)
            // [parameters setResolutionWidth:352 height:288];
                self.myCameraPar?.setResolutionWidth(352, height: 288)
            
                self.myCameraPar?.setCameraId(cameraid!) 
            
                self.localCanmerStream=RTCLocalCameraStream(parameters: self.myCameraPar!)

          I switch camera,but no success! 

             /*

 let session =  AVCaptureSession()
            
            do {
                let    Input1 = try AVCaptureDeviceInput(device: self.myCamera)
                let    Input2 = try AVCaptureDeviceInput(device: self.myCamera2)
                
                session.beginConfiguration()
                
                
                session.removeInput(Input1)
                
                let b =  session.canAddInput(Input2)
                if(b)
                {
                    session.addInput(Input2)
                    print("okOKokok")
                }
                else
                {
                    print("nononono")
                }
               
                
                session.commitConfiguration()
                session.startRunning()

   */

 I look at API  "RTCAVFoundationVideoSource" ,but I can not use.

        let t = RTCAVFoundationVideoSource.init(constraints: <#T##RTCMediaConstraints!#>)
            
            t?.useBackCamera = true 

 

 

0 Kudos
22 Replies
krishna__venkata
Beginner
170 Views

Hello Team,

Till next update, we decided to republish the ICSLocalStream every time when user switch camera. But after 2 times of switching camera we got issue as like below.

ICE connection state changed to checking

 Remote stream added.

 Empty candidate.

 ICE connection state changed to connected

 ICE connection state changed to completed

How to resolve the issue, till now we can not configure ICE servers at our application end. While Android application, how many times we will switch camera we cannot get this issue.

Please help us to resolve this issue, its major functionality for application.

 

Thank you.

0 Kudos
Dabhi__Hardik
Beginner
170 Views

Hello,

Is there any ios opening who knows webRTC ?Please let me know

0 Kudos
Reply