Conversation

Here is a description of the different steps to add media devices selection on conference

Connect to the conference

Check our tutorial on conversation to have details about the conversation bases.

In iOS you can acces to back or front camera. Camera choice is done on create stream with position : .back or .front.

        var stream: ApiRTCStream!
        do {
            stream = try ApiRTCStream.createCameraStream(position: .back)
        }
        catch {
            showError(error)
            return
        }
    

See stream section to have details about stream creation.

Switch camera

Use call.replacePublishedStream() function update the published stream after a camera switch.

        call.replacePublishedStream(streamId: stream.id, withStream: newStream) { (error, stream) in
            if let error = error {
                showError(error)
                return
            }
        }