I am using RTCMulticonnection v3 for video/audio/text chat. In my project I am not starting streaming when any user joins the room. I am starting streaming when user clicks on Camera icon beside username. Check the below screenshot.
Getting error when executing below code.
myConnection.dontCaptureUserMedia = false;
mySession = {audio: true, video: true};
myConnection.captureUserMedia(function (stream) {
var streamid = myConnection.token();
myConnection.customStreams[streamid] = stream;
myConnection.sendMessage({
hasCamera: true,
streamid: streamid,
session: mySession,
room_id: room_id,
username: username
});
myConnection.addStream({
audio: true,
video: true
});
}, mySession);
Getting error while executing above code.
RTCMultiConnection.min.js:2150 Uncaught TypeError: Cannot read property 'getAudioTracks' of undefined at window.RTCMultiConnection.connection.addStream (RTCMultiConnection.min.js:2150) at ui.peer-connection-new.js:340 at window.RTCMultiConnection.connection.getUserMedia.connection.captureUserMedia (RTCMultiConnection.min.js:1973) at rtcMultiConnection.onCustomMessage (ui.peer-connection-new.js:334) at r.emit (socket.io.js:1) at r.onevent (socket.io.js:2) at r.onpacket (socket.io.js:2) at r. (socket.io.js:2) at r.emit (socket.io.js:1) at r.ondecoded (socket.io.js:1)
Check below screenshot
I have taken reference of MultiRTC: Skype-like app demo.