tirtc-react-native 2.2.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/LICENSE +11 -0
- package/README.md +140 -0
- package/TiRtcReactNative.podspec +35 -0
- package/android/build.gradle +37 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcModule.kt +482 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcPackage.kt +43 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeErrors.kt +32 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeEventBinder.kt +99 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeEventSink.kt +168 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeMaps.kt +49 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeMetricsMaps.kt +173 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeModuleSupport.kt +91 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeOptions.kt +127 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeRegistry.kt +71 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcVideoInputPreviewManager.kt +109 -0
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcVideoOutputViewManager.kt +109 -0
- package/ios/TiRtcReactNative+Conn.mm +112 -0
- package/ios/TiRtcReactNative+Input.mm +196 -0
- package/ios/TiRtcReactNative+Output.mm +172 -0
- package/ios/TiRtcReactNative+Private.h +28 -0
- package/ios/TiRtcReactNative.h +6 -0
- package/ios/TiRtcReactNative.mm +189 -0
- package/ios/TiRtcReactNativeErrors.h +18 -0
- package/ios/TiRtcReactNativeErrors.mm +105 -0
- package/ios/TiRtcReactNativeEventBinder.h +19 -0
- package/ios/TiRtcReactNativeEventBinder.mm +226 -0
- package/ios/TiRtcReactNativeEventSink.h +29 -0
- package/ios/TiRtcReactNativeEventSink.mm +125 -0
- package/ios/TiRtcReactNativeMaps.h +21 -0
- package/ios/TiRtcReactNativeMaps.mm +249 -0
- package/ios/TiRtcReactNativeNative.h +8 -0
- package/ios/TiRtcReactNativeOptions.h +11 -0
- package/ios/TiRtcReactNativeOptions.mm +123 -0
- package/ios/TiRtcReactNativeRegistry.h +20 -0
- package/ios/TiRtcReactNativeRegistry.mm +119 -0
- package/ios/TiRtcVideoInputPreview.h +5 -0
- package/ios/TiRtcVideoInputPreview.mm +149 -0
- package/ios/TiRtcVideoOutputView.h +5 -0
- package/ios/TiRtcVideoOutputView.mm +149 -0
- package/lib/module/audio_input.js +177 -0
- package/lib/module/audio_input.js.map +1 -0
- package/lib/module/audio_output.js +168 -0
- package/lib/module/audio_output.js.map +1 -0
- package/lib/module/conn.js +174 -0
- package/lib/module/conn.js.map +1 -0
- package/lib/module/errors.js +63 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/events.js +37 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/logging.js +26 -0
- package/lib/module/logging.js.map +1 -0
- package/lib/module/native.js +5 -0
- package/lib/module/native.js.map +1 -0
- package/lib/module/native_object_id.js +47 -0
- package/lib/module/native_object_id.js.map +1 -0
- package/lib/module/runtime.js +27 -0
- package/lib/module/runtime.js.map +1 -0
- package/lib/module/specs/NativeTiRtc.js +3 -0
- package/lib/module/specs/NativeTiRtc.js.map +1 -0
- package/lib/module/specs/TiRtcVideoInputPreviewNativeComponent.js +24 -0
- package/lib/module/specs/TiRtcVideoOutputViewNativeComponent.js +24 -0
- package/lib/module/types.js +93 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/video_input.js +266 -0
- package/lib/module/video_input.js.map +1 -0
- package/lib/module/video_output.js +224 -0
- package/lib/module/video_output.js.map +1 -0
- package/lib/typescript/audio_input.d.ts +25 -0
- package/lib/typescript/audio_output.d.ts +25 -0
- package/lib/typescript/conn.d.ts +28 -0
- package/lib/typescript/errors.d.ts +19 -0
- package/lib/typescript/events.d.ts +6 -0
- package/lib/typescript/index.d.ts +9 -0
- package/lib/typescript/logging.d.ts +9 -0
- package/lib/typescript/native.d.ts +5 -0
- package/lib/typescript/native_object_id.d.ts +12 -0
- package/lib/typescript/runtime.d.ts +8 -0
- package/lib/typescript/specs/NativeTiRtc.d.ts +223 -0
- package/lib/typescript/specs/TiRtcVideoInputPreviewNativeComponent.d.ts +8 -0
- package/lib/typescript/specs/TiRtcVideoOutputViewNativeComponent.d.ts +8 -0
- package/lib/typescript/types.d.ts +281 -0
- package/lib/typescript/video_input.d.ts +50 -0
- package/lib/typescript/video_output.d.ts +46 -0
- package/package.json +80 -0
- package/react-native.config.js +10 -0
- package/src/audio_input.ts +205 -0
- package/src/audio_output.ts +202 -0
- package/src/conn.ts +222 -0
- package/src/errors.ts +81 -0
- package/src/events.ts +44 -0
- package/src/index.ts +61 -0
- package/src/logging.ts +33 -0
- package/src/native.ts +6 -0
- package/src/native_object_id.ts +63 -0
- package/src/runtime.ts +32 -0
- package/src/specs/NativeTiRtc.ts +256 -0
- package/src/specs/TiRtcVideoInputPreviewNativeComponent.ts +14 -0
- package/src/specs/TiRtcVideoOutputViewNativeComponent.ts +12 -0
- package/src/types.ts +340 -0
- package/src/video_input.ts +314 -0
- package/src/video_output.ts +273 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {isPositiveInt32} from './errors';
|
|
2
|
+
|
|
3
|
+
export type NativeIdentity = Readonly<{
|
|
4
|
+
objectId: number;
|
|
5
|
+
generation: number;
|
|
6
|
+
}>;
|
|
7
|
+
|
|
8
|
+
type NativeIdentityListener = () => void;
|
|
9
|
+
|
|
10
|
+
const nativeIdentities = new WeakMap<object, NativeIdentity>();
|
|
11
|
+
const identityListeners = new WeakMap<object, Set<NativeIdentityListener>>();
|
|
12
|
+
|
|
13
|
+
export function isNativeIdentity(value: unknown): value is NativeIdentity {
|
|
14
|
+
return (
|
|
15
|
+
typeof value === 'object'
|
|
16
|
+
&& value !== null
|
|
17
|
+
&& isPositiveInt32((value as NativeIdentity).objectId)
|
|
18
|
+
&& isPositiveInt32((value as NativeIdentity).generation)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function setNativeIdentity(owner: object, identity: NativeIdentity): void {
|
|
23
|
+
nativeIdentities.set(owner, identity);
|
|
24
|
+
emitNativeIdentityChanged(owner);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function clearNativeIdentity(owner: object): void {
|
|
28
|
+
nativeIdentities.delete(owner);
|
|
29
|
+
emitNativeIdentityChanged(owner);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function readNativeIdentity(owner: unknown): NativeIdentity | null {
|
|
33
|
+
if (typeof owner !== 'object' || owner === null) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return nativeIdentities.get(owner) ?? null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function readNativeObjectId(owner: unknown): number | null {
|
|
40
|
+
return readNativeIdentity(owner)?.objectId ?? null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function subscribeNativeIdentity(owner: object, listener: NativeIdentityListener): () => void {
|
|
44
|
+
let listeners = identityListeners.get(owner);
|
|
45
|
+
if (listeners === undefined) {
|
|
46
|
+
listeners = new Set();
|
|
47
|
+
identityListeners.set(owner, listeners);
|
|
48
|
+
}
|
|
49
|
+
listeners.add(listener);
|
|
50
|
+
return () => {
|
|
51
|
+
listeners?.delete(listener);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function emitNativeIdentityChanged(owner: object): void {
|
|
56
|
+
const listeners = identityListeners.get(owner);
|
|
57
|
+
if (listeners === undefined) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
for (const listener of Array.from(listeners)) {
|
|
61
|
+
listener();
|
|
62
|
+
}
|
|
63
|
+
}
|
package/src/runtime.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {isPlainObject, TIRTC_ERROR_INVALID_ARGUMENT} from './errors';
|
|
2
|
+
import {NativeTiRtc} from './native';
|
|
3
|
+
import type {TiRtcInitOptions} from './types';
|
|
4
|
+
|
|
5
|
+
export class TiRtc {
|
|
6
|
+
private constructor() {}
|
|
7
|
+
|
|
8
|
+
static initialize(config: TiRtcInitOptions): Promise<number> {
|
|
9
|
+
if (!isPlainObject(config)) {
|
|
10
|
+
return Promise.resolve(TIRTC_ERROR_INVALID_ARGUMENT);
|
|
11
|
+
}
|
|
12
|
+
return NativeTiRtc.initialize({
|
|
13
|
+
appId: typeof config.appId === 'string' ? config.appId : '',
|
|
14
|
+
endpoint: typeof config.endpoint === 'string' ? config.endpoint : '',
|
|
15
|
+
consoleLogEnabled: typeof config.consoleLogEnabled === 'boolean'
|
|
16
|
+
? config.consoleLogEnabled
|
|
17
|
+
: false,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static shutdown(): number {
|
|
22
|
+
return NativeTiRtc.shutdown();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static errorToString(code: number): string {
|
|
26
|
+
return NativeTiRtc.errorToString(code);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static formatError(code: number): string {
|
|
30
|
+
return `error ${TiRtc.errorToString(code)} (${code})`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import type {TurboModule, CodegenTypes} from 'react-native';
|
|
2
|
+
import {TurboModuleRegistry} from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type NativeObjectId = number;
|
|
5
|
+
export type NativeBytes = ReadonlyArray<number>;
|
|
6
|
+
|
|
7
|
+
export type NativeCreateResult = Readonly<{
|
|
8
|
+
code: number;
|
|
9
|
+
objectId: NativeObjectId;
|
|
10
|
+
generation: number;
|
|
11
|
+
message: string | null;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
export type NativeInitOptions = Readonly<{
|
|
15
|
+
appId: string;
|
|
16
|
+
endpoint: string;
|
|
17
|
+
consoleLogEnabled: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export type NativeSize = Readonly<{
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export type NativeAudioOutputOptions = Readonly<{
|
|
26
|
+
agcLevel: 'disabled' | 'low' | 'medium' | 'high';
|
|
27
|
+
ansLevel: 'disabled' | 'low' | 'medium' | 'high';
|
|
28
|
+
bufferStrategy: 'automatic' | 'noBuffer';
|
|
29
|
+
maxBufferWatermarkMs: number | null;
|
|
30
|
+
}>;
|
|
31
|
+
|
|
32
|
+
export type NativeVideoOutputOptions = Readonly<{
|
|
33
|
+
decoderPreference: 'auto' | 'software' | 'hardware';
|
|
34
|
+
bufferStrategy: 'automatic' | 'noBuffer';
|
|
35
|
+
maxBufferWatermarkMs: number | null;
|
|
36
|
+
}>;
|
|
37
|
+
|
|
38
|
+
export type NativeAudioInputOptions = Readonly<{
|
|
39
|
+
codec: 'g711a' | 'aac' | 'pcm' | 'opus' | 'amr';
|
|
40
|
+
sampleRate: 'rate8k' | 'rate16k';
|
|
41
|
+
channels: 'mono';
|
|
42
|
+
aecMode: 'disabled' | 'enabled';
|
|
43
|
+
agcLevel: 'disabled' | 'low' | 'medium' | 'high';
|
|
44
|
+
ansLevel: 'disabled' | 'low' | 'medium' | 'high';
|
|
45
|
+
}>;
|
|
46
|
+
|
|
47
|
+
export type NativeVideoInputOptions = Readonly<{
|
|
48
|
+
codec: 'h264' | 'mjpeg';
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
frameRate: 'fps10' | 'fps15' | 'fps30';
|
|
52
|
+
bitrateKbps: number;
|
|
53
|
+
cameraFacing: 'front' | 'back';
|
|
54
|
+
}>;
|
|
55
|
+
|
|
56
|
+
export type NativeStateResult = Readonly<{
|
|
57
|
+
code: number;
|
|
58
|
+
state: string | null;
|
|
59
|
+
}>;
|
|
60
|
+
|
|
61
|
+
export type NativeSizeResult = Readonly<{
|
|
62
|
+
code: number;
|
|
63
|
+
size: NativeSize | null;
|
|
64
|
+
}>;
|
|
65
|
+
|
|
66
|
+
export type NativeVideoInputActualConfigResult = Readonly<{
|
|
67
|
+
code: number;
|
|
68
|
+
size: NativeSize | null;
|
|
69
|
+
fps: number | null;
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
export type NativeLoggingUploadResult = Readonly<{
|
|
73
|
+
code: number;
|
|
74
|
+
logId: string | null;
|
|
75
|
+
}>;
|
|
76
|
+
|
|
77
|
+
export type NativeTiRtcEvent = Readonly<{
|
|
78
|
+
type: string;
|
|
79
|
+
objectId: NativeObjectId;
|
|
80
|
+
generation: number;
|
|
81
|
+
state?: string;
|
|
82
|
+
errorCode?: number;
|
|
83
|
+
code?: number;
|
|
84
|
+
message?: string | null;
|
|
85
|
+
commandId?: number;
|
|
86
|
+
streamId?: number;
|
|
87
|
+
timestampMs?: number;
|
|
88
|
+
data?: NativeBytes;
|
|
89
|
+
size?: NativeSize;
|
|
90
|
+
fps?: number;
|
|
91
|
+
}>;
|
|
92
|
+
|
|
93
|
+
type NativeConnMetricsResult = Readonly<{
|
|
94
|
+
code: number;
|
|
95
|
+
snapshot: Readonly<{
|
|
96
|
+
hasConnectStart: boolean;
|
|
97
|
+
hasConnected: boolean;
|
|
98
|
+
connectStartMonotonicMs: number;
|
|
99
|
+
connectedMonotonicMs: number;
|
|
100
|
+
isReady: boolean;
|
|
101
|
+
connectDurationMs: number | null;
|
|
102
|
+
}> | null;
|
|
103
|
+
}>;
|
|
104
|
+
|
|
105
|
+
type NativeOutputStartupMetrics = Readonly<{
|
|
106
|
+
hasConnectStart: boolean;
|
|
107
|
+
hasConnected: boolean;
|
|
108
|
+
hasFirstPacket: boolean;
|
|
109
|
+
hasFirstOutput: boolean;
|
|
110
|
+
connectStartMonotonicMs: number;
|
|
111
|
+
connectedMonotonicMs: number;
|
|
112
|
+
firstPacketMonotonicMs: number;
|
|
113
|
+
firstOutputMonotonicMs: number;
|
|
114
|
+
firstPacketAfterConnectedMs: number;
|
|
115
|
+
firstOutputAfterConnectedMs: number;
|
|
116
|
+
timeToFirstOutputMs: number;
|
|
117
|
+
}>;
|
|
118
|
+
|
|
119
|
+
type NativeOutputStutterMetrics = Readonly<{
|
|
120
|
+
stutterThresholdMs: number;
|
|
121
|
+
outputDurationMs: number;
|
|
122
|
+
stutterTotalMs: number;
|
|
123
|
+
stutterCount: number;
|
|
124
|
+
stutterPeakMs: number;
|
|
125
|
+
stutterAverageMs: number;
|
|
126
|
+
stutterRatePercent: number;
|
|
127
|
+
}>;
|
|
128
|
+
|
|
129
|
+
type NativeAudioOutputMetricsResult = Readonly<{
|
|
130
|
+
code: number;
|
|
131
|
+
snapshot: Readonly<{
|
|
132
|
+
startup: NativeOutputStartupMetrics;
|
|
133
|
+
stutter: NativeOutputStutterMetrics;
|
|
134
|
+
estimatedOutputLatencyMs: number;
|
|
135
|
+
audioCodec: 'g711a' | 'aac' | 'pcm' | 'opus' | 'amr' | null;
|
|
136
|
+
audioSampleRateHz: number;
|
|
137
|
+
audioChannels: number;
|
|
138
|
+
audioInputBitrateKbps: number;
|
|
139
|
+
audioInputPacketRate: number;
|
|
140
|
+
audioRenderCallbackRate: number;
|
|
141
|
+
statsRefreshIntervalMs: number;
|
|
142
|
+
statsUpdatedAtMonotonicMs: number;
|
|
143
|
+
}> | null;
|
|
144
|
+
}>;
|
|
145
|
+
|
|
146
|
+
type NativeVideoOutputMetricsResult = Readonly<{
|
|
147
|
+
code: number;
|
|
148
|
+
snapshot: Readonly<{
|
|
149
|
+
startup: NativeOutputStartupMetrics;
|
|
150
|
+
stutter: NativeOutputStutterMetrics;
|
|
151
|
+
estimatedOutputLatencyMs: number;
|
|
152
|
+
videoCodec: 'h264' | 'h265' | 'mjpeg' | null;
|
|
153
|
+
videoWidth: number;
|
|
154
|
+
videoHeight: number;
|
|
155
|
+
decoderBackend: 'unknown' | 'software' | 'hardware';
|
|
156
|
+
videoInputBitrateKbps: number;
|
|
157
|
+
videoInputFps: number;
|
|
158
|
+
videoDecodedFps: number;
|
|
159
|
+
videoRenderFps: number;
|
|
160
|
+
statsRefreshIntervalMs: number;
|
|
161
|
+
statsUpdatedAtMonotonicMs: number;
|
|
162
|
+
}> | null;
|
|
163
|
+
}>;
|
|
164
|
+
|
|
165
|
+
type NativeAudioOutputDebugSnapshotResult = Readonly<{
|
|
166
|
+
code: number;
|
|
167
|
+
snapshot: Readonly<{
|
|
168
|
+
codec: 'g711a' | 'aac' | 'pcm' | 'opus' | 'amr' | null;
|
|
169
|
+
sampleRateHz: number;
|
|
170
|
+
channels: number;
|
|
171
|
+
}> | null;
|
|
172
|
+
}>;
|
|
173
|
+
|
|
174
|
+
type NativeVideoOutputDebugSnapshotResult = Readonly<{
|
|
175
|
+
code: number;
|
|
176
|
+
snapshot: Readonly<{
|
|
177
|
+
codec: 'h264' | 'h265' | 'mjpeg' | null;
|
|
178
|
+
bitstreamFormat: 'unknown' | 'h264AnnexB' | 'h265AnnexB' | 'mjpegJfif';
|
|
179
|
+
width: number;
|
|
180
|
+
height: number;
|
|
181
|
+
decoderPreference: 'auto' | 'software' | 'hardware';
|
|
182
|
+
resolvedDecoderBackend: 'unknown' | 'software' | 'hardware';
|
|
183
|
+
}> | null;
|
|
184
|
+
}>;
|
|
185
|
+
|
|
186
|
+
interface Spec extends TurboModule {
|
|
187
|
+
readonly onTiRtcEvent: CodegenTypes.EventEmitter<NativeTiRtcEvent>;
|
|
188
|
+
|
|
189
|
+
initialize(options: NativeInitOptions): Promise<number>;
|
|
190
|
+
shutdown(): number;
|
|
191
|
+
errorToString(code: number): string;
|
|
192
|
+
writeLog(level: number, tag: string, message: string): void;
|
|
193
|
+
uploadLogs(): Promise<NativeLoggingUploadResult>;
|
|
194
|
+
|
|
195
|
+
createConn(): NativeCreateResult;
|
|
196
|
+
connGetState(id: NativeObjectId): NativeStateResult;
|
|
197
|
+
connConnect(id: NativeObjectId, remoteId: string, token: string): number;
|
|
198
|
+
connDisconnect(id: NativeObjectId): number;
|
|
199
|
+
connSendCommand(id: NativeObjectId, commandId: number, data: NativeBytes): number;
|
|
200
|
+
connSendStreamMessage(
|
|
201
|
+
id: NativeObjectId,
|
|
202
|
+
streamId: number,
|
|
203
|
+
timestampMs: number,
|
|
204
|
+
data: NativeBytes,
|
|
205
|
+
): number;
|
|
206
|
+
connSubscribeVideo(id: NativeObjectId, streamId: number): number;
|
|
207
|
+
connUnsubscribeVideo(id: NativeObjectId, streamId: number): number;
|
|
208
|
+
connSubscribeAudio(id: NativeObjectId, streamId: number): number;
|
|
209
|
+
connUnsubscribeAudio(id: NativeObjectId, streamId: number): number;
|
|
210
|
+
connRequestKeyFrame(id: NativeObjectId, streamId: number): number;
|
|
211
|
+
connGetMetricsSnapshot(id: NativeObjectId): NativeConnMetricsResult;
|
|
212
|
+
connDispose(id: NativeObjectId): number;
|
|
213
|
+
|
|
214
|
+
createAudioOutput(): NativeCreateResult;
|
|
215
|
+
audioOutputGetState(id: NativeObjectId): NativeStateResult;
|
|
216
|
+
audioOutputConfigure(id: NativeObjectId, options: NativeAudioOutputOptions): number;
|
|
217
|
+
audioOutputSetVolume(id: NativeObjectId, volumePercent: number): number;
|
|
218
|
+
audioOutputAttach(id: NativeObjectId, connId: NativeObjectId, streamId: number): number;
|
|
219
|
+
audioOutputDetach(id: NativeObjectId): number;
|
|
220
|
+
audioOutputGetMetricsSnapshot(id: NativeObjectId): NativeAudioOutputMetricsResult;
|
|
221
|
+
audioOutputResetMetricsSession(id: NativeObjectId): number;
|
|
222
|
+
audioOutputGetDebugSnapshot(id: NativeObjectId): NativeAudioOutputDebugSnapshotResult;
|
|
223
|
+
audioOutputDispose(id: NativeObjectId): number;
|
|
224
|
+
|
|
225
|
+
createVideoOutput(): NativeCreateResult;
|
|
226
|
+
videoOutputGetState(id: NativeObjectId): NativeStateResult;
|
|
227
|
+
videoOutputGetRenderSize(id: NativeObjectId): NativeSizeResult;
|
|
228
|
+
videoOutputSetOptions(id: NativeObjectId, options: NativeVideoOutputOptions): number;
|
|
229
|
+
videoOutputAttach(id: NativeObjectId, connId: NativeObjectId, streamId: number): number;
|
|
230
|
+
videoOutputDetach(id: NativeObjectId): number;
|
|
231
|
+
videoOutputGetMetricsSnapshot(id: NativeObjectId): NativeVideoOutputMetricsResult;
|
|
232
|
+
videoOutputResetMetricsSession(id: NativeObjectId): number;
|
|
233
|
+
videoOutputGetDebugSnapshot(id: NativeObjectId): NativeVideoOutputDebugSnapshotResult;
|
|
234
|
+
videoOutputDispose(id: NativeObjectId): number;
|
|
235
|
+
|
|
236
|
+
createAudioInput(): NativeCreateResult;
|
|
237
|
+
audioInputGetState(id: NativeObjectId): NativeStateResult;
|
|
238
|
+
audioInputSetOptions(id: NativeObjectId, options: NativeAudioInputOptions): Promise<number>;
|
|
239
|
+
audioInputAttach(id: NativeObjectId, connId: NativeObjectId, streamId: number): Promise<number>;
|
|
240
|
+
audioInputStart(id: NativeObjectId): Promise<number>;
|
|
241
|
+
audioInputStop(id: NativeObjectId): Promise<number>;
|
|
242
|
+
audioInputDetach(id: NativeObjectId, connId: NativeObjectId): Promise<number>;
|
|
243
|
+
audioInputDispose(id: NativeObjectId): Promise<number>;
|
|
244
|
+
|
|
245
|
+
createVideoInput(): NativeCreateResult;
|
|
246
|
+
videoInputGetState(id: NativeObjectId): NativeStateResult;
|
|
247
|
+
videoInputGetActualConfig(id: NativeObjectId): NativeVideoInputActualConfigResult;
|
|
248
|
+
videoInputSetOptions(id: NativeObjectId, options: NativeVideoInputOptions): Promise<number>;
|
|
249
|
+
videoInputAttach(id: NativeObjectId, connId: NativeObjectId, streamId: number): Promise<number>;
|
|
250
|
+
videoInputStart(id: NativeObjectId): Promise<number>;
|
|
251
|
+
videoInputStop(id: NativeObjectId): Promise<number>;
|
|
252
|
+
videoInputDetach(id: NativeObjectId, connId: NativeObjectId): Promise<number>;
|
|
253
|
+
videoInputDispose(id: NativeObjectId): Promise<number>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('TiRtc');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {codegenNativeComponent, type CodegenTypes, type ViewProps} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface NativeTiRtcVideoInputPreviewProps extends ViewProps {
|
|
4
|
+
readonly nativeObjectId: CodegenTypes.Int32;
|
|
5
|
+
readonly generation: CodegenTypes.Int32;
|
|
6
|
+
readonly resizeMode?: CodegenTypes.WithDefault<
|
|
7
|
+
'contain' | 'cover' | 'stretch',
|
|
8
|
+
'contain'
|
|
9
|
+
>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default codegenNativeComponent<NativeTiRtcVideoInputPreviewProps>(
|
|
13
|
+
'TiRtcVideoInputPreview',
|
|
14
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {codegenNativeComponent, type CodegenTypes, type ViewProps} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface NativeTiRtcVideoOutputViewProps extends ViewProps {
|
|
4
|
+
readonly nativeObjectId: CodegenTypes.Int32;
|
|
5
|
+
readonly generation: CodegenTypes.Int32;
|
|
6
|
+
readonly resizeMode?: CodegenTypes.WithDefault<
|
|
7
|
+
'contain' | 'cover' | 'stretch',
|
|
8
|
+
'contain'
|
|
9
|
+
>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default codegenNativeComponent<NativeTiRtcVideoOutputViewProps>('TiRtcVideoOutputView');
|