react-native-webrtc 111.0.5 → 118.0.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/android/build.gradle +6 -1
- package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +34 -5
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +85 -16
- package/ios/RCTWebRTC/SerializeUtils.h +3 -0
- package/ios/RCTWebRTC/SerializeUtils.m +42 -7
- package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +89 -10
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/Logger.js +8 -2
- package/lib/commonjs/Logger.js.map +1 -1
- package/lib/commonjs/MediaDevices.js +7 -2
- package/lib/commonjs/MediaDevices.js.map +1 -1
- package/lib/commonjs/MediaStream.js +13 -4
- package/lib/commonjs/MediaStream.js.map +1 -1
- package/lib/commonjs/MediaStreamError.js +4 -0
- package/lib/commonjs/MediaStreamError.js.map +1 -1
- package/lib/commonjs/MediaStreamErrorEvent.js +3 -0
- package/lib/commonjs/MediaStreamErrorEvent.js.map +1 -1
- package/lib/commonjs/MediaStreamTrack.js +21 -7
- package/lib/commonjs/MediaStreamTrack.js.map +1 -1
- package/lib/commonjs/MediaStreamTrackEvent.js +2 -0
- package/lib/commonjs/MediaStreamTrackEvent.js.map +1 -1
- package/lib/commonjs/MessageEvent.js +2 -0
- package/lib/commonjs/MessageEvent.js.map +1 -1
- package/lib/commonjs/Permissions.js +10 -9
- package/lib/commonjs/Permissions.js.map +1 -1
- package/lib/commonjs/RTCDataChannel.js +27 -2
- package/lib/commonjs/RTCDataChannel.js.map +1 -1
- package/lib/commonjs/RTCDataChannelEvent.js +2 -0
- package/lib/commonjs/RTCDataChannelEvent.js.map +1 -1
- package/lib/commonjs/RTCErrorEvent.js +3 -0
- package/lib/commonjs/RTCErrorEvent.js.map +1 -1
- package/lib/commonjs/RTCIceCandidate.js +4 -0
- package/lib/commonjs/RTCIceCandidate.js.map +1 -1
- package/lib/commonjs/RTCIceCandidateEvent.js +4 -1
- package/lib/commonjs/RTCIceCandidateEvent.js.map +1 -1
- package/lib/commonjs/RTCPeerConnection.js +59 -15
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCRtcpParameters.js +3 -0
- package/lib/commonjs/RTCRtcpParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpCapabilities.js +4 -52
- package/lib/commonjs/RTCRtpCapabilities.js.map +1 -1
- package/lib/commonjs/RTCRtpCodecCapability.js +2 -0
- package/lib/commonjs/RTCRtpCodecCapability.js.map +1 -1
- package/lib/commonjs/RTCRtpCodecParameters.js +6 -0
- package/lib/commonjs/RTCRtpCodecParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpEncodingParameters.js +11 -4
- package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpHeaderExtension.js +4 -0
- package/lib/commonjs/RTCRtpHeaderExtension.js.map +1 -1
- package/lib/commonjs/RTCRtpParameters.js +4 -2
- package/lib/commonjs/RTCRtpParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpReceiveParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpReceiver.js +6 -9
- package/lib/commonjs/RTCRtpReceiver.js.map +1 -1
- package/lib/commonjs/RTCRtpSendParameters.js +4 -0
- package/lib/commonjs/RTCRtpSendParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpSender.js +6 -9
- package/lib/commonjs/RTCRtpSender.js.map +1 -1
- package/lib/commonjs/RTCRtpTransceiver.js +14 -3
- package/lib/commonjs/RTCRtpTransceiver.js.map +1 -1
- package/lib/commonjs/RTCSessionDescription.js +3 -0
- package/lib/commonjs/RTCSessionDescription.js.map +1 -1
- package/lib/commonjs/RTCTrackEvent.js +5 -1
- package/lib/commonjs/RTCTrackEvent.js.map +1 -1
- package/lib/commonjs/RTCUtil.js.map +1 -1
- package/lib/commonjs/RTCView.js.map +1 -1
- package/lib/commonjs/ScreenCapturePickerView.js.map +1 -1
- package/lib/commonjs/getDisplayMedia.js.map +1 -1
- package/lib/commonjs/getUserMedia.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/Logger.js +8 -2
- package/lib/module/Logger.js.map +1 -1
- package/lib/module/MediaDevices.js +8 -3
- package/lib/module/MediaDevices.js.map +1 -1
- package/lib/module/MediaStream.js +12 -3
- package/lib/module/MediaStream.js.map +1 -1
- package/lib/module/MediaStreamError.js +4 -0
- package/lib/module/MediaStreamError.js.map +1 -1
- package/lib/module/MediaStreamErrorEvent.js +3 -0
- package/lib/module/MediaStreamErrorEvent.js.map +1 -1
- package/lib/module/MediaStreamTrack.js +21 -7
- package/lib/module/MediaStreamTrack.js.map +1 -1
- package/lib/module/MediaStreamTrackEvent.js +2 -0
- package/lib/module/MediaStreamTrackEvent.js.map +1 -1
- package/lib/module/MessageEvent.js +2 -0
- package/lib/module/MessageEvent.js.map +1 -1
- package/lib/module/Permissions.js +10 -9
- package/lib/module/Permissions.js.map +1 -1
- package/lib/module/RTCDataChannel.js +28 -3
- package/lib/module/RTCDataChannel.js.map +1 -1
- package/lib/module/RTCDataChannelEvent.js +2 -0
- package/lib/module/RTCDataChannelEvent.js.map +1 -1
- package/lib/module/RTCErrorEvent.js +3 -0
- package/lib/module/RTCErrorEvent.js.map +1 -1
- package/lib/module/RTCIceCandidate.js +4 -0
- package/lib/module/RTCIceCandidate.js.map +1 -1
- package/lib/module/RTCIceCandidateEvent.js +4 -1
- package/lib/module/RTCIceCandidateEvent.js.map +1 -1
- package/lib/module/RTCPeerConnection.js +60 -16
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCRtcpParameters.js +3 -0
- package/lib/module/RTCRtcpParameters.js.map +1 -1
- package/lib/module/RTCRtpCapabilities.js +3 -47
- package/lib/module/RTCRtpCapabilities.js.map +1 -1
- package/lib/module/RTCRtpCodecCapability.js +2 -0
- package/lib/module/RTCRtpCodecCapability.js.map +1 -1
- package/lib/module/RTCRtpCodecParameters.js +6 -0
- package/lib/module/RTCRtpCodecParameters.js.map +1 -1
- package/lib/module/RTCRtpEncodingParameters.js +11 -4
- package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/module/RTCRtpHeaderExtension.js +4 -0
- package/lib/module/RTCRtpHeaderExtension.js.map +1 -1
- package/lib/module/RTCRtpParameters.js +4 -2
- package/lib/module/RTCRtpParameters.js.map +1 -1
- package/lib/module/RTCRtpReceiveParameters.js.map +1 -1
- package/lib/module/RTCRtpReceiver.js +6 -9
- package/lib/module/RTCRtpReceiver.js.map +1 -1
- package/lib/module/RTCRtpSendParameters.js +4 -0
- package/lib/module/RTCRtpSendParameters.js.map +1 -1
- package/lib/module/RTCRtpSender.js +6 -9
- package/lib/module/RTCRtpSender.js.map +1 -1
- package/lib/module/RTCRtpTransceiver.js +14 -3
- package/lib/module/RTCRtpTransceiver.js.map +1 -1
- package/lib/module/RTCSessionDescription.js +3 -0
- package/lib/module/RTCSessionDescription.js.map +1 -1
- package/lib/module/RTCTrackEvent.js +5 -1
- package/lib/module/RTCTrackEvent.js.map +1 -1
- package/lib/module/RTCUtil.js.map +1 -1
- package/lib/module/RTCView.js.map +1 -1
- package/lib/module/ScreenCapturePickerView.js.map +1 -1
- package/lib/module/getDisplayMedia.js.map +1 -1
- package/lib/module/getUserMedia.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/EventEmitter.d.ts +2 -3
- package/lib/typescript/Logger.d.ts +0 -1
- package/lib/typescript/MediaDevices.d.ts +5 -4
- package/lib/typescript/MediaStream.d.ts +4 -7
- package/lib/typescript/MediaStreamError.d.ts +0 -1
- package/lib/typescript/MediaStreamErrorEvent.d.ts +0 -1
- package/lib/typescript/MediaStreamTrack.d.ts +20 -7
- package/lib/typescript/MediaStreamTrackEvent.d.ts +1 -2
- package/lib/typescript/MessageEvent.d.ts +2 -3
- package/lib/typescript/Permissions.d.ts +1 -2
- package/lib/typescript/RTCDataChannel.d.ts +2 -3
- package/lib/typescript/RTCDataChannelEvent.d.ts +1 -2
- package/lib/typescript/RTCErrorEvent.d.ts +1 -2
- package/lib/typescript/RTCIceCandidate.d.ts +0 -1
- package/lib/typescript/RTCIceCandidateEvent.d.ts +1 -2
- package/lib/typescript/RTCPeerConnection.d.ts +27 -16
- package/lib/typescript/RTCRtcpParameters.d.ts +0 -1
- package/lib/typescript/RTCRtpCapabilities.d.ts +1 -12
- package/lib/typescript/RTCRtpCodecCapability.d.ts +0 -1
- package/lib/typescript/RTCRtpCodecParameters.d.ts +0 -1
- package/lib/typescript/RTCRtpEncodingParameters.d.ts +0 -1
- package/lib/typescript/RTCRtpHeaderExtension.d.ts +0 -1
- package/lib/typescript/RTCRtpParameters.d.ts +0 -1
- package/lib/typescript/RTCRtpReceiveParameters.d.ts +0 -1
- package/lib/typescript/RTCRtpReceiver.d.ts +0 -1
- package/lib/typescript/RTCRtpSendParameters.d.ts +1 -2
- package/lib/typescript/RTCRtpSender.d.ts +0 -1
- package/lib/typescript/RTCRtpTransceiver.d.ts +2 -1
- package/lib/typescript/RTCSessionDescription.d.ts +0 -1
- package/lib/typescript/RTCTrackEvent.d.ts +1 -2
- package/lib/typescript/RTCUtil.d.ts +0 -1
- package/lib/typescript/RTCView.d.ts +1 -2
- package/lib/typescript/ScreenCapturePickerView.d.ts +0 -1
- package/lib/typescript/getDisplayMedia.d.ts +0 -1
- package/lib/typescript/getUserMedia.d.ts +0 -1
- package/lib/typescript/index.d.ts +0 -1
- package/package.json +1 -1
- package/react-native-webrtc.podspec +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 +71 -16
- package/src/RTCRtpCapabilities.ts +1 -50
- package/src/RTCRtpReceiver.ts +2 -10
- package/src/RTCRtpSender.ts +2 -10
- package/src/RTCRtpTransceiver.ts +9 -0
- package/src/RTCView.ts +1 -1
- 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/EventEmitter.d.ts.map +0 -1
- package/lib/typescript/Logger.d.ts.map +0 -1
- package/lib/typescript/MediaDevices.d.ts.map +0 -1
- package/lib/typescript/MediaStream.d.ts.map +0 -1
- package/lib/typescript/MediaStreamError.d.ts.map +0 -1
- package/lib/typescript/MediaStreamErrorEvent.d.ts.map +0 -1
- package/lib/typescript/MediaStreamEvent.d.ts +0 -9
- package/lib/typescript/MediaStreamEvent.d.ts.map +0 -1
- package/lib/typescript/MediaStreamTrack.d.ts.map +0 -1
- package/lib/typescript/MediaStreamTrackEvent.d.ts.map +0 -1
- package/lib/typescript/MessageEvent.d.ts.map +0 -1
- package/lib/typescript/Permissions.d.ts.map +0 -1
- package/lib/typescript/RTCDataChannel.d.ts.map +0 -1
- package/lib/typescript/RTCDataChannelEvent.d.ts.map +0 -1
- package/lib/typescript/RTCErrorEvent.d.ts.map +0 -1
- package/lib/typescript/RTCEvent.d.ts +0 -14
- package/lib/typescript/RTCEvent.d.ts.map +0 -1
- package/lib/typescript/RTCIceCandidate.d.ts.map +0 -1
- package/lib/typescript/RTCIceCandidateEvent.d.ts.map +0 -1
- package/lib/typescript/RTCPeerConnection.d.ts.map +0 -1
- package/lib/typescript/RTCRtcpParameters.d.ts.map +0 -1
- package/lib/typescript/RTCRtpCapabilities.d.ts.map +0 -1
- package/lib/typescript/RTCRtpCodecCapability.d.ts.map +0 -1
- package/lib/typescript/RTCRtpCodecParameters.d.ts.map +0 -1
- package/lib/typescript/RTCRtpEncodingParameters.d.ts.map +0 -1
- package/lib/typescript/RTCRtpHeaderExtension.d.ts.map +0 -1
- package/lib/typescript/RTCRtpParameters.d.ts.map +0 -1
- package/lib/typescript/RTCRtpReceiveParameters.d.ts.map +0 -1
- package/lib/typescript/RTCRtpReceiver.d.ts.map +0 -1
- package/lib/typescript/RTCRtpSendParameters.d.ts.map +0 -1
- package/lib/typescript/RTCRtpSender.d.ts.map +0 -1
- package/lib/typescript/RTCRtpTransceiver.d.ts.map +0 -1
- package/lib/typescript/RTCSessionDescription.d.ts.map +0 -1
- package/lib/typescript/RTCTrackEvent.d.ts.map +0 -1
- package/lib/typescript/RTCUtil.d.ts.map +0 -1
- package/lib/typescript/RTCView.d.ts.map +0 -1
- package/lib/typescript/ScreenCapturePickerView.d.ts.map +0 -1
- package/lib/typescript/getDisplayMedia.d.ts.map +0 -1
- package/lib/typescript/getUserMedia.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/src/MediaStreamEvent.ts +0 -11
- package/src/RTCEvent.ts +0 -21
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import RTCRtpCodecCapability from './RTCRtpCodecCapability';
|
|
1
2
|
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
2
3
|
import RTCRtpSender from './RTCRtpSender';
|
|
3
4
|
export default class RTCRtpTransceiver {
|
|
@@ -25,6 +26,6 @@ export default class RTCRtpTransceiver {
|
|
|
25
26
|
get sender(): RTCRtpSender;
|
|
26
27
|
get receiver(): RTCRtpReceiver;
|
|
27
28
|
stop(): void;
|
|
29
|
+
setCodecPreferences(codecs: RTCRtpCodecCapability[]): void;
|
|
28
30
|
_setStopped(): void;
|
|
29
31
|
}
|
|
30
|
-
//# sourceMappingURL=RTCRtpTransceiver.d.ts.map
|
|
@@ -3,7 +3,7 @@ import MediaStream from './MediaStream';
|
|
|
3
3
|
import type MediaStreamTrack from './MediaStreamTrack';
|
|
4
4
|
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
5
5
|
import RTCRtpTransceiver from './RTCRtpTransceiver';
|
|
6
|
-
type TRACK_EVENTS = 'track';
|
|
6
|
+
declare type TRACK_EVENTS = 'track';
|
|
7
7
|
interface IRTCTrackEventInitDict extends Event.EventInit {
|
|
8
8
|
streams: MediaStream[];
|
|
9
9
|
transceiver: RTCRtpTransceiver;
|
|
@@ -27,4 +27,3 @@ export default class RTCTrackEvent<TEventType extends TRACK_EVENTS> extends Even
|
|
|
27
27
|
constructor(type: TEventType, eventInitDict: IRTCTrackEventInitDict);
|
|
28
28
|
}
|
|
29
29
|
export {};
|
|
30
|
-
//# sourceMappingURL=RTCTrackEvent.d.ts.map
|
|
@@ -28,7 +28,7 @@ interface RTCVideoViewProps extends ViewProps {
|
|
|
28
28
|
*
|
|
29
29
|
* streamURL: string
|
|
30
30
|
*/
|
|
31
|
-
streamURL
|
|
31
|
+
streamURL?: string;
|
|
32
32
|
/**
|
|
33
33
|
* Similarly to the CSS property z-index, specifies the z-order of this
|
|
34
34
|
* RTCView in the stacking space of all RTCViews. When RTCViews overlap,
|
|
@@ -58,4 +58,3 @@ interface RTCVideoViewProps extends ViewProps {
|
|
|
58
58
|
}
|
|
59
59
|
declare const _default: import("react-native").HostComponent<RTCVideoViewProps>;
|
|
60
60
|
export default _default;
|
|
61
|
-
//# sourceMappingURL=RTCView.d.ts.map
|
|
@@ -13,4 +13,3 @@ import RTCView from './RTCView';
|
|
|
13
13
|
import ScreenCapturePickerView from './ScreenCapturePickerView';
|
|
14
14
|
export { RTCIceCandidate, RTCPeerConnection, RTCSessionDescription, RTCView, ScreenCapturePickerView, RTCRtpTransceiver, RTCRtpReceiver, RTCRtpSender, RTCErrorEvent, MediaStream, MediaStreamTrack, mediaDevices, permissions, registerGlobals };
|
|
15
15
|
declare function registerGlobals(): void;
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -19,5 +19,5 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
s.libraries = 'c', 'sqlite3', 'stdc++'
|
|
20
20
|
s.framework = 'AudioToolbox','AVFoundation', 'CoreAudio', 'CoreGraphics', 'CoreVideo', 'GLKit', 'VideoToolbox'
|
|
21
21
|
s.dependency 'React-Core'
|
|
22
|
-
s.dependency 'JitsiWebRTC', '~>
|
|
22
|
+
s.dependency 'JitsiWebRTC', '~> 118.0.0'
|
|
23
23
|
end
|
package/src/MediaDevices.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineCustomEventTarget } 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 getDisplayMedia from './getDisplayMedia';
|
|
@@ -7,9 +6,11 @@ import getUserMedia from './getUserMedia';
|
|
|
7
6
|
|
|
8
7
|
const { WebRTCModule } = NativeModules;
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
type MediaDevicesEventMap = {
|
|
10
|
+
devicechange: Event<'devicechange'>
|
|
11
|
+
}
|
|
11
12
|
|
|
12
|
-
class MediaDevices extends
|
|
13
|
+
class MediaDevices extends EventTarget<MediaDevicesEventMap> {
|
|
13
14
|
/**
|
|
14
15
|
* W3C "Media Capture and Streams" compatible {@code enumerateDevices}
|
|
15
16
|
* implementation.
|
|
@@ -41,4 +42,12 @@ class MediaDevices extends defineCustomEventTarget(...MEDIA_DEVICES_EVENTS) {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Define the `onxxx` event handlers.
|
|
47
|
+
*/
|
|
48
|
+
const proto = MediaDevices.prototype;
|
|
49
|
+
|
|
50
|
+
defineEventAttribute(proto, 'devicechange');
|
|
51
|
+
|
|
52
|
+
|
|
44
53
|
export default new MediaDevices();
|
package/src/MediaStream.ts
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import EventTarget from 'event-target-shim';
|
|
1
|
+
import { EventTarget, defineEventAttribute } from 'event-target-shim';
|
|
3
2
|
import { NativeModules } from 'react-native';
|
|
4
3
|
|
|
5
|
-
import MediaStreamTrack from './MediaStreamTrack';
|
|
4
|
+
import MediaStreamTrack, { MediaStreamTrackInfo } from './MediaStreamTrack';
|
|
6
5
|
import MediaStreamTrackEvent from './MediaStreamTrackEvent';
|
|
7
6
|
import { uniqueID } from './RTCUtil';
|
|
8
7
|
|
|
9
8
|
const { WebRTCModule } = NativeModules;
|
|
10
9
|
|
|
11
10
|
type MediaStreamEventMap = {
|
|
12
|
-
active: MediaStreamTrackEvent<'active'>
|
|
13
|
-
inactive: MediaStreamTrackEvent<'inactive'>
|
|
14
11
|
addtrack: MediaStreamTrackEvent<'addtrack'>
|
|
15
12
|
removetrack: MediaStreamTrackEvent<'removetrack'>
|
|
16
|
-
|
|
13
|
+
}
|
|
17
14
|
|
|
18
15
|
export default class MediaStream extends EventTarget<MediaStreamEventMap> {
|
|
19
16
|
_tracks: MediaStreamTrack[] = [];
|
|
20
|
-
|
|
21
17
|
_id: string;
|
|
22
18
|
|
|
23
19
|
/**
|
|
@@ -44,7 +40,7 @@ export default class MediaStream extends EventTarget<MediaStreamEventMap> {
|
|
|
44
40
|
constructor(arg?:
|
|
45
41
|
MediaStream |
|
|
46
42
|
MediaStreamTrack[] |
|
|
47
|
-
{ streamId: string, streamReactTag: string, tracks:
|
|
43
|
+
{ streamId: string, streamReactTag: string, tracks: MediaStreamTrackInfo[] }
|
|
48
44
|
) {
|
|
49
45
|
super();
|
|
50
46
|
|
|
@@ -155,3 +151,11 @@ export default class MediaStream extends EventTarget<MediaStreamEventMap> {
|
|
|
155
151
|
WebRTCModule.mediaStreamRelease(this._reactTag);
|
|
156
152
|
}
|
|
157
153
|
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Define the `onxxx` event handlers.
|
|
157
|
+
*/
|
|
158
|
+
const proto = MediaStream.prototype;
|
|
159
|
+
|
|
160
|
+
defineEventAttribute(proto, 'addtrack');
|
|
161
|
+
defineEventAttribute(proto, 'removetrack');
|
package/src/MediaStreamTrack.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineCustomEventTarget, Event } 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,11 +8,27 @@ import { deepClone } from './RTCUtil';
|
|
|
9
8
|
const log = new Logger('pc');
|
|
10
9
|
const { WebRTCModule } = NativeModules;
|
|
11
10
|
|
|
12
|
-
const MEDIA_STREAM_TRACK_EVENTS = [ 'ended', 'mute', 'unmute' ];
|
|
13
11
|
|
|
14
12
|
type MediaStreamTrackState = 'live' | 'ended';
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
export type MediaStreamTrackInfo = {
|
|
15
|
+
id: string;
|
|
16
|
+
kind: string;
|
|
17
|
+
remote: boolean;
|
|
18
|
+
constraints: object;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
settings: object;
|
|
21
|
+
peerConnectionId: number;
|
|
22
|
+
readyState: MediaStreamTrackState;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type MediaStreamTrackEventMap = {
|
|
26
|
+
ended: Event<'ended'>;
|
|
27
|
+
mute: Event<'mute'>;
|
|
28
|
+
unmute: Event<'unmute'>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventMap> {
|
|
17
32
|
_constraints: object;
|
|
18
33
|
_enabled: boolean;
|
|
19
34
|
_settings: object;
|
|
@@ -26,7 +41,7 @@ class MediaStreamTrack extends defineCustomEventTarget(...MEDIA_STREAM_TRACK_EVE
|
|
|
26
41
|
readonly label: string = '';
|
|
27
42
|
readonly remote: boolean;
|
|
28
43
|
|
|
29
|
-
constructor(info) {
|
|
44
|
+
constructor(info: MediaStreamTrackInfo) {
|
|
30
45
|
super();
|
|
31
46
|
|
|
32
47
|
this._constraints = info.constraints || {};
|
|
@@ -164,7 +179,6 @@ class MediaStreamTrack extends defineCustomEventTarget(...MEDIA_STREAM_TRACK_EVE
|
|
|
164
179
|
log.debug(`${this.id} mediaStreamTrackEnded`);
|
|
165
180
|
this._readyState = 'ended';
|
|
166
181
|
|
|
167
|
-
// @ts-ignore
|
|
168
182
|
this.dispatchEvent(new Event('ended'));
|
|
169
183
|
});
|
|
170
184
|
}
|
|
@@ -179,4 +193,11 @@ class MediaStreamTrack extends defineCustomEventTarget(...MEDIA_STREAM_TRACK_EVE
|
|
|
179
193
|
}
|
|
180
194
|
}
|
|
181
195
|
|
|
182
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Define the `onxxx` event handlers.
|
|
198
|
+
*/
|
|
199
|
+
const proto = MediaStreamTrack.prototype;
|
|
200
|
+
|
|
201
|
+
defineEventAttribute(proto, 'ended');
|
|
202
|
+
defineEventAttribute(proto, 'mute');
|
|
203
|
+
defineEventAttribute(proto, 'unmute');
|
|
@@ -2,7 +2,7 @@ import { Event } from 'event-target-shim';
|
|
|
2
2
|
|
|
3
3
|
import type MediaStreamTrack from './MediaStreamTrack';
|
|
4
4
|
|
|
5
|
-
type MEDIA_STREAM_EVENTS =
|
|
5
|
+
type MEDIA_STREAM_EVENTS = 'addtrack'| 'removetrack'
|
|
6
6
|
|
|
7
7
|
interface IMediaStreamTrackEventInitDict extends Event.EventInit {
|
|
8
8
|
track: MediaStreamTrack;
|
package/src/RTCDataChannel.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
import * as base64 from 'base64-js';
|
|
3
|
-
import { EventTarget } from 'event-target-shim';
|
|
2
|
+
import { EventTarget, defineEventAttribute } from 'event-target-shim';
|
|
4
3
|
import { NativeModules } from 'react-native';
|
|
5
4
|
|
|
6
5
|
import { addListener, removeListener } from './EventEmitter';
|
|
@@ -177,3 +176,15 @@ export default class RTCDataChannel extends EventTarget<DataChannelEventMap> {
|
|
|
177
176
|
});
|
|
178
177
|
}
|
|
179
178
|
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Define the `onxxx` event handlers.
|
|
182
|
+
*/
|
|
183
|
+
const proto = RTCDataChannel.prototype;
|
|
184
|
+
|
|
185
|
+
defineEventAttribute(proto, 'bufferedamountlow');
|
|
186
|
+
defineEventAttribute(proto, 'close');
|
|
187
|
+
defineEventAttribute(proto, 'closing');
|
|
188
|
+
defineEventAttribute(proto, 'error');
|
|
189
|
+
defineEventAttribute(proto, 'message');
|
|
190
|
+
defineEventAttribute(proto, 'open');
|
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';
|
|
@@ -47,18 +45,33 @@ type RTCDataChannelInit = {
|
|
|
47
45
|
id?: number
|
|
48
46
|
};
|
|
49
47
|
|
|
48
|
+
type RTCIceServer = {
|
|
49
|
+
credential?: string,
|
|
50
|
+
url?: string, // Deprecated.
|
|
51
|
+
urls?: string | string[],
|
|
52
|
+
username?: string
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
type RTCConfiguration = {
|
|
56
|
+
bundlePolicy?: 'balanced' | 'max-compat' | 'max-bundle',
|
|
57
|
+
iceCandidatePoolSize?: number,
|
|
58
|
+
iceServers?: RTCIceServer[],
|
|
59
|
+
iceTransportPolicy?: 'all' | 'relay',
|
|
60
|
+
rtcpMuxPolicy?: 'negotiate' | 'require'
|
|
61
|
+
};
|
|
62
|
+
|
|
50
63
|
type RTCPeerConnectionEventMap = {
|
|
51
|
-
connectionstatechange:
|
|
64
|
+
connectionstatechange: Event<'connectionstatechange'>
|
|
52
65
|
icecandidate: RTCIceCandidateEvent<'icecandidate'>
|
|
53
66
|
icecandidateerror: RTCIceCandidateEvent<'icecandidateerror'>
|
|
54
|
-
iceconnectionstatechange:
|
|
55
|
-
icegatheringstatechange:
|
|
56
|
-
negotiationneeded:
|
|
57
|
-
signalingstatechange:
|
|
67
|
+
iceconnectionstatechange: Event<'iceconnectionstatechange'>
|
|
68
|
+
icegatheringstatechange: Event<'icegatheringstatechange'>
|
|
69
|
+
negotiationneeded: Event<'negotiationneeded'>
|
|
70
|
+
signalingstatechange: Event<'signalingstatechange'>
|
|
58
71
|
datachannel: RTCDataChannelEvent<'datachannel'>
|
|
59
72
|
track: RTCTrackEvent<'track'>
|
|
60
|
-
error:
|
|
61
|
-
|
|
73
|
+
error: Event<'error'>
|
|
74
|
+
}
|
|
62
75
|
|
|
63
76
|
let nextPeerConnectionId = 0;
|
|
64
77
|
|
|
@@ -75,11 +88,37 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
75
88
|
_remoteStreams: Map<string, MediaStream>;
|
|
76
89
|
_pendingTrackEvents: any[];
|
|
77
90
|
|
|
78
|
-
constructor(configuration) {
|
|
91
|
+
constructor(configuration?: RTCConfiguration) {
|
|
79
92
|
super();
|
|
80
93
|
|
|
81
94
|
this._pcId = nextPeerConnectionId++;
|
|
82
95
|
|
|
96
|
+
// Sanitize ICE servers.
|
|
97
|
+
if (configuration) {
|
|
98
|
+
const servers = configuration?.iceServers ?? [];
|
|
99
|
+
|
|
100
|
+
for (const server of servers) {
|
|
101
|
+
let urls = server.url || server.urls;
|
|
102
|
+
|
|
103
|
+
delete server.url;
|
|
104
|
+
delete server.urls;
|
|
105
|
+
|
|
106
|
+
if (!urls) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (!Array.isArray(urls)) {
|
|
111
|
+
urls = [ urls ];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Native WebRTC does case sensitive parsing.
|
|
115
|
+
server.urls = urls.map(url => url.toLowerCase());
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Filter out bogus servers.
|
|
119
|
+
configuration.iceServers = servers.filter(s => s.urls);
|
|
120
|
+
}
|
|
121
|
+
|
|
83
122
|
if (!WebRTCModule.peerConnectionInit(configuration, this._pcId)) {
|
|
84
123
|
throw new Error('Failed to initialize PeerConnection, check the native logs!');
|
|
85
124
|
}
|
|
@@ -531,7 +570,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
531
570
|
return;
|
|
532
571
|
}
|
|
533
572
|
|
|
534
|
-
this.dispatchEvent(new
|
|
573
|
+
this.dispatchEvent(new Event('negotiationneeded'));
|
|
535
574
|
});
|
|
536
575
|
|
|
537
576
|
addListener(this, 'peerConnectionIceConnectionChanged', (ev: any) => {
|
|
@@ -541,7 +580,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
541
580
|
|
|
542
581
|
this.iceConnectionState = ev.iceConnectionState;
|
|
543
582
|
|
|
544
|
-
this.dispatchEvent(new
|
|
583
|
+
this.dispatchEvent(new Event('iceconnectionstatechange'));
|
|
545
584
|
});
|
|
546
585
|
|
|
547
586
|
addListener(this, 'peerConnectionStateChanged', (ev: any) => {
|
|
@@ -551,7 +590,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
551
590
|
|
|
552
591
|
this.connectionState = ev.connectionState;
|
|
553
592
|
|
|
554
|
-
this.dispatchEvent(new
|
|
593
|
+
this.dispatchEvent(new Event('connectionstatechange'));
|
|
555
594
|
|
|
556
595
|
if (ev.connectionState === 'closed') {
|
|
557
596
|
// This PeerConnection is done, clean up.
|
|
@@ -568,7 +607,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
568
607
|
|
|
569
608
|
this.signalingState = ev.signalingState;
|
|
570
609
|
|
|
571
|
-
this.dispatchEvent(new
|
|
610
|
+
this.dispatchEvent(new Event('signalingstatechange'));
|
|
572
611
|
});
|
|
573
612
|
|
|
574
613
|
// Consider moving away from this event: https://github.com/WebKit/WebKit/pull/3953
|
|
@@ -657,7 +696,7 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
657
696
|
this.dispatchEvent(new RTCIceCandidateEvent('icecandidate', { candidate: null }));
|
|
658
697
|
}
|
|
659
698
|
|
|
660
|
-
this.dispatchEvent(new
|
|
699
|
+
this.dispatchEvent(new Event('icegatheringstatechange'));
|
|
661
700
|
});
|
|
662
701
|
|
|
663
702
|
addListener(this, 'peerConnectionDidOpenDataChannel', (ev: any) => {
|
|
@@ -769,3 +808,19 @@ export default class RTCPeerConnection extends EventTarget<RTCPeerConnectionEven
|
|
|
769
808
|
this._transceivers.sort((a, b) => a.order - b.order);
|
|
770
809
|
}
|
|
771
810
|
}
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Define the `onxxx` event handlers.
|
|
814
|
+
*/
|
|
815
|
+
const proto = RTCPeerConnection.prototype;
|
|
816
|
+
|
|
817
|
+
defineEventAttribute(proto, 'connectionstatechange');
|
|
818
|
+
defineEventAttribute(proto, 'icecandidate');
|
|
819
|
+
defineEventAttribute(proto, 'icecandidateerror');
|
|
820
|
+
defineEventAttribute(proto, 'iceconnectionstatechange');
|
|
821
|
+
defineEventAttribute(proto, 'icegatheringstatechange');
|
|
822
|
+
defineEventAttribute(proto, 'negotiationneeded');
|
|
823
|
+
defineEventAttribute(proto, 'signalingstatechange');
|
|
824
|
+
defineEventAttribute(proto, 'datachannel');
|
|
825
|
+
defineEventAttribute(proto, 'track');
|
|
826
|
+
defineEventAttribute(proto, 'error');
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { NativeModules } from 'react-native';
|
|
2
|
-
|
|
3
1
|
import RTCRtpCodecCapability from './RTCRtpCodecCapability';
|
|
4
|
-
const { WebRTCModule } = NativeModules;
|
|
5
2
|
|
|
6
3
|
/**
|
|
7
|
-
* @brief represents codec capabilities for senders and receivers.
|
|
8
|
-
* this only supports codec names and does not have other
|
|
9
|
-
* fields like clockRate and numChannels and such.
|
|
4
|
+
* @brief represents codec capabilities for senders and receivers.
|
|
10
5
|
*/
|
|
11
6
|
export default class RTCRtpCapabilities {
|
|
12
7
|
_codecs: RTCRtpCodecCapability[] = [];
|
|
@@ -19,47 +14,3 @@ export default class RTCRtpCapabilities {
|
|
|
19
14
|
return this._codecs;
|
|
20
15
|
}
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function getCapabilities(endpoint: 'sender' | 'receiver'): RTCRtpCapabilities | null {
|
|
25
|
-
switch (endpoint) {
|
|
26
|
-
case 'sender': {
|
|
27
|
-
const capabilities = WebRTCModule.senderGetCapabilities();
|
|
28
|
-
|
|
29
|
-
if (!capabilities) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return new RTCRtpCapabilities(capabilities.codecs);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
case 'receiver': {
|
|
37
|
-
const capabilities = WebRTCModule.receiverGetCapabilities();
|
|
38
|
-
|
|
39
|
-
if (!capabilities) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return new RTCRtpCapabilities(capabilities.codecs);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
default:
|
|
47
|
-
throw new TypeError('Invalid endpoint: ' + endpoint);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Hardcoded audio capabilities based on the WebRTC native documentation:
|
|
54
|
-
* https://webrtc.github.io/webrtc-org/faq/. The mime type is specified in
|
|
55
|
-
* https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2.
|
|
56
|
-
*/
|
|
57
|
-
export const DEFAULT_AUDIO_CAPABILITIES = new RTCRtpCapabilities([
|
|
58
|
-
new RTCRtpCodecCapability({ mimeType: 'audio/G722' }),
|
|
59
|
-
new RTCRtpCodecCapability({ mimeType: 'audio/iLBC' }),
|
|
60
|
-
]);
|
|
61
|
-
|
|
62
|
-
// Initialize capabilities on module import
|
|
63
|
-
export const senderCapabilities = getCapabilities('sender');
|
|
64
|
-
export const receiverCapabilities = getCapabilities('receiver');
|
|
65
|
-
|
package/src/RTCRtpReceiver.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import MediaStreamTrack from './MediaStreamTrack';
|
|
4
|
-
import RTCRtpCapabilities
|
|
4
|
+
import RTCRtpCapabilities from './RTCRtpCapabilities';
|
|
5
5
|
import { RTCRtpParametersInit } from './RTCRtpParameters';
|
|
6
6
|
import RTCRtpReceiveParameters from './RTCRtpReceiveParameters';
|
|
7
7
|
|
|
@@ -29,15 +29,7 @@ export default class RTCRtpReceiver {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
static getCapabilities(kind: 'audio' | 'video'): RTCRtpCapabilities {
|
|
32
|
-
|
|
33
|
-
return DEFAULT_AUDIO_CAPABILITIES;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (!receiverCapabilities) {
|
|
37
|
-
throw new Error('Receiver Capabilities is null');
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return receiverCapabilities;
|
|
32
|
+
return WebRTCModule.receiverGetCapabilities(kind);
|
|
41
33
|
}
|
|
42
34
|
|
|
43
35
|
getStats() {
|
package/src/RTCRtpSender.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import MediaStreamTrack from './MediaStreamTrack';
|
|
4
|
-
import RTCRtpCapabilities
|
|
4
|
+
import RTCRtpCapabilities from './RTCRtpCapabilities';
|
|
5
5
|
import RTCRtpSendParameters, { RTCRtpSendParametersInit } from './RTCRtpSendParameters';
|
|
6
6
|
|
|
7
7
|
const { WebRTCModule } = NativeModules;
|
|
@@ -39,15 +39,7 @@ export default class RTCRtpSender {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
static getCapabilities(kind: 'audio' | 'video'): RTCRtpCapabilities {
|
|
42
|
-
|
|
43
|
-
return DEFAULT_AUDIO_CAPABILITIES;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (!senderCapabilities) {
|
|
47
|
-
throw new Error('sender Capabilities are null');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return senderCapabilities;
|
|
42
|
+
return WebRTCModule.senderGetCapabilities(kind);
|
|
51
43
|
}
|
|
52
44
|
|
|
53
45
|
getParameters(): RTCRtpSendParameters {
|
package/src/RTCRtpTransceiver.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
|
|
3
|
+
import RTCRtpCodecCapability from './RTCRtpCodecCapability';
|
|
3
4
|
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
4
5
|
import RTCRtpSender from './RTCRtpSender';
|
|
5
6
|
|
|
@@ -89,6 +90,14 @@ export default class RTCRtpTransceiver {
|
|
|
89
90
|
.then(() => this._setStopped());
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
setCodecPreferences(codecs: RTCRtpCodecCapability[]) {
|
|
94
|
+
WebRTCModule.transceiverSetCodecPreferences(
|
|
95
|
+
this._peerConnectionId,
|
|
96
|
+
this.sender.id,
|
|
97
|
+
codecs
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
_setStopped() {
|
|
93
102
|
this._stopped = true;
|
|
94
103
|
this._direction = 'stopped';
|
package/src/RTCView.ts
CHANGED
|
@@ -32,7 +32,7 @@ interface RTCVideoViewProps extends ViewProps {
|
|
|
32
32
|
*
|
|
33
33
|
* streamURL: string
|
|
34
34
|
*/
|
|
35
|
-
streamURL
|
|
35
|
+
streamURL?: string;
|
|
36
36
|
/**
|
|
37
37
|
* Similarly to the CSS property z-index, specifies the z-order of this
|
|
38
38
|
* RTCView in the stacking space of all RTCViews. When RTCViews overlap,
|
|
@@ -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"}
|