8000
div>
File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -134,19 +134,15 @@ class RTCDataChannel {
134
134
} else {
135
135
arrayBuffer = data;
136
136
}
137
- print (
138
- "Object got from DataChannel ${arrayBuffer } with type ${arrayBuffer .runtimeType }" );
139
- //TODO: convert ArrayBuffer to Uint8Array
140
- //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
141
- throw UnimplementedError ();
137
+ return RTCDataChannelMessage .fromBinary (arrayBuffer.asUint8List ());
142
138
}
143
139
144
140
Future <void > send (RTCDataChannelMessage message) {
145
141
if (! message.isBinary) {
146
142
_jsDc.send (message.text);
147
143
} else {
148
144
// This may just work
149
- _jsDc.send (message.binary);
145
+ _jsDc.sendByteBuffer (message.binary.buffer );
150
146
// If not, convert to ArrayBuffer/Blob
151
147
}
152
148
return Future .value ();
You can’t perform that action at this time.
0 commit comments