|
|
|
|
|
|
|
|
const screen = {} |
|
|
const screen = {} |
|
|
|
|
|
|
|
|
function setStream({source, stream}) { |
|
|
function setStream({source, stream}) { |
|
|
|
|
|
if(streams[source] && streams[source].id !== stream.id) { |
|
|
|
|
|
streams[source].getTracks().forEach(track => track.stop()) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
streams[source] = stream |
|
|
streams[source] = stream |
|
|
m.redraw() |
|
|
m.redraw() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const stream = streams[State.username] |
|
|
const stream = streams[State.username] |
|
|
if(stream) { |
|
|
if(stream) { |
|
|
stream.getTracks().forEach(track => { |
|
|
stream.getTracks().forEach(track => { |
|
|
try {rpc.addTrack(track, stream) } |
|
|
|
|
|
|
|
|
try { rpc.addTrack(track, stream) } |
|
|
catch { } |
|
|
catch { } |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |