Currently developing a JsSIP proof of concept on Fiddle, I can't get the video stream to play after answering the call.
To reproduce the issue, open this JSFiddle https://jsfiddle.net/redvivi/3zedv54a/4/ in two different tabs (one is caller so login as Test User 1, the other is receiver so login as Test User 2), and try to call each others.
The events are firing, the media sources are properly detected, so I feel this is something to do with how the stream are handled, the section of interest is here:
userAgent.on('newRTCSession', function(data) {
console.log('### newRTCSession', data);
if (data.originator === 'remote') {
showIncomingCall();
session = data.session;
session.on('track', function(e) {
console.log('### session track', e)
remoteView.src = window.URL.createObjectURL(e.streams[0]);
});
} else {
session = data.session;
session.on('track', function(e) {
console.log('### session track', e)
selfView.src = window.URL.createObjectURL(e.streams[0]);
});
}
Am I missing something?
Thanks!