node-datachannel 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.clang-format +17 -0
- package/CMakeLists.txt +5 -1
- package/dist/cjs/polyfill/RTCPeerConnection.cjs +6 -1
- package/dist/cjs/polyfill/RTCPeerConnection.cjs.map +1 -1
- package/dist/esm/polyfill/RTCPeerConnection.mjs +6 -1
- package/dist/esm/polyfill/RTCPeerConnection.mjs.map +1 -1
- package/dist/types/polyfill/RTCPeerConnection.d.ts +1 -2
- package/package.json +3 -2
- package/src/cpp/data-channel-wrapper.cpp +432 -411
- package/src/cpp/data-channel-wrapper.h +0 -2
- package/src/cpp/ice-udp-mux-listener-wrapper.cpp +104 -97
- package/src/cpp/main.cpp +11 -11
- package/src/cpp/media-audio-wrapper.cpp +291 -294
- package/src/cpp/media-audio-wrapper.h +1 -3
- package/src/cpp/media-direction.cpp +32 -32
- package/src/cpp/media-direction.h +1 -1
- package/src/cpp/media-rtcpreceivingsession-wrapper.cpp +24 -28
- package/src/cpp/media-rtcpreceivingsession-wrapper.h +0 -5
- package/src/cpp/media-track-wrapper.cpp +350 -339
- package/src/cpp/media-track-wrapper.h +0 -3
- package/src/cpp/media-video-wrapper.cpp +312 -313
- package/src/cpp/media-video-wrapper.h +1 -3
- package/src/cpp/peer-connection-wrapper.cpp +1094 -1047
- package/src/cpp/peer-connection-wrapper.h +0 -2
- package/src/cpp/rtc-wrapper.cpp +142 -138
- package/src/cpp/rtc-wrapper.h +8 -10
- package/src/cpp/thread-safe-callback.cpp +39 -50
- package/src/cpp/thread-safe-callback.h +26 -28
- package/src/cpp/web-socket-server-wrapper.cpp +205 -199
- package/src/cpp/web-socket-server-wrapper.h +0 -4
- package/src/cpp/web-socket-wrapper.cpp +625 -598
- package/src/cpp/web-socket-wrapper.h +0 -3
- package/src/polyfill/RTCPeerConnection.ts +9 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { SelectedCandidateInfo } from '../lib/types';
|
|
2
|
+
import { DataChannelInitConfig, SelectedCandidateInfo } from '../lib/types';
|
|
3
3
|
import { PeerConnection } from '../lib/index';
|
|
4
4
|
import RTCSessionDescription from './RTCSessionDescription';
|
|
5
5
|
import RTCDataChannel from './RTCDataChannel';
|
|
@@ -36,7 +36,7 @@ export default class RTCPeerConnection extends EventTarget implements globalThis
|
|
|
36
36
|
// events
|
|
37
37
|
onconnectionstatechange: globalThis.RTCPeerConnection['onconnectionstatechange'] = null;
|
|
38
38
|
// For ondatachannel we need to define type manually
|
|
39
|
-
ondatachannel: ((this: globalThis.RTCPeerConnection, ev: RTCDataChannelEvent) => any) | null;
|
|
39
|
+
ondatachannel: ((this: globalThis.RTCPeerConnection, ev: globalThis.RTCDataChannelEvent) => any) | null;
|
|
40
40
|
onicecandidate: globalThis.RTCPeerConnection['onicecandidate'] = null;
|
|
41
41
|
onicecandidateerror: globalThis.RTCPeerConnection['onicecandidateerror'] = null;
|
|
42
42
|
oniceconnectionstatechange: globalThis.RTCPeerConnection['oniceconnectionstatechange'] = null;
|
|
@@ -362,7 +362,13 @@ export default class RTCPeerConnection extends EventTarget implements globalThis
|
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
createDataChannel(label: string, opts: globalThis.RTCDataChannelInit = {}): RTCDataChannel {
|
|
365
|
-
const
|
|
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);
|
|
366
372
|
const dataChannel = new RTCDataChannel(channel, opts);
|
|
367
373
|
|
|
368
374
|
// ensure we can close all channels when shutting down
|