Open rayj00 opened 4 years ago
index.html: ` connection.onstream = function(event) { if (connection.isInitiator && event.type !== 'local') { return; }
if (!event.stream) {
return;
}
connection.isUpperUserLeft = false;
videoPreview.srcObject = event.stream;
videoPreview.play();
videoPreview.userid = event.userid;
if (event.type === 'local') {
videoPreview.muted = true;
}
if (connection.isInitiator == false && event.type === 'remote') {
connection.dontCaptureUserMedia = true;
connection.attachStreams = [event.stream];
connection.sdpConstraints.mandatory = {
OfferToReceiveAudio: false,
OfferToReceiveVideo: false
};
connection.getSocket(function(socket) {
socket.emit('can-relay-broadcast');
connection.getAllParticipants().forEach(function(p) {
if (p + '' != event.userid + '') {
connection.replaceTrack(event.stream, p);
}
});
});
}
}; `
Scenario Scaleable Broadcasting using Chrome: Broadcaster, Viewer1, Viewer2, Viewer3. All viewers are seeing broadcast. Viewer1 leaves (close tab). Viewer2 and Viewer3 lose video.
Anyone else see this error?