Controlling the Call
The PexRTC library has many methods that can be called to manage the call.
The hangup method is used to disconnect the call for the local participant.
The PexRTC library allows the user to mute the microphone so that the far end cannot hear them. This can either be done by specifying the expected state, e.g. pextRTC.muteAudio(true), or by toggling without specifying the state, e.g. pexRTC.muteAudio().
The PexRTC library allows the user to mute their video so that the far end cannot see them. This can either be done by specifying the expected state, e.g. pextRTC.muteVideo(true), or by toggling without specifying the state, e.g. pexRTC.muteVideo().
When the pin is optional/required we need to connect to the call with the supplied pin, to do this we call the connect method and pass in the pin
When a device is selected we need to stop the currently streamed device and then attach the new device. If we don't call the stopStreamedMedia method the video will stay active during the call.
