WebRTC Module
This commit is contained in:
parent
239a5c22fe
commit
23d6d3a55d
|
@ -119,12 +119,15 @@ export default class WebRTC
|
|||
}
|
||||
case "streamAccept":{
|
||||
let {id} = data;
|
||||
let {stream} = this.sendingStream.get(id) as {stream:MediaStream};
|
||||
let sendingStream = this.sendingStream.get(id) as TransferStreamInfo;
|
||||
let senders = [];
|
||||
for (const track of stream.getTracks()) {
|
||||
senders.push(this.rtc.addTrack(track, stream));
|
||||
};
|
||||
stream.senders = senders;
|
||||
if(sendingStream && sendingStream.stream)
|
||||
{
|
||||
for (const track of sendingStream.stream.getTracks()) {
|
||||
senders.push(this.rtc.addTrack(track, sendingStream.stream));
|
||||
};
|
||||
sendingStream.senders = senders;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "message":{
|
||||
|
@ -285,7 +288,7 @@ export default class WebRTC
|
|||
{
|
||||
for (const stream of event.streams) {
|
||||
let streamInfo = this.recaivingStream.get(stream.id) as TransferStreamInfo;
|
||||
streamInfo.recaivers.push(rtpRecaiver);
|
||||
(streamInfo.recaivers || (streamInfo.recaivers = [])).push(rtpRecaiver);
|
||||
if((this.recaivingStream.get(stream.id) as {stream : MediaStream | undefined}).stream == null)
|
||||
{
|
||||
streamInfo.stream = stream;
|
||||
|
|
Loading…
Reference in New Issue