@voltkit-rtc/react-native 0.0.0-stage → 0.1.1
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/CHANGELOG.md +121 -0
- package/LICENSE +21 -0
- package/README.md +1608 -2
- package/android/build.gradle +70 -0
- package/android/consumer-rules.pro +21 -0
- package/android/src/main/AndroidManifest.xml +25 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/AppVisibility.kt +67 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/AudioDevices.kt +67 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/AudioRouter.kt +487 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/CallServiceTypes.kt +120 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/NativeTimers.kt +106 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/NetworkWatch.kt +120 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/OutputChoice.kt +65 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/RtcConfig.kt +83 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/ScoLink.kt +61 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/VoltkitCallService.kt +287 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/VoltkitRtcInitProvider.kt +215 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/VoltkitRtcModule.kt +313 -0
- package/android/src/main/java/com/voltkit/rtc/reactnative/VoltkitRtcPackage.kt +30 -0
- package/android/src/main/res/drawable/voltkit_rtc_default_call_icon.xml +15 -0
- package/android/src/main/res/raw/voltkit_rtc_keep.xml +7 -0
- package/app.plugin.js +17 -0
- package/lib/commonjs/audio.js +215 -0
- package/lib/commonjs/audio.js.map +1 -0
- package/lib/commonjs/components.js +207 -0
- package/lib/commonjs/components.js.map +1 -0
- package/lib/commonjs/create-client.js +47 -0
- package/lib/commonjs/create-client.js.map +1 -0
- package/lib/commonjs/errors.js +99 -0
- package/lib/commonjs/errors.js.map +1 -0
- package/lib/commonjs/globals.js +61 -0
- package/lib/commonjs/globals.js.map +1 -0
- package/lib/commonjs/index.js +234 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/local-media.js +392 -0
- package/lib/commonjs/local-media.js.map +1 -0
- package/lib/commonjs/native-session.js +365 -0
- package/lib/commonjs/native-session.js.map +1 -0
- package/lib/commonjs/native.js +99 -0
- package/lib/commonjs/native.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/permissions.js +166 -0
- package/lib/commonjs/permissions.js.map +1 -0
- package/lib/commonjs/platform/android.js +126 -0
- package/lib/commonjs/platform/android.js.map +1 -0
- package/lib/commonjs/platform/common.js +138 -0
- package/lib/commonjs/platform/common.js.map +1 -0
- package/lib/commonjs/platform/devices.js +151 -0
- package/lib/commonjs/platform/devices.js.map +1 -0
- package/lib/commonjs/platform/index.js +35 -0
- package/lib/commonjs/platform/index.js.map +1 -0
- package/lib/commonjs/platform/ios.js +54 -0
- package/lib/commonjs/platform/ios.js.map +1 -0
- package/lib/commonjs/platform/streams.js +273 -0
- package/lib/commonjs/platform/streams.js.map +1 -0
- package/lib/commonjs/platform/timers.js +71 -0
- package/lib/commonjs/platform/timers.js.map +1 -0
- package/lib/commonjs/platform/visibility.js +60 -0
- package/lib/commonjs/platform/visibility.js.map +1 -0
- package/lib/commonjs/preflight.js +77 -0
- package/lib/commonjs/preflight.js.map +1 -0
- package/lib/commonjs/provider.js +75 -0
- package/lib/commonjs/provider.js.map +1 -0
- package/lib/commonjs/specs/NativeVoltkitRtc.js +29 -0
- package/lib/commonjs/specs/NativeVoltkitRtc.js.map +1 -0
- package/lib/module/audio.js +207 -0
- package/lib/module/audio.js.map +1 -0
- package/lib/module/components.js +200 -0
- package/lib/module/components.js.map +1 -0
- package/lib/module/create-client.js +42 -0
- package/lib/module/create-client.js.map +1 -0
- package/lib/module/errors.js +87 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/globals.js +53 -0
- package/lib/module/globals.js.map +1 -0
- package/lib/module/index.js +33 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/local-media.js +387 -0
- package/lib/module/local-media.js.map +1 -0
- package/lib/module/native-session.js +360 -0
- package/lib/module/native-session.js.map +1 -0
- package/lib/module/native.js +87 -0
- package/lib/module/native.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/permissions.js +160 -0
- package/lib/module/permissions.js.map +1 -0
- package/lib/module/platform/android.js +122 -0
- package/lib/module/platform/android.js.map +1 -0
- package/lib/module/platform/common.js +128 -0
- package/lib/module/platform/common.js.map +1 -0
- package/lib/module/platform/devices.js +142 -0
- package/lib/module/platform/devices.js.map +1 -0
- package/lib/module/platform/index.js +24 -0
- package/lib/module/platform/index.js.map +1 -0
- package/lib/module/platform/ios.js +49 -0
- package/lib/module/platform/ios.js.map +1 -0
- package/lib/module/platform/streams.js +268 -0
- package/lib/module/platform/streams.js.map +1 -0
- package/lib/module/platform/timers.js +67 -0
- package/lib/module/platform/timers.js.map +1 -0
- package/lib/module/platform/visibility.js +54 -0
- package/lib/module/platform/visibility.js.map +1 -0
- package/lib/module/preflight.js +72 -0
- package/lib/module/preflight.js.map +1 -0
- package/lib/module/provider.js +70 -0
- package/lib/module/provider.js.map +1 -0
- package/lib/module/specs/NativeVoltkitRtc.js +37 -0
- package/lib/module/specs/NativeVoltkitRtc.js.map +1 -0
- package/lib/typescript/commonjs/audio.d.ts +58 -0
- package/lib/typescript/commonjs/audio.d.ts.map +1 -0
- package/lib/typescript/commonjs/components.d.ts +58 -0
- package/lib/typescript/commonjs/components.d.ts.map +1 -0
- package/lib/typescript/commonjs/create-client.d.ts +35 -0
- package/lib/typescript/commonjs/create-client.d.ts.map +1 -0
- package/lib/typescript/commonjs/errors.d.ts +34 -0
- package/lib/typescript/commonjs/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/globals.d.ts +16 -0
- package/lib/typescript/commonjs/globals.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +24 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/local-media.d.ts +86 -0
- package/lib/typescript/commonjs/local-media.d.ts.map +1 -0
- package/lib/typescript/commonjs/native-session.d.ts +38 -0
- package/lib/typescript/commonjs/native-session.d.ts.map +1 -0
- package/lib/typescript/commonjs/native.d.ts +18 -0
- package/lib/typescript/commonjs/native.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/permissions.d.ts +30 -0
- package/lib/typescript/commonjs/permissions.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/android.d.ts +4 -0
- package/lib/typescript/commonjs/platform/android.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/common.d.ts +101 -0
- package/lib/typescript/commonjs/platform/common.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/devices.d.ts +42 -0
- package/lib/typescript/commonjs/platform/devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/index.d.ts +6 -0
- package/lib/typescript/commonjs/platform/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/ios.d.ts +4 -0
- package/lib/typescript/commonjs/platform/ios.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/streams.d.ts +82 -0
- package/lib/typescript/commonjs/platform/streams.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/timers.d.ts +19 -0
- package/lib/typescript/commonjs/platform/timers.d.ts.map +1 -0
- package/lib/typescript/commonjs/platform/visibility.d.ts +11 -0
- package/lib/typescript/commonjs/platform/visibility.d.ts.map +1 -0
- package/lib/typescript/commonjs/preflight.d.ts +19 -0
- package/lib/typescript/commonjs/preflight.d.ts.map +1 -0
- package/lib/typescript/commonjs/provider.d.ts +35 -0
- package/lib/typescript/commonjs/provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/specs/NativeVoltkitRtc.d.ts +157 -0
- package/lib/typescript/commonjs/specs/NativeVoltkitRtc.d.ts.map +1 -0
- package/lib/typescript/module/audio.d.ts +58 -0
- package/lib/typescript/module/audio.d.ts.map +1 -0
- package/lib/typescript/module/components.d.ts +58 -0
- package/lib/typescript/module/components.d.ts.map +1 -0
- package/lib/typescript/module/create-client.d.ts +35 -0
- package/lib/typescript/module/create-client.d.ts.map +1 -0
- package/lib/typescript/module/errors.d.ts +34 -0
- package/lib/typescript/module/errors.d.ts.map +1 -0
- package/lib/typescript/module/globals.d.ts +16 -0
- package/lib/typescript/module/globals.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +24 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/local-media.d.ts +86 -0
- package/lib/typescript/module/local-media.d.ts.map +1 -0
- package/lib/typescript/module/native-session.d.ts +38 -0
- package/lib/typescript/module/native-session.d.ts.map +1 -0
- package/lib/typescript/module/native.d.ts +18 -0
- package/lib/typescript/module/native.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/permissions.d.ts +30 -0
- package/lib/typescript/module/permissions.d.ts.map +1 -0
- package/lib/typescript/module/platform/android.d.ts +4 -0
- package/lib/typescript/module/platform/android.d.ts.map +1 -0
- package/lib/typescript/module/platform/common.d.ts +101 -0
- package/lib/typescript/module/platform/common.d.ts.map +1 -0
- package/lib/typescript/module/platform/devices.d.ts +42 -0
- package/lib/typescript/module/platform/devices.d.ts.map +1 -0
- package/lib/typescript/module/platform/index.d.ts +6 -0
- package/lib/typescript/module/platform/index.d.ts.map +1 -0
- package/lib/typescript/module/platform/ios.d.ts +4 -0
- package/lib/typescript/module/platform/ios.d.ts.map +1 -0
- package/lib/typescript/module/platform/streams.d.ts +82 -0
- package/lib/typescript/module/platform/streams.d.ts.map +1 -0
- package/lib/typescript/module/platform/timers.d.ts +19 -0
- package/lib/typescript/module/platform/timers.d.ts.map +1 -0
- package/lib/typescript/module/platform/visibility.d.ts +11 -0
- package/lib/typescript/module/platform/visibility.d.ts.map +1 -0
- package/lib/typescript/module/preflight.d.ts +19 -0
- package/lib/typescript/module/preflight.d.ts.map +1 -0
- package/lib/typescript/module/provider.d.ts +35 -0
- package/lib/typescript/module/provider.d.ts.map +1 -0
- package/lib/typescript/module/specs/NativeVoltkitRtc.d.ts +157 -0
- package/lib/typescript/module/specs/NativeVoltkitRtc.d.ts.map +1 -0
- package/package.json +140 -4
- package/plugin/build/android.d.ts +36 -0
- package/plugin/build/android.js +265 -0
- package/plugin/build/index.d.ts +9 -0
- package/plugin/build/index.js +54 -0
- package/plugin/build/ios.d.ts +4 -0
- package/plugin/build/ios.js +43 -0
- package/plugin/build/options.d.ts +93 -0
- package/plugin/build/options.js +140 -0
- package/react-native.config.js +11 -0
- package/src/audio.ts +221 -0
- package/src/components.tsx +233 -0
- package/src/create-client.ts +53 -0
- package/src/errors.ts +81 -0
- package/src/globals.ts +54 -0
- package/src/index.ts +95 -0
- package/src/local-media.ts +420 -0
- package/src/native-session.tsx +384 -0
- package/src/native.ts +84 -0
- package/src/permissions.ts +173 -0
- package/src/platform/android.ts +128 -0
- package/src/platform/common.ts +157 -0
- package/src/platform/devices.ts +148 -0
- package/src/platform/index.ts +22 -0
- package/src/platform/ios.ts +48 -0
- package/src/platform/streams.ts +285 -0
- package/src/platform/timers.ts +72 -0
- package/src/platform/visibility.ts +59 -0
- package/src/preflight.ts +60 -0
- package/src/provider.tsx +88 -0
- package/src/specs/NativeVoltkitRtc.ts +180 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cameras, microphones and audio outputs.
|
|
3
|
+
*
|
|
4
|
+
* Cameras come from react-native-webrtc (ids "0", "1", ... with a facing), named as the Android SDK names them ("Front
|
|
5
|
+
* camera", "Back camera 2"). On Android the audio devices come from this package's audio router (speaker, earpiece,
|
|
6
|
+
* wired and USB headsets, Bluetooth, each with its `type`), which also routes sound and picks the microphone natively;
|
|
7
|
+
* without the native module, and on iOS, from react-native-webrtc's list.
|
|
8
|
+
*
|
|
9
|
+
* A camera is switched on its own track (react-native-webrtc's applyConstraints with the deviceId): the same track and
|
|
10
|
+
* producer, so nothing can fail half-way. react-native-webrtc falls back to the facing mode, without an error, for an
|
|
11
|
+
* id it does not know, so the id is checked against the list first (`bad-params`) and the camera it ended up on is
|
|
12
|
+
* checked after (`camera-failed`); the old camera keeps capturing either way.
|
|
13
|
+
*/
|
|
14
|
+
import { type DeviceKind, type MediaDevice } from '@voltkit-rtc/client';
|
|
15
|
+
import type { Spec } from '../specs/NativeVoltkitRtc';
|
|
16
|
+
/** The cameras, front ones first, labelled as the Android SDK labels them. */
|
|
17
|
+
export declare function listCameras(): Promise<MediaDevice[]>;
|
|
18
|
+
/** Every device, or those of one kind (ClientPlatform.enumerateDevices). */
|
|
19
|
+
export declare function enumerateDevices(module: Spec | null, kind?: DeviceKind): Promise<MediaDevice[]>;
|
|
20
|
+
/** Hear audio devices come and go (Android's router); cameras cannot be watched. */
|
|
21
|
+
export declare function onDeviceChange(module: Spec | null, listener: () => void): (() => void) | null;
|
|
22
|
+
/**
|
|
23
|
+
* Route sound to an output, or record from a microphone, natively (ClientPlatform.routeAudio). Outputs: true when
|
|
24
|
+
* routed, false when it cannot be chosen (the client then rejects with `bad-params`). Microphones: true when the audio
|
|
25
|
+
* device module records from it now; `bad-params` for one the router does not list; false (the client captures it)
|
|
26
|
+
* where the module cannot choose.
|
|
27
|
+
*/
|
|
28
|
+
export declare function routeAudio(module: Spec, kind: 'audioinput' | 'audiooutput', deviceId: string): Promise<boolean>;
|
|
29
|
+
/** react-native-webrtc's camera track, as far as switching needs it. */
|
|
30
|
+
interface CameraTrack {
|
|
31
|
+
readonly kind: string;
|
|
32
|
+
getSettings(): {
|
|
33
|
+
deviceId?: unknown;
|
|
34
|
+
facingMode?: unknown;
|
|
35
|
+
};
|
|
36
|
+
getConstraints(): Record<string, unknown>;
|
|
37
|
+
applyConstraints(constraints: Record<string, unknown>): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
/** Turn the camera behind `track` to `deviceId`, on the same track (ClientPlatform.switchCameraInPlace). */
|
|
40
|
+
export declare function switchCameraInPlace(track: CameraTrack, deviceId: string): Promise<void>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../../../src/platform/devices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAA+B,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACrG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AA4BtD,8EAA8E;AAC9E,wBAAsB,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAa1D;AAyBD,4EAA4E;AAC5E,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CASrG;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAG7F;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,GAAG,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAarH;AAED,wEAAwE;AACxE,UAAU,WAAW;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,WAAW,IAAI;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5D,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,4GAA4G;AAC5G,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB7F"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ClientPlatform } from '@voltkit-rtc/client';
|
|
2
|
+
/** The React Native platform for this app (Android, or the iOS preview). The same object every time. */
|
|
3
|
+
export declare function reactNativePlatform(): ClientPlatform;
|
|
4
|
+
export { streamBook } from './streams';
|
|
5
|
+
export type { StreamBook, ViewHandle } from './streams';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/platform/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAM1D,wGAAwG;AACxG,wBAAgB,mBAAmB,IAAI,cAAc,CAKpD;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../src/platform/ios.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAiD,KAAK,aAAa,EAAuC,MAAM,UAAU,CAAC;AAMlI,wBAAgB,WAAW,IAAI,cAAc,GAAG,aAAa,CAgC5D"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** What this module needs of a track: react-native-webrtc's MediaStreamTrack, or a test's stand-in. */
|
|
2
|
+
export interface TrackLike {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly kind: string;
|
|
5
|
+
readonly remote?: boolean;
|
|
6
|
+
readonly readyState: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
stop(): void;
|
|
9
|
+
release?(): void;
|
|
10
|
+
}
|
|
11
|
+
/** What this module needs of a stream: react-native-webrtc's MediaStream. */
|
|
12
|
+
export interface StreamLike {
|
|
13
|
+
getTracks(): TrackLike[];
|
|
14
|
+
removeTrack(track: TrackLike): void;
|
|
15
|
+
release(releaseTracks?: boolean): void;
|
|
16
|
+
toURL(): string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Why a stream is kept: a capture (getUserMedia, getDisplayMedia), the client's own (createStream), a view, or the
|
|
20
|
+
* app's own that the client publishes (adoptAppStream: tracks taken out of it, never released here).
|
|
21
|
+
*/
|
|
22
|
+
export type StreamRole = 'capture' | 'client' | 'view' | 'app';
|
|
23
|
+
/** One view's hold on a track's wrapper stream. */
|
|
24
|
+
export interface ViewHandle {
|
|
25
|
+
/** The wrapper's URL, for RTCView's streamURL. */
|
|
26
|
+
readonly url: string;
|
|
27
|
+
/** Called when the wrapper goes before this view lets go of it (the track was stopped or detached). */
|
|
28
|
+
onEnd(listener: () => void): () => void;
|
|
29
|
+
/** This view is done; the wrapper is released when the last view of the track lets go. */
|
|
30
|
+
release(): void;
|
|
31
|
+
}
|
|
32
|
+
export declare class StreamBook {
|
|
33
|
+
private readonly makeStream;
|
|
34
|
+
private readonly live;
|
|
35
|
+
private readonly entries;
|
|
36
|
+
private readonly views;
|
|
37
|
+
/** Local tracks this package disposed (released). */
|
|
38
|
+
private readonly disposed;
|
|
39
|
+
/** Remote tracks whose connection is closing: no new view, their wrappers already released. */
|
|
40
|
+
private readonly detached;
|
|
41
|
+
private readonly stopped;
|
|
42
|
+
private readonly screens;
|
|
43
|
+
/** Streams left unreleased because releasing them would have crashed the app. */
|
|
44
|
+
leaked: number;
|
|
45
|
+
/** Called after a screen track is stopped and released (react-native-webrtc's MediaProjectionService then stops). */
|
|
46
|
+
onScreenStopped: (() => void) | null;
|
|
47
|
+
constructor(makeStream: (tracks: TrackLike[]) => StreamLike);
|
|
48
|
+
/** Keep `stream`, one the platform made (or the app's, `app`), to let go of in the right order. */
|
|
49
|
+
adopt(stream: StreamLike, role: StreamRole): void;
|
|
50
|
+
/** A stream of these tracks for the client's own use (ClientPlatform.createStream). */
|
|
51
|
+
create(tracks: TrackLike[]): StreamLike;
|
|
52
|
+
/** The tracks of `stream` are a screen capture's. */
|
|
53
|
+
markScreen(stream: StreamLike): void;
|
|
54
|
+
/** Release `stream` without its tracks (ClientPlatform.releaseStream). Again does nothing. */
|
|
55
|
+
release(stream: StreamLike): void;
|
|
56
|
+
/**
|
|
57
|
+
* Stop and release `track` (ClientPlatform.stopTrack): its view wrappers are released and it leaves every stream
|
|
58
|
+
* kept here first (made here, or the app's adopted), while the native track still exists. Again does nothing. A
|
|
59
|
+
* remote track is only let go of: its connection owns it.
|
|
60
|
+
*/
|
|
61
|
+
stop(track: TrackLike): void;
|
|
62
|
+
/**
|
|
63
|
+
* The client is about to close what receives these remote tracks (ClientPlatform.detachTracks): release their
|
|
64
|
+
* wrappers now, while their peer connection still exists, and make no new ones.
|
|
65
|
+
*/
|
|
66
|
+
detach(tracks: readonly TrackLike[]): void;
|
|
67
|
+
/** A view of `track` (VideoTrack), or null when it cannot be shown: ended, stopped or detached. */
|
|
68
|
+
view(track: TrackLike): ViewHandle | null;
|
|
69
|
+
/** How many streams made here are not released yet, how many tracks have views, and how many were left unreleased. */
|
|
70
|
+
stats(): {
|
|
71
|
+
live: number;
|
|
72
|
+
views: number;
|
|
73
|
+
leaked: number;
|
|
74
|
+
};
|
|
75
|
+
/** A track the native side may no longer have: disposed here, or remote and ended (its connection closed). */
|
|
76
|
+
private unsafe;
|
|
77
|
+
private dropViews;
|
|
78
|
+
private releaseEntry;
|
|
79
|
+
}
|
|
80
|
+
/** The process's book of streams (one for every client and view). */
|
|
81
|
+
export declare function streamBook(): StreamBook;
|
|
82
|
+
//# sourceMappingURL=streams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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Q,CAAyB;IAClD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,iFAAiF;IACjF,MAAM,SAAK;IACX,qHAAqH;IACrH,eAAe,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAQ;gBAEf,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,UAAU;IAE5E,mGAAmG;IACnG,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAYjD,uFAAuF;IACvF,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU;IAMvC,qDAAqD;IACrD,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAIpC,8FAA8F;IAC9F,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAUjC;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAyC5B;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI;IAO1C,mGAAmG;IACnG,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI;IAuCzC,sHAAsH;IACtH,KAAK,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAIxD,8GAA8G;IAC9G,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,YAAY;CAoBrB;AAID,qEAAqE;AACrE,wBAAgB,UAAU,IAAI,UAAU,CASvC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The timers the client's own work runs on (reconnect backoff, socket liveness, request deadlines, sampling).
|
|
3
|
+
*
|
|
4
|
+
* React Native's JavaScript timers run on Choreographer frames, which stop when the app leaves the foreground, when
|
|
5
|
+
* the screen goes off even with the app in front, and while a permission dialog is open (Phase 0 S5): a call whose
|
|
6
|
+
* timers stop cannot notice a dead socket or reconnect. On Android they wait natively instead (the module's
|
|
7
|
+
* timerStart/timerStop on a thread of their own) and fire back through its onTimer event, which reaches JavaScript
|
|
8
|
+
* whether frames run or not. Without the native module (iOS, Expo Go) they are JavaScript's own.
|
|
9
|
+
*/
|
|
10
|
+
import type { PlatformTimers } from '@voltkit-rtc/client';
|
|
11
|
+
import type { Spec } from '../specs/NativeVoltkitRtc';
|
|
12
|
+
/** JavaScript's own timers, looked up at each call (a test's fake clock replaces them, and is used). */
|
|
13
|
+
export declare const jsTimers: PlatformTimers;
|
|
14
|
+
/**
|
|
15
|
+
* Timers that wait natively. Ids are this side's and never reused, so a fire already on its way for a timer stopped
|
|
16
|
+
* since is recognised and ignored. One onTimer subscription for the whole process.
|
|
17
|
+
*/
|
|
18
|
+
export declare function nativeTimers(module: Spec): PlatformTimers;
|
|
19
|
+
//# sourceMappingURL=timers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timers.d.ts","sourceRoot":"","sources":["../../../../src/platform/timers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAItD,wGAAwG;AACxG,eAAO,MAAM,QAAQ,EAAE,cAKrB,CAAC;AAOH;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,GAAG,cAAc,CAwCzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Spec } from '../specs/NativeVoltkitRtc';
|
|
2
|
+
export interface Visibility {
|
|
3
|
+
visible(): boolean;
|
|
4
|
+
/** Hear every change; returns the function that stops. */
|
|
5
|
+
subscribe(listener: (visible: boolean) => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
/** From the process lifecycle (Android). */
|
|
8
|
+
export declare function nativeVisibility(module: Spec): Visibility;
|
|
9
|
+
/** From AppState: `active` and `inactive` are visible, `background` is not. */
|
|
10
|
+
export declare function appStateVisibility(): Visibility;
|
|
11
|
+
//# sourceMappingURL=visibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../../../src/platform/visibility.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAItD,MAAM,WAAW,UAAU;IACzB,OAAO,IAAI,OAAO,CAAC;IACnB,0DAA0D;IAC1D,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7D;AAID,4CAA4C;AAC5C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,IAAI,GAAG,UAAU,CAYzD;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,IAAI,UAAU,CAkB/C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pre-call check on React Native: @voltkit-rtc/client's preflight with this package's platform. It joins the room
|
|
3
|
+
* the token names, publishes for a few seconds, measures and leaves, and never rejects: offline, a refused permission,
|
|
4
|
+
* a bad token or a missing native module all give a report whose steps say what failed.
|
|
5
|
+
*
|
|
6
|
+
* React Native cannot make a test tone or picture. Without `options.media` the check publishes the microphone, which
|
|
7
|
+
* it captures itself once joined (so nothing opens the microphone for a join that fails) and releases at the end. It
|
|
8
|
+
* never asks for the permission: where it is not granted, the join is still tested and the media step says why.
|
|
9
|
+
* Android shows its microphone indicator for those seconds.
|
|
10
|
+
*/
|
|
11
|
+
import { type PreflightOptions, type PreflightReport } from '@voltkit-rtc/client';
|
|
12
|
+
import { type BackgroundOptions } from './create-client';
|
|
13
|
+
export interface ReactNativePreflightOptions extends PreflightOptions {
|
|
14
|
+
/** The test client's background pause (as createClient's). */
|
|
15
|
+
background?: BackgroundOptions;
|
|
16
|
+
}
|
|
17
|
+
/** Test the connection and the media path before a call. Never rejects. */
|
|
18
|
+
export declare function preflight(wsUrl: string, token: string, options?: ReactNativePreflightOptions): Promise<PreflightReport>;
|
|
19
|
+
//# sourceMappingURL=preflight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../../src/preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAgB,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGhG,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEnF,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACnE,8DAA8D;IAC9D,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AA4BD,2EAA2E;AAC3E,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,2BAAgC,GAAG,OAAO,CAAC,eAAe,CAAC,CAYjI"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VoltkitProvider for React Native: @voltkit-rtc/react's provider (the same props, token hand-over and StrictMode
|
|
3
|
+
* behaviour, so every re-exported hook works below it) making its client with this package's platform, plus what a call
|
|
4
|
+
* needs from the device: the call audio, the call service and the background pause.
|
|
5
|
+
*
|
|
6
|
+
* In Expo Go, or an app not rebuilt after installing react-native-webrtc, no client is made: onError gets
|
|
7
|
+
* `media-unavailable` with `{ reason: 'webrtc-missing' }` (it needs a development build) and the hooks keep their
|
|
8
|
+
* defaults. Nothing throws.
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactElement } from 'react';
|
|
11
|
+
import { type VoltkitProviderProps as ReactVoltkitProviderProps } from '@voltkit-rtc/react';
|
|
12
|
+
import { type BackgroundOptions } from './create-client';
|
|
13
|
+
import { type AudioSessionOptions, type CallServiceText } from './native-session';
|
|
14
|
+
export interface VoltkitProviderProps extends ReactVoltkitProviderProps {
|
|
15
|
+
/**
|
|
16
|
+
* The call audio (Android): held from the join to the close -- the audio mode, focus and routing -- with the
|
|
17
|
+
* loudspeaker unless `speakerphone: false` (the earpiece) or setSpeakerphoneOn chose. `false`, or `manage: false`,
|
|
18
|
+
* leaves the device's audio to the app. Default `{ speakerphone: true, manage: true }`.
|
|
19
|
+
*/
|
|
20
|
+
audio?: AudioSessionOptions | false;
|
|
21
|
+
/**
|
|
22
|
+
* The background pause, read when the client is made: the camera goes off in the background and comes back with the
|
|
23
|
+
* app (default `pauseCamera: true`); the microphone keeps going (`pauseMic: false`). Your `clientOptions` win.
|
|
24
|
+
*/
|
|
25
|
+
background?: BackgroundOptions;
|
|
26
|
+
/**
|
|
27
|
+
* The call service (Android): a foreground service that keeps the call's network and microphone alive in the
|
|
28
|
+
* background and with the screen off. Started on the join when the app's manifest declares it (the Expo plugin's
|
|
29
|
+
* callService, default on), with this notification; `false` never starts it. Default true.
|
|
30
|
+
*/
|
|
31
|
+
callService?: boolean | CallServiceText;
|
|
32
|
+
}
|
|
33
|
+
/** One StreamClient for the components below, with the device's audio, the call service and the background pause. */
|
|
34
|
+
export declare function VoltkitProvider({ audio, background, callService, clientOptions, client, wsUrl, token, onError, children, ...rest }: VoltkitProviderProps): ReactElement;
|
|
35
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/provider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,EAA2C,KAAK,oBAAoB,IAAI,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAIrI,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAiB,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEjG,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB;IACrE;;;;OAIG;IACH,KAAK,CAAC,EAAE,mBAAmB,GAAG,KAAK,CAAC;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;CACzC;AAED,qHAAqH;AACrH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,MAAM,EACN,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,oBAAoB,GAAG,YAAY,CAqCrC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native side of @voltkit-rtc/react-native on Android, as one codegen TurboModule (plan §5.1): audio routing
|
|
3
|
+
* (ported from the Android SDK's AudioRouter), the call service, native timers, app visibility from the process
|
|
4
|
+
* lifecycle, the network, and stopping react-native-webrtc's screen-share service. iOS has no native module in 0.1.0.
|
|
5
|
+
*
|
|
6
|
+
* Read it through src/native.ts, never directly: this module is null in Expo Go, on iOS and wherever the app was not
|
|
7
|
+
* rebuilt after installing the package, and native.ts turns that into a typed error.
|
|
8
|
+
*
|
|
9
|
+
* Strings that hold one of a few values are typed `string` here, as codegen needs; the values are listed beside each.
|
|
10
|
+
*/
|
|
11
|
+
import type { CodegenTypes, TurboModule } from 'react-native';
|
|
12
|
+
/** An audio input or output, as the Android SDK lists it (`MediaDevice`). */
|
|
13
|
+
export type AudioDevice = {
|
|
14
|
+
/** Stable while connected: `speaker`, `earpiece`, `wired`, `bluetooth:12`, `usb:7`, `mic`, `wired-mic`, ... */
|
|
15
|
+
deviceId: string;
|
|
16
|
+
/** `audioinput` | `audiooutput`. */
|
|
17
|
+
kind: string;
|
|
18
|
+
/** A name to show: "Speaker", "Phone", "Pixel Buds". */
|
|
19
|
+
label: string;
|
|
20
|
+
/** `speaker` | `earpiece` | `wiredHeadset` | `bluetooth` | `usb` | `builtinMic` | `other`. */
|
|
21
|
+
type: string;
|
|
22
|
+
/** A headset's microphone and earphones share one. */
|
|
23
|
+
groupId: string;
|
|
24
|
+
};
|
|
25
|
+
/** Devices came or went while a client held the audio (a headset plugged in, Bluetooth connected). */
|
|
26
|
+
export type AudioDevicesChangedEvent = {
|
|
27
|
+
devices: AudioDevice[];
|
|
28
|
+
added: AudioDevice[];
|
|
29
|
+
removed: AudioDevice[];
|
|
30
|
+
};
|
|
31
|
+
/** Where call audio plays now; null once the last client let the audio go. */
|
|
32
|
+
export type AudioOutputChangedEvent = {
|
|
33
|
+
device: AudioDevice | null;
|
|
34
|
+
};
|
|
35
|
+
/** Audio focus, while a client holds the audio: `gain` | `loss` | `lossTransient` | `lossTransientCanDuck`. */
|
|
36
|
+
export type AudioFocusChangedEvent = {
|
|
37
|
+
focus: string;
|
|
38
|
+
};
|
|
39
|
+
/** The audio device module could not open or keep the microphone. */
|
|
40
|
+
export type MicrophoneErrorEvent = {
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
/** The app went to the foreground (any activity started) or the background, from ProcessLifecycleOwner. */
|
|
44
|
+
export type AppVisibilityChangedEvent = {
|
|
45
|
+
visible: boolean;
|
|
46
|
+
};
|
|
47
|
+
/** The network came back (`handover` false) or the default network changed, say Wi-Fi to mobile data (true). */
|
|
48
|
+
export type NetworkAvailableEvent = {
|
|
49
|
+
handover: boolean;
|
|
50
|
+
};
|
|
51
|
+
/** What the call service shows and the call it runs for: its foreground service types are worked out from these. */
|
|
52
|
+
export type CallServiceOptions = {
|
|
53
|
+
/** The notification's title and text, and the label of its Leave action. */
|
|
54
|
+
title: string;
|
|
55
|
+
text: string;
|
|
56
|
+
leaveLabel: string;
|
|
57
|
+
/** The provider's `background.pauseCamera`: true never asks for the camera type. */
|
|
58
|
+
pauseCamera: boolean;
|
|
59
|
+
/** What the call publishes now. */
|
|
60
|
+
micPublished: boolean;
|
|
61
|
+
cameraPublished: boolean;
|
|
62
|
+
/** A screen share is live: on Android 14 and later the `mediaProjection` type is asked for only while it is. */
|
|
63
|
+
sharing: boolean;
|
|
64
|
+
};
|
|
65
|
+
/** The call service: whether the app declares it, and whether it runs, with which foreground service types. */
|
|
66
|
+
export type CallServiceStatus = {
|
|
67
|
+
declared: boolean;
|
|
68
|
+
running: boolean;
|
|
69
|
+
/** `microphone`, `mediaPlayback`, `camera`, `mediaProjection`: what it runs with now (empty when stopped). */
|
|
70
|
+
types: string[];
|
|
71
|
+
};
|
|
72
|
+
/** `started` | `updated` | `stopped` | `leave` (the notification's action) | `taskRemoved` | `failed`. */
|
|
73
|
+
export type CallServiceEvent = {
|
|
74
|
+
type: string;
|
|
75
|
+
/** The types it runs with after this event. */
|
|
76
|
+
types: string[];
|
|
77
|
+
/** Why it failed; empty otherwise. */
|
|
78
|
+
message: string;
|
|
79
|
+
};
|
|
80
|
+
export type Constants = {
|
|
81
|
+
/** `communication` | `media`, from the meta-data in.voltkit.rtc.AUDIO_MODE: fixed for the life of the process. */
|
|
82
|
+
audioMode: string;
|
|
83
|
+
/** in.voltkit.rtc.HW_AEC: the handset's own echo canceller and noise suppressor, where it has them. */
|
|
84
|
+
hardwareEchoCancellation: boolean;
|
|
85
|
+
/** in.voltkit.rtc.SCREEN_SHARE: react-native-webrtc's screen-share service is enabled. */
|
|
86
|
+
screenShareEnabled: boolean;
|
|
87
|
+
/** Whether the app's manifest declares the call service (VoltkitCallService), and its declared types. */
|
|
88
|
+
callServiceDeclared: boolean;
|
|
89
|
+
callServiceTypes: string[];
|
|
90
|
+
/** android.os.Build.VERSION.SDK_INT. */
|
|
91
|
+
sdkInt: number;
|
|
92
|
+
/** The version of this package the native code was built from: a mismatch with the JavaScript means a stale build. */
|
|
93
|
+
nativeVersion: string;
|
|
94
|
+
/**
|
|
95
|
+
* Whether react-native-webrtc uses the audio device module the init provider made, so audioMode and
|
|
96
|
+
* hardwareEchoCancellation apply. False when the app set its own in MainApplication (selectAudioInput still works
|
|
97
|
+
* when that one is a JavaAudioDeviceModule) or the provider did not run.
|
|
98
|
+
*/
|
|
99
|
+
audioDeviceModule: boolean;
|
|
100
|
+
};
|
|
101
|
+
export interface Spec extends TurboModule {
|
|
102
|
+
getConstants(): Constants;
|
|
103
|
+
/**
|
|
104
|
+
* A client connected and manages audio: set up the call audio (mode, focus, routing) while any client holds it.
|
|
105
|
+
* Resolves with the holder to release. `speakerphone` sets the speaker-or-earpiece preference; null keeps the
|
|
106
|
+
* one setSpeakerphoneOn set.
|
|
107
|
+
*/
|
|
108
|
+
audioAcquire(speakerphone: boolean | null): Promise<number>;
|
|
109
|
+
/** That client left; the last holder out puts the device's audio back as it found it. Unknown holders are ignored. */
|
|
110
|
+
audioRelease(holder: number): void;
|
|
111
|
+
/** The loudspeaker (true) or the earpiece (false) when no headset is connected; a headset still wins. Kept until changed. */
|
|
112
|
+
setSpeakerphoneOn(on: boolean): void;
|
|
113
|
+
/** The audio inputs and outputs now. */
|
|
114
|
+
listAudioDevices(): Promise<AudioDevice[]>;
|
|
115
|
+
/** Play call audio on this output while it stays connected. False when there is no such output, or in media mode. */
|
|
116
|
+
selectAudioOutput(deviceId: string): Promise<boolean>;
|
|
117
|
+
/**
|
|
118
|
+
* Record from this microphone (null: the default). False when there is no such input, or react-native-webrtc's audio
|
|
119
|
+
* device module is not a JavaAudioDeviceModule.
|
|
120
|
+
*/
|
|
121
|
+
selectAudioInput(deviceId: string | null): Promise<boolean>;
|
|
122
|
+
/** Where call audio plays now, while a client holds the audio. */
|
|
123
|
+
currentAudioOutput(): Promise<AudioDevice | null>;
|
|
124
|
+
/** Whether an activity of the app is started now (ProcessLifecycleOwner; AppState says background under dialogs). */
|
|
125
|
+
isAppVisible(): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Start the call service: a foreground service that keeps the call's network, microphone and timers alive in the
|
|
128
|
+
* background. Start it while the app is visible (Android's while-in-use rules). Rejects when the app does not
|
|
129
|
+
* declare it, a permission it needs is missing, or Android refuses it.
|
|
130
|
+
*/
|
|
131
|
+
startCallService(options: CallServiceOptions): Promise<CallServiceStatus>;
|
|
132
|
+
/** New text, or new types (a camera published, a share started or ended). Widen the types only while visible. */
|
|
133
|
+
updateCallService(options: CallServiceOptions): Promise<CallServiceStatus>;
|
|
134
|
+
/** Stop it (the call ended). Resolves when stopped; stopping one that is not running does nothing. */
|
|
135
|
+
stopCallService(): Promise<CallServiceStatus>;
|
|
136
|
+
getCallServiceStatus(): CallServiceStatus;
|
|
137
|
+
/** Stop react-native-webrtc's MediaProjectionService once a share ended. True when one was running. */
|
|
138
|
+
stopScreenShareService(): Promise<boolean>;
|
|
139
|
+
/**
|
|
140
|
+
* Fire onTimer(id) after `ms`, and every `ms` after that when `repeat`. A new start with a live id replaces it. Ids
|
|
141
|
+
* come from the caller and are never reused: a fire may already be on its way when the timer is stopped, so a fire
|
|
142
|
+
* for an id the caller no longer has is to be ignored.
|
|
143
|
+
*/
|
|
144
|
+
timerStart(id: number, ms: number, repeat: boolean): void;
|
|
145
|
+
timerStop(id: number): void;
|
|
146
|
+
readonly onAudioDevicesChanged: CodegenTypes.EventEmitter<AudioDevicesChangedEvent>;
|
|
147
|
+
readonly onAudioOutputChanged: CodegenTypes.EventEmitter<AudioOutputChangedEvent>;
|
|
148
|
+
readonly onAudioFocusChanged: CodegenTypes.EventEmitter<AudioFocusChangedEvent>;
|
|
149
|
+
readonly onMicrophoneError: CodegenTypes.EventEmitter<MicrophoneErrorEvent>;
|
|
150
|
+
readonly onAppVisibilityChanged: CodegenTypes.EventEmitter<AppVisibilityChangedEvent>;
|
|
151
|
+
readonly onNetworkAvailable: CodegenTypes.EventEmitter<NetworkAvailableEvent>;
|
|
152
|
+
readonly onCallServiceEvent: CodegenTypes.EventEmitter<CallServiceEvent>;
|
|
153
|
+
readonly onTimer: CodegenTypes.EventEmitter<number>;
|
|
154
|
+
}
|
|
155
|
+
declare const _default: Spec | null | undefined;
|
|
156
|
+
export default _default;
|
|
157
|
+
//# sourceMappingURL=NativeVoltkitRtc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeVoltkitRtc.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeVoltkitRtc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG9D,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG;IACxB,+GAA+G;IAC/G,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,sGAAsG;AACtG,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,+GAA+G;AAC/G,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,2GAA2G;AAC3G,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,gHAAgH;AAChH,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oHAA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CAAC;IAClF,QAAQ,CAAC,mBAAmB,EAAE,YAAY,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;IAChF,QAAQ,CAAC,iBAAiB,EAAE,YAAY,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC5E,QAAQ,CAAC,sBAAsB,EAAE,YAAY,CAAC,YAAY,CAAC,yBAAyB,CAAC,CAAC;IACtF,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAC9E,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACzE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;CACrD;;AAED,wBAA2D"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type MediaDevice, type StreamClient } from '@voltkit-rtc/client';
|
|
2
|
+
/**
|
|
3
|
+
* Play call audio on the loudspeaker (true) or the earpiece (false) when no headset is connected; a wired or Bluetooth
|
|
4
|
+
* headset still wins. Kept until changed, and applied to calls joined later. Rejects with `media-unavailable` on iOS
|
|
5
|
+
* and where the native module is missing.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setSpeakerphoneOn(on: boolean): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Play call audio on this output (a deviceId from useAudioOutput().outputs) while it stays connected. Rejects with
|
|
10
|
+
* `bad-params` for an output that is not there and in the audio mode `media`, and with `media-unavailable` on iOS and
|
|
11
|
+
* where the native module is missing.
|
|
12
|
+
*/
|
|
13
|
+
export declare function selectAudioOutput(deviceId: string): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* The speaker preference a newly joined call holds the audio with: the provider's (default the loudspeaker), unless
|
|
16
|
+
* the app chose with setSpeakerphoneOn, which the router keeps (null).
|
|
17
|
+
*/
|
|
18
|
+
export declare function speakerPreference(provider: boolean | undefined): boolean | null;
|
|
19
|
+
/**
|
|
20
|
+
* One client's hold on the call audio: acquired once it is connected, released when it closes or the provider lets go
|
|
21
|
+
* of it. Released a moment late, so React's StrictMode (an effect unmounted and mounted again at once) neither
|
|
22
|
+
* releases nor acquires twice.
|
|
23
|
+
*/
|
|
24
|
+
declare class AudioHold {
|
|
25
|
+
private readonly onError;
|
|
26
|
+
private holder;
|
|
27
|
+
private users;
|
|
28
|
+
private pendingRelease;
|
|
29
|
+
constructor(onError: (error: Error) => void);
|
|
30
|
+
retain(): void;
|
|
31
|
+
/** One user less; the hold goes when none is left. */
|
|
32
|
+
unretain(): void;
|
|
33
|
+
acquire(speakerphone: boolean | null): void;
|
|
34
|
+
release(): void;
|
|
35
|
+
}
|
|
36
|
+
/** The call audio hold of `client`. */
|
|
37
|
+
export declare function audioHoldOf(client: StreamClient, onError: (error: Error) => void): AudioHold;
|
|
38
|
+
export interface AudioOutput {
|
|
39
|
+
/** Outputs can be chosen here: Android with the native module, in the audio mode `communication`. */
|
|
40
|
+
supported: boolean;
|
|
41
|
+
/** Where call audio can play: speaker, earpiece, wired and USB headsets, Bluetooth. Empty where not supported. */
|
|
42
|
+
outputs: MediaDevice[];
|
|
43
|
+
/** Where call audio plays now, while a call holds the audio; null otherwise. */
|
|
44
|
+
current: MediaDevice | null;
|
|
45
|
+
/** The loudspeaker is in use (or, with no call holding the audio, preferred). */
|
|
46
|
+
speakerphone: boolean;
|
|
47
|
+
/** Play call audio on this output (selectAudioOutput). */
|
|
48
|
+
select(deviceId: string): Promise<void>;
|
|
49
|
+
/** The loudspeaker (true) or the earpiece (false), when no headset is connected (setSpeakerphoneOn). */
|
|
50
|
+
setSpeakerphoneOn(on: boolean): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Where call audio plays, and the choice of output (an Android "speaker / phone / headset" picker). Works before any
|
|
54
|
+
* call: a choice made then is kept. On iOS and without the native module `supported` is false and the calls reject.
|
|
55
|
+
*/
|
|
56
|
+
export declare function useAudioOutput(): AudioOutput;
|
|
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,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,wGAAwG;IACxG,iBAAiB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AA0ED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAG5C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VideoTrack and AudioTrack, React Native's versions of @voltkit-rtc/react's.
|
|
3
|
+
*
|
|
4
|
+
* VideoTrack shows a track in react-native-webrtc's RTCView, which plays a stream by URL. Its stream is a wrapper made
|
|
5
|
+
* through platform/streams.ts, one per track and shared by every view of it, released (never the track) when the last
|
|
6
|
+
* view goes -- or earlier, while the connection still exists, when the client is about to close what receives the
|
|
7
|
+
* track or stops it: releasing a wrapper after its track died kills the app (Phase 0 finding 1). The URL is set one
|
|
8
|
+
* frame after mounting, and the native view is mounted again once if no frame size arrives within 3 s
|
|
9
|
+
* (react-native-webrtc #1611, black video).
|
|
10
|
+
*
|
|
11
|
+
* AudioTrack renders nothing: React Native plays every remote audio track by itself. It sets one track's volume
|
|
12
|
+
* (react-native-webrtc's `_setVolume`, unity at 1) or mutes it here only.
|
|
13
|
+
*/
|
|
14
|
+
import { type ReactElement } from 'react';
|
|
15
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
16
|
+
import type { MediaStreamTrackLike } from './platform/common.js';
|
|
17
|
+
/** How long a view waits for its first frame before its native view is mounted again (react-native-webrtc #1611). */
|
|
18
|
+
export declare const FIRST_FRAME_TIMEOUT_MS = 3000;
|
|
19
|
+
export interface VideoTrackProps {
|
|
20
|
+
/**
|
|
21
|
+
* The video to show: a remote track's `track`, or your camera (`useLocalMedia().stream?.getVideoTracks()[0]`). Nothing
|
|
22
|
+
* while null. Typed by shape (`MediaStreamTrackLike`), so the app needs no DOM library for it.
|
|
23
|
+
*/
|
|
24
|
+
track: MediaStreamTrackLike | null | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The remote video's `producerId`: it is then received at the size this view is shown and paused at the server while
|
|
27
|
+
* the view is not `visible` (adaptive stream). Leave it out for your own camera.
|
|
28
|
+
*/
|
|
29
|
+
producerId?: string;
|
|
30
|
+
/** Flip it horizontally, as people expect to see their own front camera. */
|
|
31
|
+
mirror?: boolean;
|
|
32
|
+
/** `cover` (the default: fill the view, cropping) or `contain` (all of the picture, with bars). */
|
|
33
|
+
objectFit?: 'cover' | 'contain';
|
|
34
|
+
/** Which of two overlapping videos is on top (RTCView's zOrder): 0 for a full-screen video, 1 for a preview over it. */
|
|
35
|
+
zOrder?: number;
|
|
36
|
+
/** Whether the view can be seen now (a list scrolled past it, a hidden tab): with `producerId`, the video pauses at the server while false. */
|
|
37
|
+
visible?: boolean;
|
|
38
|
+
/** The video's size in pixels: its first frame arrived, or the size changed. */
|
|
39
|
+
onDimensionsChange?: (size: {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}) => void;
|
|
43
|
+
style?: StyleProp<ViewStyle>;
|
|
44
|
+
testID?: string;
|
|
45
|
+
}
|
|
46
|
+
/** A video track in an RTCView, sized by `style`. */
|
|
47
|
+
export declare function VideoTrack({ track, producerId, mirror, objectFit, zOrder, visible, onDimensionsChange, style, testID, }: VideoTrackProps): ReactElement;
|
|
48
|
+
export interface AudioTrackProps {
|
|
49
|
+
/** The audio to set: a remote track's `track`. Nothing while null. Typed by shape (`MediaStreamTrackLike`). */
|
|
50
|
+
track: MediaStreamTrackLike | null | undefined;
|
|
51
|
+
/** 0 to 1, clamped (1 is the track as received). Unset leaves it as it is. This track only. */
|
|
52
|
+
volume?: number;
|
|
53
|
+
/** Silence it here only (the track is switched off while muted, and back on after). */
|
|
54
|
+
muted?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** One remote audio track's volume, or muted, while mounted. Renders nothing: React Native plays remote audio itself. */
|
|
57
|
+
export declare function AudioTrack({ track, volume, muted }: AudioTrackProps): null;
|
|
58
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/components.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAA4C,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,EAA4C,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMxG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAmB,CAAC;AAE9D,qHAAqH;AACrH,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mGAAmG;IACnG,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,wHAAwH;IACxH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+IAA+I;IAC/I,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,UAAU,EACV,MAAc,EACd,SAAmB,EACnB,MAAM,EACN,OAAc,EACd,kBAAkB,EAClB,KAAK,EACL,MAAM,GACP,EAAE,eAAe,GAAG,YAAY,CAsHhC;AAED,MAAM,WAAW,eAAe;IAC9B,+GAA+G;IAC/G,KAAK,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,+FAA+F;IAC/F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AASD,yHAAyH;AACzH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAa,EAAE,EAAE,eAAe,GAAG,IAAI,CAgClF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A StreamClient for React Native: react-native-webrtc's mediasoup handler (ReactNative106) and this package's
|
|
3
|
+
* platform, with the background pause on for the camera. The provider makes its clients this way; an app that makes and
|
|
4
|
+
* owns its client (the provider's `client` prop, a PK battle's second client) uses createClient.
|
|
5
|
+
*/
|
|
6
|
+
import { StreamClient, type ClientOptions } from '@voltkit-rtc/client';
|
|
7
|
+
/** What happens to the camera and microphone while the app is in the background. */
|
|
8
|
+
export interface BackgroundOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Switch the camera off while the app is in the background or the screen is off, and back on when it returns (only
|
|
11
|
+
* if this switched it off): viewers see the camera off rather than a frozen picture. Android stops a background
|
|
12
|
+
* app's camera anyway. Default true.
|
|
13
|
+
*/
|
|
14
|
+
pauseCamera?: boolean;
|
|
15
|
+
/** The same for the microphone. Leave it off for calls, which go on talking in the background. Default false. */
|
|
16
|
+
pauseMic?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateClientOptions {
|
|
19
|
+
/** The background pause: camera on by default, microphone off. */
|
|
20
|
+
background?: BackgroundOptions;
|
|
21
|
+
/** StreamClient options of your own; they win over the ones set here. */
|
|
22
|
+
clientOptions?: ClientOptions;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The ClientOptions a React Native client is made with: `{ handlerName: 'ReactNative106', platform,
|
|
26
|
+
* pauseCameraInBackground, pauseMicInBackground, ...clientOptions }`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function reactNativeClientOptions(options?: CreateClientOptions): ClientOptions;
|
|
29
|
+
/**
|
|
30
|
+
* A StreamClient for React Native, not yet connected: call `connect()`. Throws `media-unavailable` with
|
|
31
|
+
* `{ reason: 'webrtc-missing' }` where react-native-webrtc's native module is missing (Expo Go: it needs a development
|
|
32
|
+
* build).
|
|
33
|
+
*/
|
|
34
|
+
export declare function createClient(wsUrl: string, token: string, options?: CreateClientOptions): StreamClient;
|
|
35
|
+
//# sourceMappingURL=create-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-client.d.ts","sourceRoot":"","sources":["../../../src/create-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKvE,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iHAAiH;IACjH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,yEAAyE;IACzE,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa,CASzF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,YAAY,CAG1G"}
|