@voltkit-rtc/react-native 0.0.0-stage → 0.1.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/CHANGELOG.md +96 -0
- package/LICENSE +21 -0
- package/README.md +1606 -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 +314 -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 +73 -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 +309 -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 +68 -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 +338 -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 +86 -0
- package/src/specs/NativeVoltkitRtc.ts +180 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AudioTrack = AudioTrack;
|
|
7
|
+
exports.FIRST_FRAME_TIMEOUT_MS = void 0;
|
|
8
|
+
exports.VideoTrack = VideoTrack;
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
var _react2 = require("@voltkit-rtc/react");
|
|
12
|
+
var _globals = require("./globals.js");
|
|
13
|
+
var _errors = require("./errors.js");
|
|
14
|
+
var _streams = require("./platform/streams.js");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
/**
|
|
17
|
+
* VideoTrack and AudioTrack, React Native's versions of @voltkit-rtc/react's.
|
|
18
|
+
*
|
|
19
|
+
* VideoTrack shows a track in react-native-webrtc's RTCView, which plays a stream by URL. Its stream is a wrapper made
|
|
20
|
+
* through platform/streams.ts, one per track and shared by every view of it, released (never the track) when the last
|
|
21
|
+
* view goes -- or earlier, while the connection still exists, when the client is about to close what receives the
|
|
22
|
+
* track or stops it: releasing a wrapper after its track died kills the app (Phase 0 finding 1). The URL is set one
|
|
23
|
+
* frame after mounting, and the native view is mounted again once if no frame size arrives within 3 s
|
|
24
|
+
* (react-native-webrtc #1611, black video).
|
|
25
|
+
*
|
|
26
|
+
* AudioTrack renders nothing: React Native plays every remote audio track by itself. It sets one track's volume
|
|
27
|
+
* (react-native-webrtc's `_setVolume`, unity at 1) or mutes it here only.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** How long a view waits for its first frame before its native view is mounted again (react-native-webrtc #1611). */
|
|
31
|
+
const FIRST_FRAME_TIMEOUT_MS = exports.FIRST_FRAME_TIMEOUT_MS = 3000;
|
|
32
|
+
/** A video track in an RTCView, sized by `style`. */
|
|
33
|
+
function VideoTrack({
|
|
34
|
+
track,
|
|
35
|
+
producerId,
|
|
36
|
+
mirror = false,
|
|
37
|
+
objectFit = 'cover',
|
|
38
|
+
zOrder,
|
|
39
|
+
visible = true,
|
|
40
|
+
onDimensionsChange,
|
|
41
|
+
style,
|
|
42
|
+
testID
|
|
43
|
+
}) {
|
|
44
|
+
const client = (0, _react2.useVoltkitClient)();
|
|
45
|
+
const [url, setUrl] = (0, _react.useState)(null);
|
|
46
|
+
// The RTCView's key: changed once to mount it again when no frame came.
|
|
47
|
+
const [mount, setMount] = (0, _react.useState)(0);
|
|
48
|
+
const sawFrame = (0, _react.useRef)(false);
|
|
49
|
+
const dimensions = (0, _react.useRef)(onDimensionsChange);
|
|
50
|
+
(0, _react.useEffect)(() => {
|
|
51
|
+
dimensions.current = onDimensionsChange;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// The wrapper stream, held while this view shows the track; its URL one frame after mounting.
|
|
55
|
+
(0, _react.useEffect)(() => {
|
|
56
|
+
setUrl(null);
|
|
57
|
+
if (!track) return;
|
|
58
|
+
const view = (0, _streams.streamBook)().view(track);
|
|
59
|
+
if (!view) return;
|
|
60
|
+
let frame = requestAnimationFrame(() => {
|
|
61
|
+
frame = null;
|
|
62
|
+
setUrl(view.url);
|
|
63
|
+
});
|
|
64
|
+
const stopEnd = view.onEnd(() => {
|
|
65
|
+
if (frame !== null) cancelAnimationFrame(frame);
|
|
66
|
+
frame = null;
|
|
67
|
+
setUrl(null);
|
|
68
|
+
});
|
|
69
|
+
return () => {
|
|
70
|
+
if (frame !== null) cancelAnimationFrame(frame);
|
|
71
|
+
stopEnd();
|
|
72
|
+
view.release();
|
|
73
|
+
};
|
|
74
|
+
}, [track]);
|
|
75
|
+
|
|
76
|
+
// react-native-webrtc #1611: a view that never shows a frame is mounted again, once per stream.
|
|
77
|
+
(0, _react.useEffect)(() => {
|
|
78
|
+
sawFrame.current = false;
|
|
79
|
+
if (!url) return;
|
|
80
|
+
const timer = setTimeout(() => {
|
|
81
|
+
if (!sawFrame.current) setMount(n => n + 1);
|
|
82
|
+
}, FIRST_FRAME_TIMEOUT_MS);
|
|
83
|
+
return () => clearTimeout(timer);
|
|
84
|
+
}, [url]);
|
|
85
|
+
|
|
86
|
+
// Adaptive stream: the view reports its size (onLayout) and visibility (`visible`) through a ViewSource.
|
|
87
|
+
const box = (0, _react.useRef)(null);
|
|
88
|
+
const shown = (0, _react.useRef)(visible);
|
|
89
|
+
const reports = (0, _react.useRef)(new Set());
|
|
90
|
+
const tell = (nextBox, nextVisible) => {
|
|
91
|
+
for (const report of [...reports.current]) {
|
|
92
|
+
try {
|
|
93
|
+
report(nextBox, nextVisible);
|
|
94
|
+
} catch (err) {
|
|
95
|
+
(0, _errors.logError)('listener for videoView threw', err);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
(0, _react.useEffect)(() => {
|
|
100
|
+
if (shown.current === visible) return;
|
|
101
|
+
shown.current = visible;
|
|
102
|
+
tell(null, visible);
|
|
103
|
+
}, [visible]);
|
|
104
|
+
(0, _react.useEffect)(() => {
|
|
105
|
+
if (!box.current || box.current.fit === objectFit) return;
|
|
106
|
+
box.current = {
|
|
107
|
+
...box.current,
|
|
108
|
+
fit: objectFit
|
|
109
|
+
};
|
|
110
|
+
tell(box.current, null);
|
|
111
|
+
}, [objectFit]);
|
|
112
|
+
(0, _react.useEffect)(() => {
|
|
113
|
+
const attach = client?.attachVideo;
|
|
114
|
+
if (!client || !producerId || typeof attach !== 'function') return;
|
|
115
|
+
const source = {
|
|
116
|
+
subscribe(onChange) {
|
|
117
|
+
reports.current.add(onChange);
|
|
118
|
+
if (box.current || !shown.current) onChange(box.current, shown.current);
|
|
119
|
+
return () => {
|
|
120
|
+
reports.current.delete(onChange);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
return attach.call(client, producerId, source);
|
|
125
|
+
}, [client, producerId]);
|
|
126
|
+
const onLayout = (0, _react.useCallback)(event => {
|
|
127
|
+
const {
|
|
128
|
+
width,
|
|
129
|
+
height
|
|
130
|
+
} = event.nativeEvent.layout;
|
|
131
|
+
const previous = box.current;
|
|
132
|
+
if (previous && previous.width === width && previous.height === height && previous.fit === objectFit) return;
|
|
133
|
+
box.current = {
|
|
134
|
+
width,
|
|
135
|
+
height,
|
|
136
|
+
fit: objectFit
|
|
137
|
+
};
|
|
138
|
+
tell(box.current, null);
|
|
139
|
+
}, [objectFit]);
|
|
140
|
+
const onFrameSize = (0, _react.useCallback)(event => {
|
|
141
|
+
sawFrame.current = true;
|
|
142
|
+
const {
|
|
143
|
+
width,
|
|
144
|
+
height
|
|
145
|
+
} = event.nativeEvent;
|
|
146
|
+
try {
|
|
147
|
+
dimensions.current?.({
|
|
148
|
+
width,
|
|
149
|
+
height
|
|
150
|
+
});
|
|
151
|
+
} catch (err) {
|
|
152
|
+
(0, _errors.logError)('listener for onDimensionsChange threw', err);
|
|
153
|
+
}
|
|
154
|
+
}, []);
|
|
155
|
+
const RTCView = (0, _globals.loadWebRTC)()?.RTCView;
|
|
156
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
157
|
+
style: style,
|
|
158
|
+
onLayout: onLayout,
|
|
159
|
+
testID: testID,
|
|
160
|
+
collapsable: false,
|
|
161
|
+
children: RTCView && url ? /*#__PURE__*/(0, _jsxRuntime.jsx)(RTCView, {
|
|
162
|
+
streamURL: url,
|
|
163
|
+
mirror: mirror,
|
|
164
|
+
objectFit: objectFit,
|
|
165
|
+
zOrder: zOrder,
|
|
166
|
+
onDimensionsChange: onFrameSize,
|
|
167
|
+
style: _reactNative.StyleSheet.absoluteFill
|
|
168
|
+
}, mount) : null
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/** One remote audio track's volume, or muted, while mounted. Renders nothing: React Native plays remote audio itself. */
|
|
172
|
+
function AudioTrack({
|
|
173
|
+
track,
|
|
174
|
+
volume,
|
|
175
|
+
muted = false
|
|
176
|
+
}) {
|
|
177
|
+
(0, _react.useEffect)(() => {
|
|
178
|
+
const audio = track;
|
|
179
|
+
if (!audio || audio.kind !== 'audio' || typeof audio._setVolume !== 'function') return;
|
|
180
|
+
if (typeof volume !== 'number' || Number.isNaN(volume)) return;
|
|
181
|
+
const gain = Math.min(1, Math.max(0, volume));
|
|
182
|
+
try {
|
|
183
|
+
audio._setVolume(gain);
|
|
184
|
+
} catch (err) {
|
|
185
|
+
(0, _errors.logError)('could not set a track\'s volume', err);
|
|
186
|
+
}
|
|
187
|
+
return () => {
|
|
188
|
+
if (audio.readyState === 'ended') return;
|
|
189
|
+
try {
|
|
190
|
+
audio._setVolume?.(1);
|
|
191
|
+
} catch (err) {
|
|
192
|
+
(0, _errors.logError)('could not set a track\'s volume', err);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}, [track, volume]);
|
|
196
|
+
(0, _react.useEffect)(() => {
|
|
197
|
+
const audio = track;
|
|
198
|
+
if (!audio || !muted) return;
|
|
199
|
+
const was = audio.enabled;
|
|
200
|
+
audio.enabled = false;
|
|
201
|
+
return () => {
|
|
202
|
+
if (audio.readyState !== 'ended') audio.enabled = was;
|
|
203
|
+
};
|
|
204
|
+
}, [track, muted]);
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_react2","_globals","_errors","_streams","_jsxRuntime","FIRST_FRAME_TIMEOUT_MS","exports","VideoTrack","track","producerId","mirror","objectFit","zOrder","visible","onDimensionsChange","style","testID","client","useVoltkitClient","url","setUrl","useState","mount","setMount","sawFrame","useRef","dimensions","useEffect","current","view","streamBook","frame","requestAnimationFrame","stopEnd","onEnd","cancelAnimationFrame","release","timer","setTimeout","n","clearTimeout","box","shown","reports","Set","tell","nextBox","nextVisible","report","err","logError","fit","attach","attachVideo","source","subscribe","onChange","add","delete","call","onLayout","useCallback","event","width","height","nativeEvent","layout","previous","onFrameSize","RTCView","loadWebRTC","jsx","View","collapsable","children","streamURL","StyleSheet","absoluteFill","AudioTrack","volume","muted","audio","kind","_setVolume","Number","isNaN","gain","Math","min","max","readyState","was","enabled"],"sourceRoot":"../../src","sources":["components.tsx"],"mappings":";;;;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAAgD,IAAAM,WAAA,GAAAN,OAAA;AAnBhD;AACA;AACA;AAC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AK;IACrB,OAAO,MAAM;MACX,IAAIX,KAAK,CAACS,UAAU,KAAK,OAAO,EAAET,KAAK,CAACW,OAAO,GAAGD,GAAG;IACvD,CAAC;EACH,CAAC,EAAE,CAACnF,KAAK,EAAEwE,KAAK,CAAC,CAAC;EAElB,OAAO,IAAI;AACb","ignoreList":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createClient = createClient;
|
|
7
|
+
exports.reactNativeClientOptions = reactNativeClientOptions;
|
|
8
|
+
var _client = require("@voltkit-rtc/client");
|
|
9
|
+
var _globals = require("./globals.js");
|
|
10
|
+
var _errors = require("./errors.js");
|
|
11
|
+
var _index = require("./platform/index.js");
|
|
12
|
+
/**
|
|
13
|
+
* A StreamClient for React Native: react-native-webrtc's mediasoup handler (ReactNative106) and this package's
|
|
14
|
+
* platform, with the background pause on for the camera. The provider makes its clients this way; an app that makes and
|
|
15
|
+
* owns its client (the provider's `client` prop, a PK battle's second client) uses createClient.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** What happens to the camera and microphone while the app is in the background. */
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The ClientOptions a React Native client is made with: `{ handlerName: 'ReactNative106', platform,
|
|
22
|
+
* pauseCameraInBackground, pauseMicInBackground, ...clientOptions }`.
|
|
23
|
+
*/
|
|
24
|
+
function reactNativeClientOptions(options = {}) {
|
|
25
|
+
const {
|
|
26
|
+
background,
|
|
27
|
+
clientOptions
|
|
28
|
+
} = options;
|
|
29
|
+
return {
|
|
30
|
+
handlerName: 'ReactNative106',
|
|
31
|
+
platform: (0, _index.reactNativePlatform)(),
|
|
32
|
+
pauseCameraInBackground: background?.pauseCamera ?? true,
|
|
33
|
+
pauseMicInBackground: background?.pauseMic ?? false,
|
|
34
|
+
...clientOptions
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A StreamClient for React Native, not yet connected: call `connect()`. Throws `media-unavailable` with
|
|
40
|
+
* `{ reason: 'webrtc-missing' }` where react-native-webrtc's native module is missing (Expo Go: it needs a development
|
|
41
|
+
* build).
|
|
42
|
+
*/
|
|
43
|
+
function createClient(wsUrl, token, options = {}) {
|
|
44
|
+
if (!(0, _globals.registerVoltkitGlobals)()) throw (0, _errors.webrtcMissing)();
|
|
45
|
+
return new _client.StreamClient(wsUrl, token, reactNativeClientOptions(options));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=create-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_client","require","_globals","_errors","_index","reactNativeClientOptions","options","background","clientOptions","handlerName","platform","reactNativePlatform","pauseCameraInBackground","pauseCamera","pauseMicInBackground","pauseMic","createClient","wsUrl","token","registerVoltkitGlobals","webrtcMissing","StreamClient"],"sourceRoot":"../../src","sources":["create-client.ts"],"mappings":";;;;;;;AAKA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AARA;AACA;AACA;AACA;AACA;;AAMA;;AAmBA;AACA;AACA;AACA;AACO,SAASI,wBAAwBA,CAACC,OAA4B,GAAG,CAAC,CAAC,EAAiB;EACzF,MAAM;IAAEC,UAAU;IAAEC;EAAc,CAAC,GAAGF,OAAO;EAC7C,OAAO;IACLG,WAAW,EAAE,gBAAgB;IAC7BC,QAAQ,EAAE,IAAAC,0BAAmB,EAAC,CAAC;IAC/BC,uBAAuB,EAAEL,UAAU,EAAEM,WAAW,IAAI,IAAI;IACxDC,oBAAoB,EAAEP,UAAU,EAAEQ,QAAQ,IAAI,KAAK;IACnD,GAAGP;EACL,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASQ,YAAYA,CAACC,KAAa,EAAEC,KAAa,EAAEZ,OAA4B,GAAG,CAAC,CAAC,EAAgB;EAC1G,IAAI,CAAC,IAAAa,+BAAsB,EAAC,CAAC,EAAE,MAAM,IAAAC,qBAAa,EAAC,CAAC;EACpD,OAAO,IAAIC,oBAAY,CAACJ,KAAK,EAAEC,KAAK,EAAEb,wBAAwB,CAACC,OAAO,CAAC,CAAC;AAC1E","ignoreList":[]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.callServiceFailed = callServiceFailed;
|
|
7
|
+
exports.describeError = describeError;
|
|
8
|
+
exports.iosUnsupported = iosUnsupported;
|
|
9
|
+
exports.logError = logError;
|
|
10
|
+
exports.nativeFailure = nativeFailure;
|
|
11
|
+
exports.nativeMissing = nativeMissing;
|
|
12
|
+
exports.permissionRefused = permissionRefused;
|
|
13
|
+
exports.webrtcMissing = webrtcMissing;
|
|
14
|
+
var _client = require("@voltkit-rtc/client");
|
|
15
|
+
/**
|
|
16
|
+
* The errors this package raises. Every one is an RpcError with a code from the VoltKit error registry
|
|
17
|
+
* (@voltkit-rtc/client ERROR_CODES, checked code for code against every SDK by scripts/test/sdk-contract-sdks.mjs), so
|
|
18
|
+
* an app switches on `error.code` exactly as it does in a browser or the Android SDK. What is missing goes in `data`:
|
|
19
|
+
*
|
|
20
|
+
* - `media-unavailable` `{ reason: 'webrtc-missing' }`: react-native-webrtc's native module is not in the app (Expo Go,
|
|
21
|
+
* or an app not rebuilt after installing it). The message says it needs a development build.
|
|
22
|
+
* - `media-unavailable` `{ reason: 'native-missing', feature }`: this package's own native module is not in the app.
|
|
23
|
+
* - `media-unavailable` `{ platform: 'ios', feature }`: not in the iOS preview (audio routing: setSpeakerphoneOn,
|
|
24
|
+
* selectAudioOutput, switchDevice('audiooutput')). The call service and screen sharing do not raise it there: the
|
|
25
|
+
* service is simply not declared (useCallService), and the client answers `screen-share-unsupported`.
|
|
26
|
+
* - `media-unavailable` `{ permission: 'camera' | 'microphone', status: 'denied' | 'blocked' }`: a refused permission,
|
|
27
|
+
* the field names of the Android SDK.
|
|
28
|
+
* - `media-unavailable` `{ feature: 'callService' }`: the call service could not start or keep running.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/** react-native-webrtc's native module is missing: Expo Go, or the app was not rebuilt. */
|
|
32
|
+
function webrtcMissing() {
|
|
33
|
+
return new _client.RpcError('media-unavailable', "react-native-webrtc's native module is not in this app: @voltkit-rtc/react-native needs a development build (Expo Go cannot load it). Install react-native-webrtc and rebuild the app (npx expo run:android, or an EAS development build).", {
|
|
34
|
+
reason: 'webrtc-missing'
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** This package's own native module is missing: the app was not rebuilt after installing it. */
|
|
39
|
+
function nativeMissing(feature) {
|
|
40
|
+
return new _client.RpcError('media-unavailable', `${feature} needs @voltkit-rtc/react-native's native module, which is not in this app: it needs a development build. Rebuild the app after installing the package (Expo Go cannot load it).`, {
|
|
41
|
+
reason: 'native-missing',
|
|
42
|
+
feature
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Not in the iOS preview of 0.1.0. */
|
|
47
|
+
function iosUnsupported(feature) {
|
|
48
|
+
return new _client.RpcError('media-unavailable', `${feature} is not available in the iOS preview of @voltkit-rtc/react-native`, {
|
|
49
|
+
platform: 'ios',
|
|
50
|
+
feature
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** A camera or microphone permission the user refused: `blocked` when Android will not ask again. */
|
|
55
|
+
function permissionRefused(permission, status) {
|
|
56
|
+
const what = permission === 'camera' ? 'camera' : 'microphone';
|
|
57
|
+
const why = status === 'blocked' ? `the ${what} permission is blocked: the user has to allow it in the app's settings` : `the ${what} permission was not granted`;
|
|
58
|
+
return new _client.RpcError('media-unavailable', why, {
|
|
59
|
+
permission,
|
|
60
|
+
status
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The call service could not start, or Android stopped it. */
|
|
65
|
+
function callServiceFailed(message) {
|
|
66
|
+
return new _client.RpcError('media-unavailable', `the call service: ${message}`, {
|
|
67
|
+
feature: 'callService'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** A failure a native module or react-native-webrtc reported, as an RpcError with a registry code. */
|
|
72
|
+
function nativeFailure(error, code = 'media-unavailable', data) {
|
|
73
|
+
if (error instanceof _client.RpcError) return error;
|
|
74
|
+
return new _client.RpcError(code, describeError(error), data);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** A readable message from anything thrown: an Error, react-native-webrtc's MediaStreamError (not an Error), a string. */
|
|
78
|
+
function describeError(error) {
|
|
79
|
+
if (typeof error === 'string') return error;
|
|
80
|
+
if (error && typeof error === 'object') {
|
|
81
|
+
const {
|
|
82
|
+
name,
|
|
83
|
+
message
|
|
84
|
+
} = error;
|
|
85
|
+
const text = typeof message === 'string' && message.length > 0 ? message : '';
|
|
86
|
+
const label = typeof name === 'string' && name.length > 0 && name !== 'Error' ? name : '';
|
|
87
|
+
if (label && text && !text.includes(label)) return `${label}: ${text}`;
|
|
88
|
+
if (text) return text;
|
|
89
|
+
if (label) return label;
|
|
90
|
+
}
|
|
91
|
+
return String(error);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Report a failure from code no caller awaits: the error listener's own errors never escape into the app. */
|
|
95
|
+
function logError(context, error) {
|
|
96
|
+
// eslint-disable-next-line no-console
|
|
97
|
+
console.error(`[voltkit-rtc] ${context}`, error);
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_client","require","webrtcMissing","RpcError","reason","nativeMissing","feature","iosUnsupported","platform","permissionRefused","permission","status","what","why","callServiceFailed","message","nativeFailure","error","code","data","describeError","name","text","length","label","includes","String","logError","context","console"],"sourceRoot":"../../src","sources":["errors.ts"],"mappings":";;;;;;;;;;;;;AAeA,IAAAA,OAAA,GAAAC,OAAA;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACO,SAASC,aAAaA,CAAA,EAAa;EACxC,OAAO,IAAIC,gBAAQ,CACjB,mBAAmB,EACnB,4OAA4O,EAC5O;IAAEC,MAAM,EAAE;EAAiB,CAC7B,CAAC;AACH;;AAEA;AACO,SAASC,aAAaA,CAACC,OAAe,EAAY;EACvD,OAAO,IAAIH,gBAAQ,CACjB,mBAAmB,EACnB,GAAGG,OAAO,kLAAkL,EAC5L;IAAEF,MAAM,EAAE,gBAAgB;IAAEE;EAAQ,CACtC,CAAC;AACH;;AAEA;AACO,SAASC,cAAcA,CAACD,OAAe,EAAY;EACxD,OAAO,IAAIH,gBAAQ,CAAC,mBAAmB,EAAE,GAAGG,OAAO,mEAAmE,EAAE;IAAEE,QAAQ,EAAE,KAAK;IAAEF;EAAQ,CAAC,CAAC;AACvJ;;AAEA;AACO,SAASG,iBAAiBA,CAACC,UAA+B,EAAEC,MAA4B,EAAY;EACzG,MAAMC,IAAI,GAAGF,UAAU,KAAK,QAAQ,GAAG,QAAQ,GAAG,YAAY;EAC9D,MAAMG,GAAG,GAAGF,MAAM,KAAK,SAAS,GAC5B,OAAOC,IAAI,wEAAwE,GACnF,OAAOA,IAAI,6BAA6B;EAC5C,OAAO,IAAIT,gBAAQ,CAAC,mBAAmB,EAAEU,GAAG,EAAE;IAAEH,UAAU;IAAEC;EAAO,CAAC,CAAC;AACvE;;AAEA;AACO,SAASG,iBAAiBA,CAACC,OAAe,EAAY;EAC3D,OAAO,IAAIZ,gBAAQ,CAAC,mBAAmB,EAAE,qBAAqBY,OAAO,EAAE,EAAE;IAAET,OAAO,EAAE;EAAc,CAAC,CAAC;AACtG;;AAEA;AACO,SAASU,aAAaA,CAACC,KAAc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C = loadWebRTC;
|
|
7
|
+
exports.registerVoltkitGlobals = registerVoltkitGlobals;
|
|
8
|
+
exports.webrtcAvailable = webrtcAvailable;
|
|
9
|
+
exports.webrtcVersion = webrtcVersion;
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
/**
|
|
12
|
+
* react-native-webrtc, loaded only once its native module is known to be in the app. Its entry module talks to
|
|
13
|
+
* WebRTCModule as soon as it runs, so in Expo Go (or an app not rebuilt after installing it) merely importing it can
|
|
14
|
+
* throw or leave the app in a broken state. This package never imports it at the top level: everything goes through
|
|
15
|
+
* `loadWebRTC()`, which answers null instead, and `registerVoltkitGlobals()` (run when the package is imported) is safe
|
|
16
|
+
* anywhere.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
let loaded = null;
|
|
20
|
+
let registered = false;
|
|
21
|
+
|
|
22
|
+
/** Whether react-native-webrtc's native module is in this app. */
|
|
23
|
+
function webrtcAvailable() {
|
|
24
|
+
return _reactNative.NativeModules.WebRTCModule != null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** react-native-webrtc, or null when its native module is not in the app (Expo Go, an app not rebuilt). */
|
|
28
|
+
function loadWebRTC() {
|
|
29
|
+
if (loaded) return loaded;
|
|
30
|
+
if (!webrtcAvailable()) return null;
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
32
|
+
loaded = require('react-native-webrtc');
|
|
33
|
+
return loaded;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Install react-native-webrtc's WebRTC classes as globals (RTCPeerConnection, MediaStream, ...), which mediasoup-client
|
|
38
|
+
* needs. Runs when the package is imported; calling it again does nothing. Returns false, without throwing, where
|
|
39
|
+
* react-native-webrtc's native module is missing: the provider then reports `media-unavailable` with
|
|
40
|
+
* `{ reason: 'webrtc-missing' }`.
|
|
41
|
+
*/
|
|
42
|
+
function registerVoltkitGlobals() {
|
|
43
|
+
if (registered) return true;
|
|
44
|
+
const webrtc = loadWebRTC();
|
|
45
|
+
if (!webrtc) return false;
|
|
46
|
+
webrtc.registerGlobals();
|
|
47
|
+
registered = true;
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** The version of react-native-webrtc in the app, for getDiagnostics(); null when it cannot be read. */
|
|
52
|
+
function webrtcVersion() {
|
|
53
|
+
try {
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
55
|
+
const pkg = require('react-native-webrtc/package.json');
|
|
56
|
+
return typeof pkg.version === 'string' ? pkg.version : null;
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=globals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","loaded","registered","webrtcAvailable","NativeModules","WebRTCModule","loadWebRTC","registerVoltkitGlobals","webrtc","registerGlobals","webrtcVersion","pkg","version"],"sourceRoot":"../../src","sources":["globals.ts"],"mappings":";;;;;;;;;AAOA,IAAAA,YAAA,GAAAC,OAAA;AAPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,IAAIC,MAA2B,GAAG,IAAI;AACtC,IAAIC,UAAU,GAAG,KAAK;;AAEtB;AACO,SAASC,eAAeA,CAAA,EAAY;EACzC,OAAQC,0BAAa,CAA6BC,YAAY,IAAI,IAAI;AACxE;;AAEA;AACO,SAASC,UAAUA,CAAA,EAAwB;EAChD,IAAIL,MAAM,EAAE,OAAOA,MAAM;EACzB,IAAI,CAACE,eAAe,CAAC,CAAC,EAAE,OAAO,IAAI;EACnC;EACAF,MAAM,GAAGD,OAAO,CAAC,qBAAqB,CAAiB;EACvD,OAAOC,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,sBAAsBA,CAAA,EAAY;EAChD,IAAIL,UAAU,EAAE,OAAO,IAAI;EAC3B,MAAMM,MAAM,GAAGF,UAAU,CAAC,CAAC;EAC3B,IAAI,CAACE,MAAM,EAAE,OAAO,KAAK;EACzBA,MAAM,CAACC,eAAe,CAAC,CAAC;EACxBP,UAAU,GAAG,IAAI;EACjB,OAAO,IAAI;AACb;;AAEA;AACO,SAASQ,aAAaA,CAAA,EAAkB;EAC7C,IAAI;IACF;IACA,MAAMC,GAAG,GAAGX,OAAO,CAAC,kCAAkC,CAA0B;IAChF,OAAO,OAAOW,GAAG,CAACC,OAAO,KAAK,QAAQ,GAAGD,GAAG,CAACC,OAAO,GAAG,IAAI;EAC7D,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AudioTrack", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _components.AudioTrack;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "SDK_VERSION", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _native.SDK_VERSION;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "VideoTrack", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _components.VideoTrack;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "VoltkitProvider", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _provider.VoltkitProvider;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "checkMediaPermissions", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _permissions.checkMediaPermissions;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "createClient", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _createClient.createClient;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "preflight", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _preflight.preflight;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "reactNativeClientOptions", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _createClient.reactNativeClientOptions;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "reactNativePlatform", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _index.reactNativePlatform;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "registerVoltkitGlobals", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _globals.registerVoltkitGlobals;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "requestMediaPermissions", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _permissions.requestMediaPermissions;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "selectAudioOutput", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _audio.selectAudioOutput;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "setSpeakerphoneOn", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _audio.setSpeakerphoneOn;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "useActiveSpeakers", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _react.useActiveSpeakers;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "useAudioLevels", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _react.useAudioLevels;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "useAudioOutput", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _audio.useAudioOutput;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "useCallService", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _nativeSession.useCallService;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "useConnectionState", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _react.useConnectionState;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "useCpuConstrained", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _react.useCpuConstrained;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "useDevices", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _react.useDevices;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "useIsSpeaking", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _react.useIsSpeaking;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "useLocalMedia", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _localMedia.useLocalMedia;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "useMediaWarnings", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _react.useMediaWarnings;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "useNetworkQuality", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _react.useNetworkQuality;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "useParticipants", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _react.useParticipants;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "usePermissions", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _permissions.usePermissions;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "usePublishFallback", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _react.usePublishFallback;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "useRemoteTracks", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _react.useRemoteTracks;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "useRoom", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _react.useRoom;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "useStreamFallback", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _react.useStreamFallback;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "useVoltkitClient", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _react.useVoltkitClient;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "useVoltkitEvent", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _react.useVoltkitEvent;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "useWalletLow", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _react.useWalletLow;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
var _globals = require("./globals.js");
|
|
205
|
+
var _createClient = require("./create-client.js");
|
|
206
|
+
var _preflight = require("./preflight.js");
|
|
207
|
+
var _index = require("./platform/index.js");
|
|
208
|
+
var _provider = require("./provider.js");
|
|
209
|
+
var _nativeSession = require("./native-session.js");
|
|
210
|
+
var _localMedia = require("./local-media.js");
|
|
211
|
+
var _components = require("./components.js");
|
|
212
|
+
var _audio = require("./audio.js");
|
|
213
|
+
var _permissions = require("./permissions.js");
|
|
214
|
+
var _native = require("./native.js");
|
|
215
|
+
var _react = require("@voltkit-rtc/react");
|
|
216
|
+
/**
|
|
217
|
+
* @voltkit-rtc/react-native: VoltKit RTC calls, audio rooms and live video in React Native (Android; iOS in preview),
|
|
218
|
+
* with the hooks of @voltkit-rtc/react on @voltkit-rtc/client, react-native-webrtc for WebRTC, and native background
|
|
219
|
+
* calls, audio routing and an Expo config plugin.
|
|
220
|
+
*
|
|
221
|
+
* Importing it installs react-native-webrtc's globals (registerVoltkitGlobals), which does nothing and throws nothing
|
|
222
|
+
* where react-native-webrtc's native module is missing (Expo Go): the provider then reports it.
|
|
223
|
+
*
|
|
224
|
+
* A React call screen ports by changing the import: VoltkitProvider, useLocalMedia, VideoTrack and AudioTrack are this
|
|
225
|
+
* package's own, and every other hook is @voltkit-rtc/react's, re-exported. ChatClient and RpcError come from
|
|
226
|
+
* @voltkit-rtc/client, as with React.
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
(0, _globals.registerVoltkitGlobals)();
|
|
230
|
+
|
|
231
|
+
// The hooks of @voltkit-rtc/react, unchanged: they read the client this package's provider makes.
|
|
232
|
+
|
|
233
|
+
// The SDK's types these hooks take and return, so an app needs one import.
|
|
234
|
+
//# sourceMappingURL=index.js.map
|