wrtc.onLocalMedia() is an event function called when the wrtc object got access to local media (local microphone/camera), released access (media stream stopped), or failed to get access.
Depending on wrtc object configuration it may try to get access to local media at once when page is loaded, or later on when making or receiving a call.
You can use this event to enable and disable video window showing image of local camera, or warn user that camera could not be accessed.
An access failure usually is because browser was denied access. It can have multiple reasons:
wrtc_kit has got or released access to local media (mic/cam) or failed to do so
wrtc.onLocalMedia(arg)
Ignored.
wrtc.onLocalMedia = function(arg) {
if (arg == "success")
wrtc.localVideo.style.display = "inline";
else if (arg == "error")
window.alert("Could not access mic/cam");
else
wrtc.localVideo.style.display = "none";
}