tkmn0 / SimpleWebRTCExample_iOS

Simple example for WebRTC on iOS written in swift5
MIT License
178 stars 49 forks source link

change camera position? #26

Closed emirbeytekin closed 4 years ago

emirbeytekin commented 4 years ago

hello, how can i change my camera position on connected to server ?

tkmn0 commented 4 years ago

Hi, Currently, this project can not swap camera (front only). But you can add custom camera swapping, I think.

emirbeytekin commented 4 years ago

Yes, i'm added on WebRTCClient.swift setup function but if i want change camera, app is freezing on front camera

if self.channels.video {
            if isFront {
                self.localVideoTrack.remove(self.localRenderView!)
                startCaptureLocalVideo(cameraPositon: .front, videoWidth: 640, videoHeight: 640, videoFps: 30)
            } else {
                self.localVideoTrack.remove(self.localRenderView!)
                startCaptureLocalVideo(cameraPositon: .back, videoWidth: 640, videoHeight: 640, videoFps: 30)
            }
            self.localVideoTrack?.add(self.localRenderView!)
        }
emirbeytekin commented 4 years ago

Anyone help me ?

tkmn0 commented 4 years ago

@emirbeytekin Hi, Sorry for the late reply. I implemented camera switch function on master branch. You can switch camera position with tapping local camera view. Check it out :)

I think you just need to stop capture first. Thank you for your question!