mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-12 22:00:02 -04:00
fix rtctransport bug
This commit is contained in:
parent
2f666df2ed
commit
db82f47aca
1 changed files with 3 additions and 1 deletions
|
@ -42,10 +42,12 @@ export class RTCTransport extends Transport {
|
|||
this.peer.onicegatheringstatechange = onicegatheringstatechange;
|
||||
this.dataChannel = this.peer.createDataChannel("host-server");
|
||||
this.dataChannel.onopen = onopen;
|
||||
this.dataChannel.binaryType = "arraybuffer";
|
||||
|
||||
this.dataChannel.onclose = onclose;
|
||||
this.dataChannel.onmessage = async (event) => {
|
||||
let buf = await event.data.arrayBuffer();
|
||||
console.log(event);
|
||||
let buf = event.data;
|
||||
this.ondata(buf);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue