turn on/off camera
This commit is contained in:
parent
019a2cd299
commit
ffaf149b1f
|
@ -236,7 +236,16 @@ final class CallVC : UIViewController, WebRTCSessionDelegate {
|
|||
}
|
||||
|
||||
@objc private func minimize() {
|
||||
|
||||
if (localVideoView.isHidden) {
|
||||
webRTCSession.turnOnVideo()
|
||||
localVideoView.isHidden = false
|
||||
cameraManager.prepare()
|
||||
cameraManager.start()
|
||||
} else {
|
||||
webRTCSession.turnOffVideo()
|
||||
localVideoView.isHidden = true
|
||||
cameraManager.stop()
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func switchCamera() {
|
||||
|
|
|
@ -255,4 +255,12 @@ extension WebRTCSession {
|
|||
public func unmute() {
|
||||
audioTrack.isEnabled = true
|
||||
}
|
||||
|
||||
public func turnOffVideo() {
|
||||
localVideoTrack.isEnabled = false
|
||||
}
|
||||
|
||||
public func turnOnVideo() {
|
||||
localVideoTrack.isEnabled = true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue