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
链接已复制
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.
