Merge pull request #3447 from jp-bennett/master
Adds support for Janus 1.x
This commit is contained in:
commit
5b9ca3f164
|
@ -561,9 +561,28 @@ async function attachVideo(id) {
|
|||
}
|
||||
}, //onmessage function
|
||||
onremotestream: function(ourstream) {
|
||||
Janus.debug(" ::: Got a remote track :::");
|
||||
Janus.debug(" ::: Got a remote stream :::");
|
||||
Janus.debug(ourstream);
|
||||
Janus.attachMediaStream(document.getElementById("liveStream" + id), ourstream);
|
||||
},
|
||||
onremotetrack: function(track, mid, on) {
|
||||
Janus.debug(" ::: Got a remote track :::");
|
||||
Janus.debug(track);
|
||||
if (track.kind ==="audio") {
|
||||
stream = new MediaStream();
|
||||
stream.addTrack(track.clone());
|
||||
if (document.getElementById("liveAudio" + id) == null) {
|
||||
audioElement = document.createElement('audio');
|
||||
audioElement.setAttribute("id", "liveAudio" + id);
|
||||
audioElement.controls = true;
|
||||
document.getElementById("imageFeed" + id).append(audioElement);
|
||||
}
|
||||
Janus.attachMediaStream(document.getElementById("liveAudio" + id), stream);
|
||||
} else {
|
||||
stream = new MediaStream();
|
||||
stream.addTrack(track.clone());
|
||||
Janus.attachMediaStream(document.getElementById("liveStream" + id), stream);
|
||||
}
|
||||
}
|
||||
}); // janus.attach
|
||||
} //function attachVideo
|
||||
|
|
Loading…
Reference in New Issue