File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable @typescript-eslint/no-explicit-any */
2- import { SelectedCandidateInfo } from '../lib/types' ;
2+ import { DataChannelInitConfig , SelectedCandidateInfo } from '../lib/types' ;
33import { PeerConnection } from '../lib/index' ;
44import RTCSessionDescription from './RTCSessionDescription' ;
55import RTCDataChannel from './RTCDataChannel' ;
@@ -362,7 +362,13 @@ export default class RTCPeerConnection extends EventTarget implements globalThis
362362 }
363363
364364 createDataChannel ( label : string , opts : globalThis . RTCDataChannelInit = { } ) : RTCDataChannel {
365- const channel = this . #peerConnection. createDataChannel ( label , opts ) ;
365+ const nativeOpts : DataChannelInitConfig = {
366+ ...opts ,
367+ // libdatachannel uses "unordered", opposite of RTCDataChannelInit.ordered
368+ unordered : opts . ordered === false ? true : false ,
369+ } ;
370+
371+ const channel = this . #peerConnection. createDataChannel ( label , nativeOpts ) ;
366372 const dataChannel = new RTCDataChannel ( channel , opts ) ;
367373
368374 // ensure we can close all channels when shutting down
You can’t perform that action at this time.
0 commit comments