Skip to content

Commit

Permalink
Merge pull request #520 from MahmoudAboelazm/fix_transferring_error
Browse files Browse the repository at this point in the history
Fix transferring issue
  • Loading branch information
RobinLinus authored Oct 24, 2022
2 parents 15f28e4 + 09da05e commit cc9c2bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/scripts/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cc9c2bf

Please sign in to comment.