From 09da05e700349ef36d216db4de681ffa9e656004 Mon Sep 17 00:00:00 2001 From: MahmoudAboelazm Date: Sun, 23 Oct 2022 06:17:39 +0200 Subject: [PATCH] Fix transferring issue --- client/scripts/network.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/scripts/network.js b/client/scripts/network.js index 838c8c8..e1383f3 100644 --- a/client/scripts/network.js +++ b/client/scripts/network.js @@ -258,7 +258,6 @@ class RTCPeer extends Peer { 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)); } @@ -295,6 +294,7 @@ class RTCPeer extends Peer { _onChannelOpened(event) { console.log('RTC: channel opened with', this._peerId); const channel = event.channel || event.target; + channel.binaryType = 'arraybuffer'; channel.onmessage = e => this._onMessage(e.data); channel.onclose = e => this._onChannelClosed(); this._channel = channel;