浏览代码

Fix “RTCDataChannel.reliable is obsolete” (Fix #242)

RobinLinus 4 年之前
父节点
当前提交
0724487132
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      client/scripts/network.js

+ 4 - 1
client/scripts/network.js

@@ -252,7 +252,10 @@ class RTCPeer extends Peer {
     }
 
     _openChannel() {
-        const channel = this._conn.createDataChannel('data-channel', { reliable: true });
+        const channel = this._conn.createDataChannel('data-channel', { 
+            ordered: true,
+            reliable: true // Obsolete. See https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable
+        });
         channel.binaryType = 'arraybuffer';
         channel.onopen = e => this._onChannelOpened(e);
         this._conn.createOffer().then(d => this._onDescription(d)).catch(e => this._onError(e));