react-native-webrtc 111.0.4 → 111.0.6
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/android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java +0 -18
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +30 -0
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +15 -20
- package/lib/commonjs/MediaDevices.js +7 -2
- package/lib/commonjs/MediaDevices.js.map +1 -1
- package/lib/commonjs/MediaStream.js +9 -2
- package/lib/commonjs/MediaStream.js.map +1 -1
- package/lib/commonjs/MediaStreamTrack.js +10 -6
- package/lib/commonjs/MediaStreamTrack.js.map +1 -1
- package/lib/commonjs/RTCDataChannel.js +11 -0
- package/lib/commonjs/RTCDataChannel.js.map +1 -1
- package/lib/commonjs/RTCPeerConnection.js +39 -89
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/module/MediaDevices.js +8 -3
- package/lib/module/MediaDevices.js.map +1 -1
- package/lib/module/MediaStream.js +8 -1
- package/lib/module/MediaStream.js.map +1 -1
- package/lib/module/MediaStreamTrack.js +10 -6
- package/lib/module/MediaStreamTrack.js.map +1 -1
- package/lib/module/RTCDataChannel.js +12 -1
- package/lib/module/RTCDataChannel.js.map +1 -1
- package/lib/module/RTCPeerConnection.js +40 -90
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/typescript/MediaDevices.d.ts +5 -3
- package/lib/typescript/MediaDevices.d.ts.map +1 -1
- package/lib/typescript/MediaStream.d.ts +3 -5
- package/lib/typescript/MediaStream.d.ts.map +1 -1
- package/lib/typescript/MediaStreamTrack.d.ts +19 -5
- package/lib/typescript/MediaStreamTrack.d.ts.map +1 -1
- package/lib/typescript/MediaStreamTrackEvent.d.ts +1 -1
- package/lib/typescript/MediaStreamTrackEvent.d.ts.map +1 -1
- package/lib/typescript/RTCDataChannel.d.ts.map +1 -1
- package/lib/typescript/RTCPeerConnection.d.ts +9 -18
- package/lib/typescript/RTCPeerConnection.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/MediaDevices.ts +13 -4
- package/src/MediaStream.ts +12 -8
- package/src/MediaStreamTrack.ts +28 -7
- package/src/MediaStreamTrackEvent.ts +1 -1
- package/src/RTCDataChannel.ts +13 -2
- package/src/RTCPeerConnection.ts +53 -105
- package/lib/commonjs/MediaStreamEvent.js +0 -14
- package/lib/commonjs/MediaStreamEvent.js.map +0 -1
- package/lib/commonjs/RTCEvent.js +0 -23
- package/lib/commonjs/RTCEvent.js.map +0 -1
- package/lib/module/MediaStreamEvent.js +0 -7
- package/lib/module/MediaStreamEvent.js.map +0 -1
- package/lib/module/RTCEvent.js +0 -17
- package/lib/module/RTCEvent.js.map +0 -1
- package/lib/typescript/MediaStreamEvent.d.ts +0 -9
- package/lib/typescript/MediaStreamEvent.d.ts.map +0 -1
- package/lib/typescript/RTCEvent.d.ts +0 -14
- package/lib/typescript/RTCEvent.d.ts.map +0 -1
- package/src/MediaStreamEvent.ts +0 -11
- package/src/RTCEvent.ts +0 -21
package/src/RTCPeerConnection.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { EventTarget } from 'event-target-shim';
|
|
1
|
+
import { EventTarget, Event, defineEventAttribute } from 'event-target-shim';
|
|
3
2
|
import { NativeModules } from 'react-native';
|
|
4
3
|
|
|
5
4
|
import { addListener, removeListener } from './EventEmitter';
|
|
@@ -9,7 +8,6 @@ import MediaStreamTrack from './MediaStreamTrack';
|
|
|
9
8
|
import MediaStreamTrackEvent from './MediaStreamTrackEvent';
|
|
10
9
|
import RTCDataChannel from './RTCDataChannel';
|
|
11
10
|
import RTCDataChannelEvent from './RTCDataChannelEvent';
|
|
12
|
-
import RTCEvent from './RTCEvent';
|
|
13
11
|
import RTCIceCandidate from './RTCIceCandidate';
|
|
14
12
|
import RTCIceCandidateEvent from './RTCIceCandidateEvent';
|
|
15
13
|
import RTCRtpReceiveParameters from './RTCRtpReceiveParameters';
|
|
@@ -48,21 +46,23 @@ type RTCDataChannelInit = {
|
|
|
48
46
|
};
|
|
49
47
|
|
|
50
48
|
type RTCPeerConnectionEventMap = {
|
|
51
|
-
connectionstatechange:
|
|
49
|
+
connectionstatechange: Event<'connectionstatechange'>
|
|
52
50
|
icecandidate: RTCIceCandidateEvent<'icecandidate'>
|
|
53
51
|
icecandidateerror: RTCIceCandidateEvent<'icecandidateerror'>
|
|
54
|
-
iceconnectionstatechange:
|
|
55
|
-
icegatheringstatechange:
|
|
56
|
-
negotiationneeded:
|
|
57
|
-
signalingstatechange:
|
|
52
|
+
iceconnectionstatechange: Event<'iceconnectionstatechange'>
|
|
53
|
+
icegatheringstatechange: Event<'icegatheringstatechange'>
|
|
54
|
+
negotiationneeded: Event<'negotiationneeded'>
|
|
55
|
+
signalingstatechange: Event<'signalingstatechange'>
|
|
58
56
|
datachannel: RTCDataChannelEvent<'datachannel'>
|
|
59
57
|
track: RTCTrackEvent<'track'>
|
|
60
|
-
error:
|
|
61
|
-
|
|
58
|
+
error: Event<'error'>
|
|
59
|
+
}
|
|
62
60
|
|
|
63
61
|
let nextPeerConnectionId = 0;
|
|
64
62
|
|
|
65
63
|
export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEventMap> {
|
|
64
|
+
localDescription: RTCSessionDescription | null = null;
|
|
65
|
+
remoteDescription: RTCSessionDescription | null = null;
|
|
66
66
|
signalingState: RTCSignalingState = 'stable';
|
|
67
67
|
iceGatheringState: RTCIceGatheringState = 'new';
|
|
68
68
|
connectionState: RTCPeerConnectionState = 'new';
|
|
@@ -73,11 +73,6 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
73
73
|
_remoteStreams: Map<string, MediaStream>;
|
|
74
74
|
_pendingTrackEvents: any[];
|
|
75
75
|
|
|
76
|
-
_currentLocalDescription: RTCSessionDescription | null = null;
|
|
77
|
-
_pendingLocalDescription: RTCSessionDescription | null = null;
|
|
78
|
-
_currentRemoteDescription: RTCSessionDescription | null = null;
|
|
79
|
-
_pendingRemoteDescription: RTCSessionDescription | null = null;
|
|
80
|
-
|
|
81
76
|
constructor(configuration) {
|
|
82
77
|
super();
|
|
83
78
|
|
|
@@ -96,30 +91,6 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
96
91
|
log.debug(`${this._pcId} ctor`);
|
|
97
92
|
}
|
|
98
93
|
|
|
99
|
-
get currentLocalDescription(): RTCSessionDescription | null {
|
|
100
|
-
return this._currentLocalDescription;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
get pendingLocalDescription(): RTCSessionDescription | null {
|
|
104
|
-
return this._pendingLocalDescription;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
get localDescription(): RTCSessionDescription | null {
|
|
108
|
-
return this._pendingLocalDescription || this._currentLocalDescription;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
get currentRemoteDescription(): RTCSessionDescription | null {
|
|
112
|
-
return this._currentRemoteDescription;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
get pendingRemoteDescription(): RTCSessionDescription | null {
|
|
116
|
-
return this._pendingRemoteDescription;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
get remoteDescription(): RTCSessionDescription | null {
|
|
120
|
-
return this._pendingRemoteDescription || this._currentRemoteDescription;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
94
|
async createOffer(options) {
|
|
124
95
|
log.debug(`${this._pcId} createOffer`);
|
|
125
96
|
|
|
@@ -186,7 +157,16 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
186
157
|
desc = null;
|
|
187
158
|
}
|
|
188
159
|
|
|
189
|
-
const {
|
|
160
|
+
const {
|
|
161
|
+
sdpInfo,
|
|
162
|
+
transceiversInfo
|
|
163
|
+
} = await WebRTCModule.peerConnectionSetLocalDescription(this._pcId, desc);
|
|
164
|
+
|
|
165
|
+
if (sdpInfo.type && sdpInfo.sdp) {
|
|
166
|
+
this.localDescription = new RTCSessionDescription(sdpInfo);
|
|
167
|
+
} else {
|
|
168
|
+
this.localDescription = null;
|
|
169
|
+
}
|
|
190
170
|
|
|
191
171
|
this._updateTransceivers(transceiversInfo, /* removeStopped */ desc?.type === 'answer');
|
|
192
172
|
|
|
@@ -210,10 +190,17 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
210
190
|
}
|
|
211
191
|
|
|
212
192
|
const {
|
|
193
|
+
sdpInfo,
|
|
213
194
|
newTransceivers,
|
|
214
195
|
transceiversInfo
|
|
215
196
|
} = await WebRTCModule.peerConnectionSetRemoteDescription(this._pcId, desc);
|
|
216
197
|
|
|
198
|
+
if (sdpInfo.type && sdpInfo.sdp) {
|
|
199
|
+
this.remoteDescription = new RTCSessionDescription(sdpInfo);
|
|
200
|
+
} else {
|
|
201
|
+
this.remoteDescription = null;
|
|
202
|
+
}
|
|
203
|
+
|
|
217
204
|
newTransceivers?.forEach(t => {
|
|
218
205
|
const { transceiverOrder, transceiver } = t;
|
|
219
206
|
const newSender = new RTCRtpSender({ ...transceiver.sender, track: null });
|
|
@@ -318,13 +305,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
318
305
|
candidate.toJSON ? candidate.toJSON() : candidate
|
|
319
306
|
);
|
|
320
307
|
|
|
321
|
-
|
|
322
|
-
this._currentRemoteDescription = new RTCSessionDescription(newSdp);
|
|
323
|
-
this._pendingRemoteDescription = null;
|
|
324
|
-
} else {
|
|
325
|
-
this._currentRemoteDescription = null;
|
|
326
|
-
this._pendingRemoteDescription = new RTCSessionDescription(newSdp);
|
|
327
|
-
}
|
|
308
|
+
this.remoteDescription = new RTCSessionDescription(newSdp);
|
|
328
309
|
}
|
|
329
310
|
|
|
330
311
|
/**
|
|
@@ -548,7 +529,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
548
529
|
return;
|
|
549
530
|
}
|
|
550
531
|
|
|
551
|
-
this.dispatchEvent(new
|
|
532
|
+
this.dispatchEvent(new Event('negotiationneeded'));
|
|
552
533
|
});
|
|
553
534
|
|
|
554
535
|
addListener(this, 'peerConnectionIceConnectionChanged', (ev: any) => {
|
|
@@ -558,7 +539,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
558
539
|
|
|
559
540
|
this.iceConnectionState = ev.iceConnectionState;
|
|
560
541
|
|
|
561
|
-
this.dispatchEvent(new
|
|
542
|
+
this.dispatchEvent(new Event('iceconnectionstatechange'));
|
|
562
543
|
});
|
|
563
544
|
|
|
564
545
|
addListener(this, 'peerConnectionStateChanged', (ev: any) => {
|
|
@@ -568,7 +549,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
568
549
|
|
|
569
550
|
this.connectionState = ev.connectionState;
|
|
570
551
|
|
|
571
|
-
this.dispatchEvent(new
|
|
552
|
+
this.dispatchEvent(new Event('connectionstatechange'));
|
|
572
553
|
|
|
573
554
|
if (ev.connectionState === 'closed') {
|
|
574
555
|
// This PeerConnection is done, clean up.
|
|
@@ -584,43 +565,8 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
584
565
|
}
|
|
585
566
|
|
|
586
567
|
this.signalingState = ev.signalingState;
|
|
587
|
-
const { localSdp, remoteSdp } = ev;
|
|
588
|
-
|
|
589
|
-
if (localSdp.type && localSdp.sdp) {
|
|
590
|
-
switch (this.signalingState) {
|
|
591
|
-
case 'stable':
|
|
592
|
-
this._currentLocalDescription = new RTCSessionDescription(localSdp);
|
|
593
|
-
this._pendingLocalDescription = null;
|
|
594
|
-
break;
|
|
595
|
-
case 'have-local-offer':
|
|
596
|
-
case 'have-local-pranswer':
|
|
597
|
-
this._currentLocalDescription = null;
|
|
598
|
-
this._pendingLocalDescription = new RTCSessionDescription(localSdp);
|
|
599
|
-
break;
|
|
600
|
-
}
|
|
601
|
-
} else {
|
|
602
|
-
this._currentLocalDescription = null;
|
|
603
|
-
this._pendingLocalDescription = null;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
if (remoteSdp.type && remoteSdp.sdp) {
|
|
607
|
-
switch (this.signalingState) {
|
|
608
|
-
case 'stable':
|
|
609
|
-
this._currentRemoteDescription = new RTCSessionDescription(remoteSdp);
|
|
610
|
-
this._pendingRemoteDescription = null;
|
|
611
|
-
break;
|
|
612
|
-
case 'have-remote-offer':
|
|
613
|
-
case 'have-remote-pranswer':
|
|
614
|
-
this._currentRemoteDescription = null;
|
|
615
|
-
this._pendingRemoteDescription = new RTCSessionDescription(remoteSdp);
|
|
616
|
-
break;
|
|
617
|
-
}
|
|
618
|
-
} else {
|
|
619
|
-
this._currentRemoteDescription = null;
|
|
620
|
-
this._pendingRemoteDescription = null;
|
|
621
|
-
}
|
|
622
568
|
|
|
623
|
-
this.dispatchEvent(new
|
|
569
|
+
this.dispatchEvent(new Event('signalingstatechange'));
|
|
624
570
|
});
|
|
625
571
|
|
|
626
572
|
// Consider moving away from this event: https://github.com/WebKit/WebKit/pull/3953
|
|
@@ -679,16 +625,9 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
679
625
|
|
|
680
626
|
// Can happen when doing a rollback.
|
|
681
627
|
if (sdpInfo.type && sdpInfo.sdp) {
|
|
682
|
-
|
|
683
|
-
this._currentLocalDescription = new RTCSessionDescription(sdpInfo);
|
|
684
|
-
this._pendingLocalDescription = null;
|
|
685
|
-
} else {
|
|
686
|
-
this._currentLocalDescription = null;
|
|
687
|
-
this._pendingLocalDescription = new RTCSessionDescription(sdpInfo);
|
|
688
|
-
}
|
|
628
|
+
this.localDescription = new RTCSessionDescription(sdpInfo);
|
|
689
629
|
} else {
|
|
690
|
-
this.
|
|
691
|
-
this._pendingLocalDescription = null;
|
|
630
|
+
this.localDescription = null;
|
|
692
631
|
}
|
|
693
632
|
|
|
694
633
|
const candidate = new RTCIceCandidate(ev.candidate);
|
|
@@ -708,22 +647,15 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
708
647
|
|
|
709
648
|
// Can happen when doing a rollback.
|
|
710
649
|
if (sdpInfo.type && sdpInfo.sdp) {
|
|
711
|
-
|
|
712
|
-
this._currentLocalDescription = new RTCSessionDescription(sdpInfo);
|
|
713
|
-
this._pendingLocalDescription = null;
|
|
714
|
-
} else {
|
|
715
|
-
this._currentLocalDescription = null;
|
|
716
|
-
this._pendingLocalDescription = new RTCSessionDescription(sdpInfo);
|
|
717
|
-
}
|
|
650
|
+
this.localDescription = new RTCSessionDescription(sdpInfo);
|
|
718
651
|
} else {
|
|
719
|
-
this.
|
|
720
|
-
this._pendingLocalDescription = null;
|
|
652
|
+
this.localDescription = null;
|
|
721
653
|
}
|
|
722
654
|
|
|
723
655
|
this.dispatchEvent(new RTCIceCandidateEvent('icecandidate', { candidate: null }));
|
|
724
656
|
}
|
|
725
657
|
|
|
726
|
-
this.dispatchEvent(new
|
|
658
|
+
this.dispatchEvent(new Event('icegatheringstatechange'));
|
|
727
659
|
});
|
|
728
660
|
|
|
729
661
|
addListener(this, 'peerConnectionDidOpenDataChannel', (ev: any) => {
|
|
@@ -835,3 +767,19 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
835
767
|
this._transceivers.sort((a, b) => a.order - b.order);
|
|
836
768
|
}
|
|
837
769
|
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Define the `onxxx` event handlers.
|
|
773
|
+
*/
|
|
774
|
+
const proto = RTCPeerConnection.prototype;
|
|
775
|
+
|
|
776
|
+
defineEventAttribute(proto, 'connectionstatechange');
|
|
777
|
+
defineEventAttribute(proto, 'icecandidate');
|
|
778
|
+
defineEventAttribute(proto, 'icecandidateerror');
|
|
779
|
+
defineEventAttribute(proto, 'iceconnectionstatechange');
|
|
780
|
+
defineEventAttribute(proto, 'icegatheringstatechange');
|
|
781
|
+
defineEventAttribute(proto, 'negotiationneeded');
|
|
782
|
+
defineEventAttribute(proto, 'signalingstatechange');
|
|
783
|
+
defineEventAttribute(proto, 'datachannel');
|
|
784
|
+
defineEventAttribute(proto, 'track');
|
|
785
|
+
defineEventAttribute(proto, 'error');
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
class MediaStreamEvent {
|
|
8
|
-
constructor(type, eventInitDict) {
|
|
9
|
-
this.type = type.toString();
|
|
10
|
-
this.stream = eventInitDict.stream;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.default = MediaStreamEvent;
|
|
14
|
-
//# sourceMappingURL=MediaStreamEvent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MediaStreamEvent","constructor","type","eventInitDict","toString","stream","exports","default"],"sourceRoot":"../../src","sources":["MediaStreamEvent.ts"],"mappings":";;;;;;AAGe,MAAMA,gBAAgB,CAAC;EAGlCC,WAAWA,CAACC,IAAI,EAAEC,aAAsC,EAAE;IACtD,IAAI,CAACD,IAAI,GAAGA,IAAI,CAACE,QAAQ,CAAC,CAAC;IAC3B,IAAI,CAACC,MAAM,GAAGF,aAAa,CAACE,MAAM;EACtC;AACJ;AAACC,OAAA,CAAAC,OAAA,GAAAP,gBAAA"}
|
package/lib/commonjs/RTCEvent.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _eventTargetShim = require("event-target-shim");
|
|
8
|
-
// Import for documentation purposes
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
/**
|
|
11
|
-
* @eventClass
|
|
12
|
-
* This event is fired whenever the RTC_EVENTS has changed except on icecandidate related.
|
|
13
|
-
* @type {RTCIceCandidateEvent} for icecandidate related.
|
|
14
|
-
* @param {RTC_EVENTS} type - The type of event.
|
|
15
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection#events MDN} for details.
|
|
16
|
-
*/
|
|
17
|
-
class RTCEvent extends _eventTargetShim.Event {
|
|
18
|
-
constructor(type, eventInitDict) {
|
|
19
|
-
super(type, eventInitDict);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.default = RTCEvent;
|
|
23
|
-
//# sourceMappingURL=RTCEvent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_eventTargetShim","require","RTCEvent","Event","constructor","type","eventInitDict","exports","default"],"sourceRoot":"../../src","sources":["RTCEvent.ts"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMC,QAAQ,SAAwCC,sBAAK,CAAa;EACnFC,WAAWA,CAACC,IAAgB,EAAEC,aAA+B,EAAE;IAC3D,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;EAC9B;AACJ;AAACC,OAAA,CAAAC,OAAA,GAAAN,QAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MediaStreamEvent","constructor","type","eventInitDict","toString","stream"],"sourceRoot":"../../src","sources":["MediaStreamEvent.ts"],"mappings":"AAGA,eAAe,MAAMA,gBAAgB,CAAC;EAGlCC,WAAWA,CAACC,IAAI,EAAEC,aAAsC,EAAE;IACtD,IAAI,CAACD,IAAI,GAAGA,IAAI,CAACE,QAAQ,CAAC,CAAC;IAC3B,IAAI,CAACC,MAAM,GAAGF,aAAa,CAACE,MAAM;EACtC;AACJ"}
|
package/lib/module/RTCEvent.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Event } from 'event-target-shim';
|
|
2
|
-
|
|
3
|
-
// Import for documentation purposes
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
-
/**
|
|
6
|
-
* @eventClass
|
|
7
|
-
* This event is fired whenever the RTC_EVENTS has changed except on icecandidate related.
|
|
8
|
-
* @type {RTCIceCandidateEvent} for icecandidate related.
|
|
9
|
-
* @param {RTC_EVENTS} type - The type of event.
|
|
10
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection#events MDN} for details.
|
|
11
|
-
*/
|
|
12
|
-
export default class RTCEvent extends Event {
|
|
13
|
-
constructor(type, eventInitDict) {
|
|
14
|
-
super(type, eventInitDict);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=RTCEvent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Event","RTCEvent","constructor","type","eventInitDict"],"sourceRoot":"../../src","sources":["RTCEvent.ts"],"mappings":"AAAA,SAASA,KAAK,QAAQ,mBAAmB;;AAEzC;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,QAAQ,SAAwCD,KAAK,CAAa;EACnFE,WAAWA,CAACC,IAAgB,EAAEC,aAA+B,EAAE;IAC3D,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;EAC9B;AACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MediaStreamEvent.d.ts","sourceRoot":"","sources":["../../src/MediaStreamEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;gBACR,IAAI,KAAA,EAAE,aAAa,EAAE;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE;CAI3D"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Event } from 'event-target-shim';
|
|
2
|
-
type RTC_EVENTS = 'connectionstatechange' | 'iceconnectionstatechange' | 'icegatheringstatechange' | 'negotiationneeded' | 'signalingstatechange' | 'error';
|
|
3
|
-
/**
|
|
4
|
-
* @eventClass
|
|
5
|
-
* This event is fired whenever the RTC_EVENTS has changed except on icecandidate related.
|
|
6
|
-
* @type {RTCIceCandidateEvent} for icecandidate related.
|
|
7
|
-
* @param {RTC_EVENTS} type - The type of event.
|
|
8
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection#events MDN} for details.
|
|
9
|
-
*/
|
|
10
|
-
export default class RTCEvent<TEventType extends RTC_EVENTS> extends Event<TEventType> {
|
|
11
|
-
constructor(type: TEventType, eventInitDict?: Event.EventInit);
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=RTCEvent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RTCEvent.d.ts","sourceRoot":"","sources":["../../src/RTCEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAM1C,KAAK,UAAU,GAAG,uBAAuB,GAAG,0BAA0B,GAAG,yBAAyB,GACjG,mBAAmB,GAAG,sBAAsB,GAAG,OAAO,CAAA;AAEvD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ,CAAC,UAAU,SAAS,UAAU,CAAE,SAAQ,KAAK,CAAC,UAAU,CAAC;gBACtE,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS;CAGhE"}
|
package/src/MediaStreamEvent.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import type MediaStream from './MediaStream';
|
|
3
|
-
|
|
4
|
-
export default class MediaStreamEvent {
|
|
5
|
-
type: string;
|
|
6
|
-
stream: MediaStream;
|
|
7
|
-
constructor(type, eventInitDict: { stream: MediaStream }) {
|
|
8
|
-
this.type = type.toString();
|
|
9
|
-
this.stream = eventInitDict.stream;
|
|
10
|
-
}
|
|
11
|
-
}
|
package/src/RTCEvent.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Event } from 'event-target-shim';
|
|
2
|
-
|
|
3
|
-
// Import for documentation purposes
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
-
import RTCIceCandidateEvent from './RTCIceCandidateEvent';
|
|
6
|
-
|
|
7
|
-
type RTC_EVENTS = 'connectionstatechange' | 'iceconnectionstatechange' | 'icegatheringstatechange' |
|
|
8
|
-
'negotiationneeded' | 'signalingstatechange' | 'error'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @eventClass
|
|
12
|
-
* This event is fired whenever the RTC_EVENTS has changed except on icecandidate related.
|
|
13
|
-
* @type {RTCIceCandidateEvent} for icecandidate related.
|
|
14
|
-
* @param {RTC_EVENTS} type - The type of event.
|
|
15
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection#events MDN} for details.
|
|
16
|
-
*/
|
|
17
|
-
export default class RTCEvent<TEventType extends RTC_EVENTS> extends Event<TEventType> {
|
|
18
|
-
constructor(type: TEventType, eventInitDict?: Event.EventInit) {
|
|
19
|
-
super(type, eventInitDict);
|
|
20
|
-
}
|
|
21
|
-
}
|