Просмотр исходного кода

Reference the corresponding peer connection in events

Lennart Grahl 5 лет назад
Родитель
Сommit
9be0a36fad
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/services/webclient.ts

+ 3 - 2
src/services/webclient.ts

@@ -1062,7 +1062,8 @@ export class WebClientService {
 
             // Create data channel
             this.arpLog.debug(`Creating data channel ${WebClientService.DC_LABEL}`);
-            const dc = this.pcHelper.pc.createDataChannel(WebClientService.DC_LABEL);
+            const pc = this.pcHelper.pc;
+            const dc = pc.createDataChannel(WebClientService.DC_LABEL);
             dc.binaryType = 'arraybuffer';
 
             // Wrap as unbounded, flow-controlled data channel
@@ -1085,7 +1086,7 @@ export class WebClientService {
 
                 // Determine chunk length
                 this.secureDataChannelChunkLength = Math.min(
-                    WebClientService.DATA_CHANNEL_MAX_CHUNK_SIZE, this.pcHelper.pc.sctp.maxMessageSize);
+                    WebClientService.DATA_CHANNEL_MAX_CHUNK_SIZE, pc.sctp.maxMessageSize);
                 this.arpLog.debug(`Using chunk length: ${this.secureDataChannelChunkLength} for data channel` +
                     dc.label);