react-native-webrtc 124.0.4 → 124.0.5
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 +2 -1
- package/android/consumer-rules.pro +2 -0
- package/android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java +29 -3
- package/android/src/main/java/com/oney/WebRTCModule/CameraCaptureController.java +181 -72
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +22 -7
- package/android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java +5 -0
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +4 -2
- package/ios/RCTWebRTC/CaptureController.h +3 -0
- package/ios/RCTWebRTC/CaptureController.m +13 -0
- package/ios/RCTWebRTC/I420Converter.h +21 -0
- package/ios/RCTWebRTC/I420Converter.m +156 -0
- package/ios/RCTWebRTC/PIPController.h +24 -0
- package/ios/RCTWebRTC/PIPController.m +242 -0
- package/ios/RCTWebRTC/RTCVideoViewManager.h +23 -0
- package/ios/RCTWebRTC/RTCVideoViewManager.m +105 -23
- package/ios/RCTWebRTC/SampleBufferVideoCallView.h +12 -0
- package/ios/RCTWebRTC/SampleBufferVideoCallView.m +180 -0
- package/ios/RCTWebRTC/ScreenCaptureController.m +8 -0
- package/ios/RCTWebRTC/VideoCaptureController.h +2 -0
- package/ios/RCTWebRTC/VideoCaptureController.m +96 -30
- package/ios/RCTWebRTC/WebRTCModule+RTCAudioSession.m +20 -0
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m +40 -14
- package/ios/RCTWebRTC/WebRTCModuleOptions.h +1 -0
- package/ios/RCTWebRTC.xcodeproj/project.pbxproj +4 -0
- package/lib/commonjs/Constraints.js +2 -0
- package/lib/commonjs/Constraints.js.map +1 -0
- package/lib/commonjs/MediaDevices.js.map +1 -1
- package/lib/commonjs/MediaStreamTrack.js +26 -3
- package/lib/commonjs/MediaStreamTrack.js.map +1 -1
- package/lib/commonjs/RTCAudioSession.js +33 -0
- package/lib/commonjs/RTCAudioSession.js.map +1 -0
- package/lib/commonjs/RTCPIPView.js +42 -0
- package/lib/commonjs/RTCPIPView.js.map +1 -0
- package/lib/commonjs/RTCView.js.map +1 -1
- package/lib/commonjs/getUserMedia.js.map +1 -1
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Constraints.js +2 -0
- package/lib/module/Constraints.js.map +1 -0
- package/lib/module/MediaDevices.js.map +1 -1
- package/lib/module/MediaStreamTrack.js +27 -4
- package/lib/module/MediaStreamTrack.js.map +1 -1
- package/lib/module/RTCAudioSession.js +26 -0
- package/lib/module/RTCAudioSession.js.map +1 -0
- package/lib/module/RTCPIPView.js +30 -0
- package/lib/module/RTCPIPView.js.map +1 -0
- package/lib/module/RTCView.js.map +1 -1
- package/lib/module/getUserMedia.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/Constraints.d.ts +19 -0
- package/lib/typescript/MediaDevices.d.ts +2 -1
- package/lib/typescript/MediaStreamTrack.d.ts +26 -5
- package/lib/typescript/RTCAudioSession.d.ts +10 -0
- package/lib/typescript/RTCPIPView.d.ts +14 -0
- package/lib/typescript/RTCView.d.ts +44 -1
- package/lib/typescript/getUserMedia.d.ts +4 -4
- package/lib/typescript/index.d.ts +5 -3
- package/package.json +2 -1
- package/src/.eslintrc.cjs +1 -1
- package/src/Constraints.ts +21 -0
- package/src/MediaDevices.ts +2 -2
- package/src/MediaStreamTrack.ts +41 -7
- package/src/RTCAudioSession.ts +25 -0
- package/src/RTCPIPView.tsx +46 -0
- package/src/RTCView.ts +50 -2
- package/src/getUserMedia.ts +4 -3
- package/src/index.ts +12 -3
- package/tsconfig.json +3 -1
- package/ios/RCTWebRTC.xcodeproj/xcuserdata/saghul.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/RCTWebRTC.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
package/lib/module/index.js
CHANGED
|
@@ -12,8 +12,10 @@ import MediaStream from './MediaStream';
|
|
|
12
12
|
import MediaStreamTrack from './MediaStreamTrack';
|
|
13
13
|
import MediaStreamTrackEvent from './MediaStreamTrackEvent';
|
|
14
14
|
import permissions from './Permissions';
|
|
15
|
+
import RTCAudioSession from './RTCAudioSession';
|
|
15
16
|
import RTCErrorEvent from './RTCErrorEvent';
|
|
16
17
|
import RTCIceCandidate from './RTCIceCandidate';
|
|
18
|
+
import RTCPIPView, { startIOSPIP, stopIOSPIP } from './RTCPIPView';
|
|
17
19
|
import RTCPeerConnection from './RTCPeerConnection';
|
|
18
20
|
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
19
21
|
import RTCRtpSender from './RTCRtpSender';
|
|
@@ -25,7 +27,7 @@ Logger.enable(`${Logger.ROOT_PREFIX}:*`);
|
|
|
25
27
|
|
|
26
28
|
// Add listeners for the native events early, since they are added asynchronously.
|
|
27
29
|
setupNativeEvents();
|
|
28
|
-
export { RTCIceCandidate, RTCPeerConnection, RTCSessionDescription, RTCView, ScreenCapturePickerView, RTCRtpTransceiver, RTCRtpReceiver, RTCRtpSender, RTCErrorEvent, MediaStream, MediaStreamTrack, mediaDevices, permissions, registerGlobals };
|
|
30
|
+
export { RTCIceCandidate, RTCPeerConnection, RTCSessionDescription, RTCView, RTCPIPView, ScreenCapturePickerView, RTCRtpTransceiver, RTCRtpReceiver, RTCRtpSender, RTCErrorEvent, RTCAudioSession, MediaStream, MediaStreamTrack, mediaDevices, permissions, registerGlobals, startIOSPIP, stopIOSPIP };
|
|
29
31
|
function registerGlobals() {
|
|
30
32
|
// Should not happen. React Native has a global navigator object.
|
|
31
33
|
if (typeof global.navigator !== 'object') {
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","WebRTCModule","Error","OS","setupNativeEvents","Logger","mediaDevices","MediaStream","MediaStreamTrack","MediaStreamTrackEvent","permissions","RTCErrorEvent","RTCIceCandidate","RTCPeerConnection","RTCRtpReceiver","RTCRtpSender","RTCRtpTransceiver","RTCSessionDescription","RTCView","ScreenCapturePickerView","enable","ROOT_PREFIX","registerGlobals","global","navigator","getUserMedia","bind","getDisplayMedia","enumerateDevices"],"sources":["index.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst { WebRTCModule } = NativeModules;\n\nif (WebRTCModule === null) {\n throw new Error(`WebRTC native module not found.\\n${Platform.OS === 'ios' ?\n 'Try executing the \"pod install\" command inside your projects ios folder.' :\n 'Try executing the \"npm install\" command inside your projects folder.'\n }`);\n}\n\nimport { setupNativeEvents } from './EventEmitter';\nimport Logger from './Logger';\nimport mediaDevices from './MediaDevices';\nimport MediaStream from './MediaStream';\nimport MediaStreamTrack from './MediaStreamTrack';\nimport MediaStreamTrackEvent from './MediaStreamTrackEvent';\nimport permissions from './Permissions';\nimport RTCErrorEvent from './RTCErrorEvent';\nimport RTCIceCandidate from './RTCIceCandidate';\nimport RTCPeerConnection from './RTCPeerConnection';\nimport RTCRtpReceiver from './RTCRtpReceiver';\nimport RTCRtpSender from './RTCRtpSender';\nimport RTCRtpTransceiver from './RTCRtpTransceiver';\nimport RTCSessionDescription from './RTCSessionDescription';\nimport RTCView from './RTCView';\nimport ScreenCapturePickerView from './ScreenCapturePickerView';\n\nLogger.enable(`${Logger.ROOT_PREFIX}:*`);\n\n// Add listeners for the native events early, since they are added asynchronously.\nsetupNativeEvents();\n\nexport {\n RTCIceCandidate,\n RTCPeerConnection,\n RTCSessionDescription,\n RTCView,\n ScreenCapturePickerView,\n RTCRtpTransceiver,\n RTCRtpReceiver,\n RTCRtpSender,\n RTCErrorEvent,\n MediaStream,\n MediaStreamTrack,\n mediaDevices,\n permissions,\n registerGlobals
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","WebRTCModule","Error","OS","setupNativeEvents","Logger","mediaDevices","MediaStream","MediaStreamTrack","MediaStreamTrackEvent","permissions","RTCAudioSession","RTCErrorEvent","RTCIceCandidate","RTCPIPView","startIOSPIP","stopIOSPIP","RTCPeerConnection","RTCRtpReceiver","RTCRtpSender","RTCRtpTransceiver","RTCSessionDescription","RTCView","ScreenCapturePickerView","enable","ROOT_PREFIX","registerGlobals","global","navigator","getUserMedia","bind","getDisplayMedia","enumerateDevices"],"sources":["index.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst { WebRTCModule } = NativeModules;\n\nif (WebRTCModule === null) {\n throw new Error(`WebRTC native module not found.\\n${Platform.OS === 'ios' ?\n 'Try executing the \"pod install\" command inside your projects ios folder.' :\n 'Try executing the \"npm install\" command inside your projects folder.'\n }`);\n}\n\nimport { setupNativeEvents } from './EventEmitter';\nimport Logger from './Logger';\nimport mediaDevices from './MediaDevices';\nimport MediaStream from './MediaStream';\nimport MediaStreamTrack, { type MediaTrackSettings } from './MediaStreamTrack';\nimport MediaStreamTrackEvent from './MediaStreamTrackEvent';\nimport permissions from './Permissions';\nimport RTCAudioSession from './RTCAudioSession';\nimport RTCErrorEvent from './RTCErrorEvent';\nimport RTCIceCandidate from './RTCIceCandidate';\nimport RTCPIPView, { startIOSPIP, stopIOSPIP } from './RTCPIPView';\nimport RTCPeerConnection from './RTCPeerConnection';\nimport RTCRtpReceiver from './RTCRtpReceiver';\nimport RTCRtpSender from './RTCRtpSender';\nimport RTCRtpTransceiver from './RTCRtpTransceiver';\nimport RTCSessionDescription from './RTCSessionDescription';\nimport RTCView, { type RTCVideoViewProps, type RTCIOSPIPOptions } from './RTCView';\nimport ScreenCapturePickerView from './ScreenCapturePickerView';\n\nLogger.enable(`${Logger.ROOT_PREFIX}:*`);\n\n// Add listeners for the native events early, since they are added asynchronously.\nsetupNativeEvents();\n\nexport {\n RTCIceCandidate,\n RTCPeerConnection,\n RTCSessionDescription,\n RTCView,\n RTCPIPView,\n ScreenCapturePickerView,\n RTCRtpTransceiver,\n RTCRtpReceiver,\n RTCRtpSender,\n RTCErrorEvent,\n RTCAudioSession,\n MediaStream,\n MediaStreamTrack,\n type MediaTrackSettings,\n type RTCVideoViewProps,\n type RTCIOSPIPOptions,\n mediaDevices,\n permissions,\n registerGlobals,\n startIOSPIP,\n stopIOSPIP,\n};\n\ndeclare const global: any;\n\nfunction registerGlobals(): void {\n // Should not happen. React Native has a global navigator object.\n if (typeof global.navigator !== 'object') {\n throw new Error('navigator is not an object');\n }\n\n if (!global.navigator.mediaDevices) {\n global.navigator.mediaDevices = {};\n }\n\n global.navigator.mediaDevices.getUserMedia = mediaDevices.getUserMedia.bind(mediaDevices);\n global.navigator.mediaDevices.getDisplayMedia = mediaDevices.getDisplayMedia.bind(mediaDevices);\n global.navigator.mediaDevices.enumerateDevices = mediaDevices.enumerateDevices.bind(mediaDevices);\n\n global.RTCIceCandidate = RTCIceCandidate;\n global.RTCPeerConnection = RTCPeerConnection;\n global.RTCRtpReceiver = RTCRtpReceiver;\n global.RTCRtpSender = RTCRtpReceiver;\n global.RTCSessionDescription = RTCSessionDescription;\n global.MediaStream = MediaStream;\n global.MediaStreamTrack = MediaStreamTrack;\n global.MediaStreamTrackEvent = MediaStreamTrackEvent;\n global.RTCRtpTransceiver = RTCRtpTransceiver;\n global.RTCRtpReceiver = RTCRtpReceiver;\n global.RTCRtpSender = RTCRtpSender;\n global.RTCErrorEvent = RTCErrorEvent;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare type MediaTrackConstraints = {
|
|
2
|
+
width?: ConstrainNumber;
|
|
3
|
+
height?: ConstrainNumber;
|
|
4
|
+
frameRate?: ConstrainNumber;
|
|
5
|
+
facingMode?: ConstrainString;
|
|
6
|
+
deviceId?: ConstrainString;
|
|
7
|
+
groupId?: ConstrainString;
|
|
8
|
+
};
|
|
9
|
+
declare type ConstrainNumber = number | {
|
|
10
|
+
exact?: number;
|
|
11
|
+
ideal?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
min?: number;
|
|
14
|
+
};
|
|
15
|
+
declare type ConstrainString = string | {
|
|
16
|
+
exact?: string;
|
|
17
|
+
ideal?: string;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventTarget, Event } from 'event-target-shim/index';
|
|
2
|
+
import { Constraints } from './getUserMedia';
|
|
2
3
|
declare type MediaDevicesEventMap = {
|
|
3
4
|
devicechange: Event<'devicechange'>;
|
|
4
5
|
};
|
|
@@ -23,7 +24,7 @@ declare class MediaDevices extends EventTarget<MediaDevicesEventMap> {
|
|
|
23
24
|
* @param {*} constraints
|
|
24
25
|
* @returns {Promise}
|
|
25
26
|
*/
|
|
26
|
-
getUserMedia(constraints:
|
|
27
|
+
getUserMedia(constraints: Constraints): Promise<import("./MediaStream").default>;
|
|
27
28
|
}
|
|
28
29
|
declare const _default: MediaDevices;
|
|
29
30
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventTarget, Event } from 'event-target-shim/index';
|
|
2
|
+
import { MediaTrackConstraints } from './Constraints';
|
|
2
3
|
declare type MediaStreamTrackState = 'live' | 'ended';
|
|
3
4
|
export declare type MediaStreamTrackInfo = {
|
|
4
5
|
id: string;
|
|
@@ -10,15 +11,23 @@ export declare type MediaStreamTrackInfo = {
|
|
|
10
11
|
peerConnectionId: number;
|
|
11
12
|
readyState: MediaStreamTrackState;
|
|
12
13
|
};
|
|
14
|
+
export declare type MediaTrackSettings = {
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
frameRate?: number;
|
|
18
|
+
facingMode?: string;
|
|
19
|
+
deviceId?: string;
|
|
20
|
+
groupId?: string;
|
|
21
|
+
};
|
|
13
22
|
declare type MediaStreamTrackEventMap = {
|
|
14
23
|
ended: Event<'ended'>;
|
|
15
24
|
mute: Event<'mute'>;
|
|
16
25
|
unmute: Event<'unmute'>;
|
|
17
26
|
};
|
|
18
27
|
export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventMap> {
|
|
19
|
-
_constraints:
|
|
28
|
+
_constraints: MediaTrackConstraints;
|
|
20
29
|
_enabled: boolean;
|
|
21
|
-
_settings:
|
|
30
|
+
_settings: MediaTrackSettings;
|
|
22
31
|
_muted: boolean;
|
|
23
32
|
_peerConnectionId: number;
|
|
24
33
|
_readyState: MediaStreamTrackState;
|
|
@@ -38,6 +47,8 @@ export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventM
|
|
|
38
47
|
*
|
|
39
48
|
* This is how the reference application (AppRTCMobile) implements camera
|
|
40
49
|
* switching.
|
|
50
|
+
*
|
|
51
|
+
* @deprecated Use applyConstraints instead.
|
|
41
52
|
*/
|
|
42
53
|
_switchCamera(): void;
|
|
43
54
|
_setVideoEffect(name: string): void;
|
|
@@ -54,11 +65,21 @@ export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventM
|
|
|
54
65
|
* @param volume a gain value in the range of 0-10. defaults to 1.0
|
|
55
66
|
*/
|
|
56
67
|
_setVolume(volume: number): void;
|
|
57
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Applies a new set of constraints to the track.
|
|
70
|
+
*
|
|
71
|
+
* @param constraints An object listing the constraints
|
|
72
|
+
* to apply to the track's constrainable properties; any existing
|
|
73
|
+
* constraints are replaced with the new values specified, and any
|
|
74
|
+
* constrainable properties not included are restored to their default
|
|
75
|
+
* constraints. If this parameter is omitted, all currently set custom
|
|
76
|
+
* constraints are cleared.
|
|
77
|
+
*/
|
|
78
|
+
applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
|
|
58
79
|
clone(): never;
|
|
59
80
|
getCapabilities(): never;
|
|
60
|
-
getConstraints():
|
|
61
|
-
getSettings():
|
|
81
|
+
getConstraints(): MediaTrackConstraints;
|
|
82
|
+
getSettings(): MediaTrackSettings;
|
|
62
83
|
_registerEvents(): void;
|
|
63
84
|
release(): void;
|
|
64
85
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default class RTCAudioSession {
|
|
2
|
+
/**
|
|
3
|
+
* To be called when CallKit activates the audio session.
|
|
4
|
+
*/
|
|
5
|
+
static audioSessionDidActivate(): void;
|
|
6
|
+
/**
|
|
7
|
+
* To be called when CallKit deactivates the audio session.
|
|
8
|
+
*/
|
|
9
|
+
static audioSessionDidDeactivate(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { RTCIOSPIPOptions, RTCVideoViewProps } from './RTCView';
|
|
3
|
+
export interface RTCPIPViewProps extends RTCVideoViewProps {
|
|
4
|
+
iosPIP?: RTCIOSPIPOptions & {
|
|
5
|
+
fallbackView?: Component;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A convenience wrapper around RTCView to handle the fallback view as a prop.
|
|
10
|
+
*/
|
|
11
|
+
declare const RTCPIPView: import("react").ForwardRefExoticComponent<RTCPIPViewProps & import("react").RefAttributes<Component<{}, {}, any>>>;
|
|
12
|
+
export declare function startIOSPIP(ref: any): void;
|
|
13
|
+
export declare function stopIOSPIP(ref: any): void;
|
|
14
|
+
export default RTCPIPView;
|
|
@@ -5,7 +5,7 @@ import { ViewProps } from 'react-native';
|
|
|
5
5
|
*
|
|
6
6
|
* So we list them here for documentation purposes.
|
|
7
7
|
*/
|
|
8
|
-
interface RTCVideoViewProps extends ViewProps {
|
|
8
|
+
export interface RTCVideoViewProps extends ViewProps {
|
|
9
9
|
/**
|
|
10
10
|
* Indicates whether the video specified by {@link #streamURL} should be
|
|
11
11
|
* mirrored during rendering. Commonly, applications choose to mirror the
|
|
@@ -21,6 +21,8 @@ interface RTCVideoViewProps extends ViewProps {
|
|
|
21
21
|
* resembles the CSS style object-fit.
|
|
22
22
|
*
|
|
23
23
|
* objectFit: 'contain' | 'cover'
|
|
24
|
+
*
|
|
25
|
+
* Defaults to 'cover'.
|
|
24
26
|
*/
|
|
25
27
|
objectFit?: 'contain' | 'cover';
|
|
26
28
|
/**
|
|
@@ -55,6 +57,47 @@ interface RTCVideoViewProps extends ViewProps {
|
|
|
55
57
|
* zOrder: number
|
|
56
58
|
*/
|
|
57
59
|
zOrder?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Picture in picture options for this view. Disabled if not supplied.
|
|
62
|
+
*
|
|
63
|
+
* Note: this should only be generally only used with remote video tracks,
|
|
64
|
+
* as the local camera may stop while in the background.
|
|
65
|
+
*
|
|
66
|
+
* iOS only. Requires iOS 15.0 or above, and the PIP background mode capability.
|
|
67
|
+
*/
|
|
68
|
+
iosPIP?: RTCIOSPIPOptions;
|
|
69
|
+
}
|
|
70
|
+
export interface RTCIOSPIPOptions {
|
|
71
|
+
/**
|
|
72
|
+
* Whether PIP can be launched from this view.
|
|
73
|
+
*
|
|
74
|
+
* Defaults to true.
|
|
75
|
+
*/
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The preferred size of the PIP window.
|
|
79
|
+
*/
|
|
80
|
+
preferredSize?: {
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Indicates whether Picture in Picture starts automatically
|
|
86
|
+
* when the controller embeds its content inline and the app
|
|
87
|
+
* transitions to the background.
|
|
88
|
+
*
|
|
89
|
+
* Defaults to true.
|
|
90
|
+
*
|
|
91
|
+
* See: AVPictureInPictureController.canStartPictureInPictureAutomaticallyFromInline
|
|
92
|
+
*/
|
|
93
|
+
startAutomatically?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Indicates whether Picture in Picture should stop automatically
|
|
96
|
+
* when the app returns to the foreground.
|
|
97
|
+
*
|
|
98
|
+
* Defaults to true.
|
|
99
|
+
*/
|
|
100
|
+
stopAutomatically?: boolean;
|
|
58
101
|
}
|
|
59
102
|
declare const _default: import("react-native").HostComponent<RTCVideoViewProps>;
|
|
60
103
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { MediaTrackConstraints } from './Constraints';
|
|
1
2
|
import MediaStream from './MediaStream';
|
|
2
|
-
interface Constraints {
|
|
3
|
-
audio?: boolean |
|
|
4
|
-
video?: boolean |
|
|
3
|
+
export interface Constraints {
|
|
4
|
+
audio?: boolean | MediaTrackConstraints;
|
|
5
|
+
video?: boolean | MediaTrackConstraints;
|
|
5
6
|
}
|
|
6
7
|
export default function getUserMedia(constraints?: Constraints): Promise<MediaStream>;
|
|
7
|
-
export {};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import mediaDevices from './MediaDevices';
|
|
2
2
|
import MediaStream from './MediaStream';
|
|
3
|
-
import MediaStreamTrack from './MediaStreamTrack';
|
|
3
|
+
import MediaStreamTrack, { type MediaTrackSettings } from './MediaStreamTrack';
|
|
4
4
|
import permissions from './Permissions';
|
|
5
|
+
import RTCAudioSession from './RTCAudioSession';
|
|
5
6
|
import RTCErrorEvent from './RTCErrorEvent';
|
|
6
7
|
import RTCIceCandidate from './RTCIceCandidate';
|
|
8
|
+
import RTCPIPView, { startIOSPIP, stopIOSPIP } from './RTCPIPView';
|
|
7
9
|
import RTCPeerConnection from './RTCPeerConnection';
|
|
8
10
|
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
9
11
|
import RTCRtpSender from './RTCRtpSender';
|
|
10
12
|
import RTCRtpTransceiver from './RTCRtpTransceiver';
|
|
11
13
|
import RTCSessionDescription from './RTCSessionDescription';
|
|
12
|
-
import RTCView from './RTCView';
|
|
14
|
+
import RTCView, { type RTCVideoViewProps, type RTCIOSPIPOptions } from './RTCView';
|
|
13
15
|
import ScreenCapturePickerView from './ScreenCapturePickerView';
|
|
14
|
-
export { RTCIceCandidate, RTCPeerConnection, RTCSessionDescription, RTCView, ScreenCapturePickerView, RTCRtpTransceiver, RTCRtpReceiver, RTCRtpSender, RTCErrorEvent, MediaStream, MediaStreamTrack, mediaDevices, permissions, registerGlobals };
|
|
16
|
+
export { RTCIceCandidate, RTCPeerConnection, RTCSessionDescription, RTCView, RTCPIPView, ScreenCapturePickerView, RTCRtpTransceiver, RTCRtpReceiver, RTCRtpSender, RTCErrorEvent, RTCAudioSession, MediaStream, MediaStreamTrack, type MediaTrackSettings, type RTCVideoViewProps, type RTCIOSPIPOptions, mediaDevices, permissions, registerGlobals, startIOSPIP, stopIOSPIP, };
|
|
15
17
|
declare function registerGlobals(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-webrtc",
|
|
3
|
-
"version": "124.0.
|
|
3
|
+
"version": "124.0.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/react-native-webrtc/react-native-webrtc.git"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"lint": "eslint --max-warnings 0 . && tsc --noEmit",
|
|
32
|
+
"lintfix": "eslint --max-warnings 0 --fix . && tsc --noEmit",
|
|
32
33
|
"prepare": "husky install && bob build",
|
|
33
34
|
"format": "tools/format.sh"
|
|
34
35
|
},
|
package/src/.eslintrc.cjs
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
export type MediaTrackConstraints = {
|
|
3
|
+
width?: ConstrainNumber;
|
|
4
|
+
height?: ConstrainNumber;
|
|
5
|
+
frameRate?: ConstrainNumber;
|
|
6
|
+
facingMode?: ConstrainString;
|
|
7
|
+
deviceId?: ConstrainString;
|
|
8
|
+
groupId?: ConstrainString;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type ConstrainNumber = number | {
|
|
12
|
+
exact?: number,
|
|
13
|
+
ideal?: number,
|
|
14
|
+
max?: number,
|
|
15
|
+
min?: number,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type ConstrainString = string | {
|
|
19
|
+
exact?: string,
|
|
20
|
+
ideal?: string,
|
|
21
|
+
}
|
package/src/MediaDevices.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { EventTarget, Event, defineEventAttribute } from 'event-target-shim/inde
|
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import getDisplayMedia from './getDisplayMedia';
|
|
5
|
-
import getUserMedia from './getUserMedia';
|
|
5
|
+
import getUserMedia, { Constraints } from './getUserMedia';
|
|
6
6
|
|
|
7
7
|
const { WebRTCModule } = NativeModules;
|
|
8
8
|
|
|
@@ -37,7 +37,7 @@ class MediaDevices extends EventTarget<MediaDevicesEventMap> {
|
|
|
37
37
|
* @param {*} constraints
|
|
38
38
|
* @returns {Promise}
|
|
39
39
|
*/
|
|
40
|
-
getUserMedia(constraints) {
|
|
40
|
+
getUserMedia(constraints: Constraints) {
|
|
41
41
|
return getUserMedia(constraints);
|
|
42
42
|
}
|
|
43
43
|
}
|
package/src/MediaStreamTrack.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { EventTarget, Event, defineEventAttribute } from 'event-target-shim/index';
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import { MediaTrackConstraints } from './Constraints';
|
|
4
5
|
import { addListener, removeListener } from './EventEmitter';
|
|
5
6
|
import Logger from './Logger';
|
|
6
|
-
import { deepClone } from './RTCUtil';
|
|
7
|
+
import { deepClone, normalizeConstraints } from './RTCUtil';
|
|
7
8
|
|
|
8
9
|
const log = new Logger('pc');
|
|
9
10
|
const { WebRTCModule } = NativeModules;
|
|
@@ -22,6 +23,15 @@ export type MediaStreamTrackInfo = {
|
|
|
22
23
|
readyState: MediaStreamTrackState;
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
export type MediaTrackSettings = {
|
|
27
|
+
width?: number;
|
|
28
|
+
height?: number;
|
|
29
|
+
frameRate?: number;
|
|
30
|
+
facingMode?: string;
|
|
31
|
+
deviceId?: string;
|
|
32
|
+
groupId?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
type MediaStreamTrackEventMap = {
|
|
26
36
|
ended: Event<'ended'>;
|
|
27
37
|
mute: Event<'mute'>;
|
|
@@ -29,9 +39,9 @@ type MediaStreamTrackEventMap = {
|
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventMap> {
|
|
32
|
-
_constraints:
|
|
42
|
+
_constraints: MediaTrackConstraints;
|
|
33
43
|
_enabled: boolean;
|
|
34
|
-
_settings:
|
|
44
|
+
_settings: MediaTrackSettings;
|
|
35
45
|
_muted: boolean;
|
|
36
46
|
_peerConnectionId: number;
|
|
37
47
|
_readyState: MediaStreamTrackState;
|
|
@@ -97,6 +107,8 @@ export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventM
|
|
|
97
107
|
*
|
|
98
108
|
* This is how the reference application (AppRTCMobile) implements camera
|
|
99
109
|
* switching.
|
|
110
|
+
*
|
|
111
|
+
* @deprecated Use applyConstraints instead.
|
|
100
112
|
*/
|
|
101
113
|
_switchCamera(): void {
|
|
102
114
|
if (this.remote) {
|
|
@@ -107,7 +119,12 @@ export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventM
|
|
|
107
119
|
throw new Error('Only implemented for video tracks');
|
|
108
120
|
}
|
|
109
121
|
|
|
110
|
-
|
|
122
|
+
const constraints = deepClone(this._settings);
|
|
123
|
+
|
|
124
|
+
delete constraints.deviceId;
|
|
125
|
+
constraints.facingMode = this._settings.facingMode === 'user' ? 'environment' : 'user';
|
|
126
|
+
|
|
127
|
+
this.applyConstraints(constraints);
|
|
111
128
|
}
|
|
112
129
|
|
|
113
130
|
_setVideoEffect(name:string) {
|
|
@@ -150,8 +167,25 @@ export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventM
|
|
|
150
167
|
WebRTCModule.mediaStreamTrackSetVolume(this.remote ? this._peerConnectionId : -1, this.id, volume);
|
|
151
168
|
}
|
|
152
169
|
|
|
153
|
-
|
|
154
|
-
|
|
170
|
+
/**
|
|
171
|
+
* Applies a new set of constraints to the track.
|
|
172
|
+
*
|
|
173
|
+
* @param constraints An object listing the constraints
|
|
174
|
+
* to apply to the track's constrainable properties; any existing
|
|
175
|
+
* constraints are replaced with the new values specified, and any
|
|
176
|
+
* constrainable properties not included are restored to their default
|
|
177
|
+
* constraints. If this parameter is omitted, all currently set custom
|
|
178
|
+
* constraints are cleared.
|
|
179
|
+
*/
|
|
180
|
+
async applyConstraints(constraints?: MediaTrackConstraints): Promise<void> {
|
|
181
|
+
if (this.kind !== 'video') {
|
|
182
|
+
throw new Error('Only implemented for video tracks');
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const normalized = normalizeConstraints({ video: constraints ?? true });
|
|
186
|
+
|
|
187
|
+
this._settings = await WebRTCModule.mediaStreamTrackApplyConstraints(this.id, normalized.video);
|
|
188
|
+
this._constraints = constraints ?? {};
|
|
155
189
|
}
|
|
156
190
|
|
|
157
191
|
clone(): never {
|
|
@@ -166,7 +200,7 @@ export default class MediaStreamTrack extends EventTarget<MediaStreamTrackEventM
|
|
|
166
200
|
return deepClone(this._constraints);
|
|
167
201
|
}
|
|
168
202
|
|
|
169
|
-
getSettings() {
|
|
203
|
+
getSettings(): MediaTrackSettings {
|
|
170
204
|
return deepClone(this._settings);
|
|
171
205
|
}
|
|
172
206
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const { WebRTCModule } = NativeModules;
|
|
4
|
+
|
|
5
|
+
export default class RTCAudioSession {
|
|
6
|
+
/**
|
|
7
|
+
* To be called when CallKit activates the audio session.
|
|
8
|
+
*/
|
|
9
|
+
static audioSessionDidActivate() {
|
|
10
|
+
// Only valid for iOS
|
|
11
|
+
if (Platform.OS === 'ios') {
|
|
12
|
+
WebRTCModule.audioSessionDidActivate();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* To be called when CallKit deactivates the audio session.
|
|
18
|
+
*/
|
|
19
|
+
static audioSessionDidDeactivate() {
|
|
20
|
+
// Only valid for iOS
|
|
21
|
+
if (Platform.OS === 'ios') {
|
|
22
|
+
WebRTCModule.audioSessionDidDeactivate();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component, forwardRef } from 'react';
|
|
2
|
+
import ReactNative, { UIManager } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import RTCView, { RTCIOSPIPOptions, RTCVideoViewProps } from './RTCView';
|
|
5
|
+
|
|
6
|
+
export interface RTCPIPViewProps extends RTCVideoViewProps {
|
|
7
|
+
iosPIP?: RTCIOSPIPOptions & {
|
|
8
|
+
fallbackView?: Component;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A convenience wrapper around RTCView to handle the fallback view as a prop.
|
|
14
|
+
*/
|
|
15
|
+
const RTCPIPView = forwardRef<Component, RTCPIPViewProps>((props, ref) => {
|
|
16
|
+
const rtcViewProps = { ...props };
|
|
17
|
+
const fallbackView = rtcViewProps.iosPIP?.fallbackView;
|
|
18
|
+
|
|
19
|
+
delete rtcViewProps.iosPIP?.fallbackView;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
<RTCView ref={ref}
|
|
24
|
+
{...rtcViewProps}>
|
|
25
|
+
{fallbackView}
|
|
26
|
+
</RTCView>
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export function startIOSPIP(ref) {
|
|
31
|
+
UIManager.dispatchViewManagerCommand(
|
|
32
|
+
ReactNative.findNodeHandle(ref.current),
|
|
33
|
+
UIManager.getViewManagerConfig('RTCVideoView').Commands.startIOSPIP,
|
|
34
|
+
[]
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function stopIOSPIP(ref) {
|
|
39
|
+
UIManager.dispatchViewManagerCommand(
|
|
40
|
+
ReactNative.findNodeHandle(ref.current),
|
|
41
|
+
UIManager.getViewManagerConfig('RTCVideoView').Commands.stopIOSPIP,
|
|
42
|
+
[]
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default RTCPIPView;
|
package/src/RTCView.ts
CHANGED
|
@@ -6,8 +6,7 @@ import { requireNativeComponent, ViewProps } from 'react-native';
|
|
|
6
6
|
*
|
|
7
7
|
* So we list them here for documentation purposes.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
interface RTCVideoViewProps extends ViewProps {
|
|
9
|
+
export interface RTCVideoViewProps extends ViewProps {
|
|
11
10
|
/**
|
|
12
11
|
* Indicates whether the video specified by {@link #streamURL} should be
|
|
13
12
|
* mirrored during rendering. Commonly, applications choose to mirror the
|
|
@@ -24,6 +23,8 @@ interface RTCVideoViewProps extends ViewProps {
|
|
|
24
23
|
* resembles the CSS style object-fit.
|
|
25
24
|
*
|
|
26
25
|
* objectFit: 'contain' | 'cover'
|
|
26
|
+
*
|
|
27
|
+
* Defaults to 'cover'.
|
|
27
28
|
*/
|
|
28
29
|
objectFit?: 'contain' | 'cover';
|
|
29
30
|
|
|
@@ -59,6 +60,53 @@ interface RTCVideoViewProps extends ViewProps {
|
|
|
59
60
|
* zOrder: number
|
|
60
61
|
*/
|
|
61
62
|
zOrder?: number;
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Picture in picture options for this view. Disabled if not supplied.
|
|
67
|
+
*
|
|
68
|
+
* Note: this should only be generally only used with remote video tracks,
|
|
69
|
+
* as the local camera may stop while in the background.
|
|
70
|
+
*
|
|
71
|
+
* iOS only. Requires iOS 15.0 or above, and the PIP background mode capability.
|
|
72
|
+
*/
|
|
73
|
+
iosPIP?: RTCIOSPIPOptions
|
|
62
74
|
}
|
|
63
75
|
|
|
76
|
+
export interface RTCIOSPIPOptions {
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Whether PIP can be launched from this view.
|
|
80
|
+
*
|
|
81
|
+
* Defaults to true.
|
|
82
|
+
*/
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The preferred size of the PIP window.
|
|
87
|
+
*/
|
|
88
|
+
preferredSize?: {
|
|
89
|
+
width: number;
|
|
90
|
+
height: number;
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Indicates whether Picture in Picture starts automatically
|
|
95
|
+
* when the controller embeds its content inline and the app
|
|
96
|
+
* transitions to the background.
|
|
97
|
+
*
|
|
98
|
+
* Defaults to true.
|
|
99
|
+
*
|
|
100
|
+
* See: AVPictureInPictureController.canStartPictureInPictureAutomaticallyFromInline
|
|
101
|
+
*/
|
|
102
|
+
startAutomatically?: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Indicates whether Picture in Picture should stop automatically
|
|
106
|
+
* when the app returns to the foreground.
|
|
107
|
+
*
|
|
108
|
+
* Defaults to true.
|
|
109
|
+
*/
|
|
110
|
+
stopAutomatically?: boolean;
|
|
111
|
+
}
|
|
64
112
|
export default requireNativeComponent<RTCVideoViewProps>('RTCVideoView');
|
package/src/getUserMedia.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
import { MediaTrackConstraints } from './Constraints';
|
|
5
6
|
import MediaStream from './MediaStream';
|
|
6
7
|
import MediaStreamError from './MediaStreamError';
|
|
7
8
|
import permissions from './Permissions';
|
|
@@ -9,9 +10,9 @@ import * as RTCUtil from './RTCUtil';
|
|
|
9
10
|
|
|
10
11
|
const { WebRTCModule } = NativeModules;
|
|
11
12
|
|
|
12
|
-
interface Constraints {
|
|
13
|
-
audio?: boolean |
|
|
14
|
-
video?: boolean |
|
|
13
|
+
export interface Constraints {
|
|
14
|
+
audio?: boolean | MediaTrackConstraints;
|
|
15
|
+
video?: boolean | MediaTrackConstraints;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export default function getUserMedia(constraints: Constraints = {}): Promise<MediaStream> {
|
package/src/index.ts
CHANGED
|
@@ -12,17 +12,19 @@ import { setupNativeEvents } from './EventEmitter';
|
|
|
12
12
|
import Logger from './Logger';
|
|
13
13
|
import mediaDevices from './MediaDevices';
|
|
14
14
|
import MediaStream from './MediaStream';
|
|
15
|
-
import MediaStreamTrack from './MediaStreamTrack';
|
|
15
|
+
import MediaStreamTrack, { type MediaTrackSettings } from './MediaStreamTrack';
|
|
16
16
|
import MediaStreamTrackEvent from './MediaStreamTrackEvent';
|
|
17
17
|
import permissions from './Permissions';
|
|
18
|
+
import RTCAudioSession from './RTCAudioSession';
|
|
18
19
|
import RTCErrorEvent from './RTCErrorEvent';
|
|
19
20
|
import RTCIceCandidate from './RTCIceCandidate';
|
|
21
|
+
import RTCPIPView, { startIOSPIP, stopIOSPIP } from './RTCPIPView';
|
|
20
22
|
import RTCPeerConnection from './RTCPeerConnection';
|
|
21
23
|
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
22
24
|
import RTCRtpSender from './RTCRtpSender';
|
|
23
25
|
import RTCRtpTransceiver from './RTCRtpTransceiver';
|
|
24
26
|
import RTCSessionDescription from './RTCSessionDescription';
|
|
25
|
-
import RTCView from './RTCView';
|
|
27
|
+
import RTCView, { type RTCVideoViewProps, type RTCIOSPIPOptions } from './RTCView';
|
|
26
28
|
import ScreenCapturePickerView from './ScreenCapturePickerView';
|
|
27
29
|
|
|
28
30
|
Logger.enable(`${Logger.ROOT_PREFIX}:*`);
|
|
@@ -35,16 +37,23 @@ export {
|
|
|
35
37
|
RTCPeerConnection,
|
|
36
38
|
RTCSessionDescription,
|
|
37
39
|
RTCView,
|
|
40
|
+
RTCPIPView,
|
|
38
41
|
ScreenCapturePickerView,
|
|
39
42
|
RTCRtpTransceiver,
|
|
40
43
|
RTCRtpReceiver,
|
|
41
44
|
RTCRtpSender,
|
|
42
45
|
RTCErrorEvent,
|
|
46
|
+
RTCAudioSession,
|
|
43
47
|
MediaStream,
|
|
44
48
|
MediaStreamTrack,
|
|
49
|
+
type MediaTrackSettings,
|
|
50
|
+
type RTCVideoViewProps,
|
|
51
|
+
type RTCIOSPIPOptions,
|
|
45
52
|
mediaDevices,
|
|
46
53
|
permissions,
|
|
47
|
-
registerGlobals
|
|
54
|
+
registerGlobals,
|
|
55
|
+
startIOSPIP,
|
|
56
|
+
stopIOSPIP,
|
|
48
57
|
};
|
|
49
58
|
|
|
50
59
|
declare const global: any;
|