tirtc-react-native 2.4.0-alpha.3 → 2.4.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/README.md +6 -6
- package/TiRtcReactNative.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcModule.kt +146 -109
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeCleanup.kt +23 -23
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeEventBinder.kt +21 -24
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeEventSink.kt +6 -10
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeMaps.kt +5 -5
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcReactNativeRegistry.kt +11 -11
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/{TiRtcReactNativeStoreSupport.kt → TiRtcReactNativeStorageSupport.kt} +9 -9
- package/android/src/main/java/com/tange/ai/tirtc/reactnative/TiRtcVideoOutputViewManager.kt +2 -2
- package/ios/TiRtcReactNative+Conn.mm +5 -5
- package/ios/TiRtcReactNative+Storage.mm +513 -0
- package/ios/TiRtcReactNative.mm +19 -19
- package/ios/TiRtcReactNativeEventBinder.h +8 -8
- package/ios/TiRtcReactNativeEventBinder.mm +31 -33
- package/ios/TiRtcReactNativeEventSink.h +3 -4
- package/ios/TiRtcReactNativeEventSink.mm +6 -10
- package/ios/TiRtcVideoOutputView.mm +4 -4
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/{store.js → storage.js} +184 -176
- package/lib/module/storage.js.map +1 -0
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/specs/NativeTiRtc.d.ts +42 -42
- package/lib/typescript/storage.d.ts +204 -0
- package/package.json +1 -1
- package/src/index.ts +44 -44
- package/src/specs/NativeTiRtc.ts +47 -47
- package/src/storage.ts +769 -0
- package/ios/TiRtcReactNative+Store.mm +0 -496
- package/lib/module/store.js.map +0 -1
- package/lib/typescript/store.d.ts +0 -202
- package/src/store.ts +0 -760
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type ViewProps } from 'react-native';
|
|
3
|
-
import { NativeTiRtc, type NativeTiRtcEvent } from './native';
|
|
4
|
-
import { type NativeIdentity } from './native_object_id';
|
|
5
|
-
import { type Resp, type TiRtcGalleryAsset } from './recording';
|
|
6
|
-
export declare const TISTORE_ERROR_OK: 0;
|
|
7
|
-
export declare const TISTORE_ERROR_INVALID_ARGUMENT: 6000;
|
|
8
|
-
export declare const TISTORE_ERROR_NOT_INITIALIZED: 6001;
|
|
9
|
-
export declare const TISTORE_ERROR_TOKEN_EXPIRED: 6014;
|
|
10
|
-
export declare const TISTORE_ERROR_ALREADY_INITIALIZED: 6022;
|
|
11
|
-
export declare const TISTORE_ERROR_PERMISSION_DENIED: 6024;
|
|
12
|
-
export declare const TISTORE_ERROR_IN_USE: 6026;
|
|
13
|
-
export declare const TISTORE_ERROR_NOT_STARTED: 6027;
|
|
14
|
-
export declare const TISTORE_ERROR_NOT_BOUND: 6029;
|
|
15
|
-
export declare const TISTORE_ERROR_NOT_CONFIGURED: 6030;
|
|
16
|
-
export declare const TISTORE_ERROR_RESOURCE_EXHAUSTED: 6043;
|
|
17
|
-
export declare const TISTORE_ERROR_FILE_WRITE_FAILED: 6046;
|
|
18
|
-
export declare const TISTORE_ERROR_UNSUPPORTED_FORMAT: 6113;
|
|
19
|
-
export declare const TISTORE_ERROR_IO_FAILED: 6114;
|
|
20
|
-
export declare const TISTORE_ERROR_CANCELLED: 6115;
|
|
21
|
-
export declare const TISTORE_ERROR_RANGE_TOO_LARGE: 6117;
|
|
22
|
-
export declare const TISTORE_ERROR_NO_FRAME: 6118;
|
|
23
|
-
export declare const TISTORE_ERROR_NO_RECORDABLE_MEDIA: 6119;
|
|
24
|
-
export declare const TISTORE_ERROR_RECORDING_OVERRUN: 6120;
|
|
25
|
-
export declare const TISTORE_ERROR_RECORDING_UNREADABLE: 6122;
|
|
26
|
-
export declare const TISTORE_ERROR_STORE_UNAVAILABLE: 6123;
|
|
27
|
-
export declare const TISTORE_ERROR_STOPPED: 6124;
|
|
28
|
-
export type TiStoreRecordingRange = Readonly<{
|
|
29
|
-
startTimeMs: number;
|
|
30
|
-
endTimeMs: number;
|
|
31
|
-
}>;
|
|
32
|
-
export type TiStoreRecordingRangesResult = Readonly<{
|
|
33
|
-
code: number;
|
|
34
|
-
recordings: ReadonlyArray<TiStoreRecordingRange>;
|
|
35
|
-
}>;
|
|
36
|
-
export type TiStoreRecordingDay = Readonly<{
|
|
37
|
-
date: string;
|
|
38
|
-
hasRecording: boolean;
|
|
39
|
-
}>;
|
|
40
|
-
export type TiStoreRecordingDaysResult = Readonly<{
|
|
41
|
-
code: number;
|
|
42
|
-
days: ReadonlyArray<TiStoreRecordingDay>;
|
|
43
|
-
}>;
|
|
44
|
-
export declare const TiStoreReplaySpeed: {
|
|
45
|
-
readonly x1: "x1";
|
|
46
|
-
readonly x2: "x2";
|
|
47
|
-
readonly x4: "x4";
|
|
48
|
-
readonly x8: "x8";
|
|
49
|
-
};
|
|
50
|
-
export type TiStoreReplaySpeed = (typeof TiStoreReplaySpeed)[keyof typeof TiStoreReplaySpeed];
|
|
51
|
-
export declare const TiStoreAudioOutputState: {
|
|
52
|
-
readonly idle: "idle";
|
|
53
|
-
readonly buffering: "buffering";
|
|
54
|
-
readonly playing: "playing";
|
|
55
|
-
readonly failed: "failed";
|
|
56
|
-
readonly paused: "paused";
|
|
57
|
-
readonly completed: "completed";
|
|
58
|
-
};
|
|
59
|
-
export type TiStoreAudioOutputState = (typeof TiStoreAudioOutputState)[keyof typeof TiStoreAudioOutputState];
|
|
60
|
-
export declare const TiStoreVideoOutputState: {
|
|
61
|
-
readonly idle: "idle";
|
|
62
|
-
readonly buffering: "buffering";
|
|
63
|
-
readonly rendering: "rendering";
|
|
64
|
-
readonly failed: "failed";
|
|
65
|
-
readonly paused: "paused";
|
|
66
|
-
readonly completed: "completed";
|
|
67
|
-
};
|
|
68
|
-
export type TiStoreVideoOutputState = (typeof TiStoreVideoOutputState)[keyof typeof TiStoreVideoOutputState];
|
|
69
|
-
export type TiStoreStartRecordingOptions = Readonly<{
|
|
70
|
-
videoChannelId: number;
|
|
71
|
-
audioChannelId?: number;
|
|
72
|
-
}>;
|
|
73
|
-
export type TiStoreExportOptions = Readonly<{
|
|
74
|
-
startTimeMs: number;
|
|
75
|
-
endTimeMs: number;
|
|
76
|
-
videoChannelId: number;
|
|
77
|
-
audioChannelId?: number;
|
|
78
|
-
}>;
|
|
79
|
-
export type TiStoreGalleryAsset = TiRtcGalleryAsset;
|
|
80
|
-
export interface TiStoreRecordingFile {
|
|
81
|
-
readonly path: string;
|
|
82
|
-
readonly durationMs: number;
|
|
83
|
-
moveToGallery(fileName?: string): Promise<Resp<TiStoreGalleryAsset>>;
|
|
84
|
-
delete(): Promise<number>;
|
|
85
|
-
}
|
|
86
|
-
export interface TiStoreSnapshotFile {
|
|
87
|
-
readonly path: string;
|
|
88
|
-
moveToGallery(fileName?: string): Promise<Resp<TiStoreGalleryAsset>>;
|
|
89
|
-
delete(): Promise<number>;
|
|
90
|
-
}
|
|
91
|
-
export declare class TiStore {
|
|
92
|
-
private token;
|
|
93
|
-
private identity;
|
|
94
|
-
private disposed;
|
|
95
|
-
onTokenExpired: (() => void) | null;
|
|
96
|
-
constructor(token: string);
|
|
97
|
-
static init(options: Readonly<{
|
|
98
|
-
appId: string;
|
|
99
|
-
endpoint?: string;
|
|
100
|
-
consoleLogEnabled?: boolean;
|
|
101
|
-
}>): Promise<number>;
|
|
102
|
-
static shutdown(): number;
|
|
103
|
-
static errorToString(code: number): string;
|
|
104
|
-
updateToken(token: string): number;
|
|
105
|
-
listRecordings(startTimeMs: number, endTimeMs: number): Promise<TiStoreRecordingRangesResult>;
|
|
106
|
-
listRecordingDays(startDate: string, endDate: string, timeZoneId?: string): Promise<TiStoreRecordingDaysResult>;
|
|
107
|
-
createReplay(): TiStoreReplay;
|
|
108
|
-
exportRecording(options: TiStoreExportOptions, onProgress?: (progress: number) => void): Resp<TiStoreExportTask>;
|
|
109
|
-
dispose(): number;
|
|
110
|
-
private ensureIdentity;
|
|
111
|
-
}
|
|
112
|
-
export declare class TiStoreReplay {
|
|
113
|
-
private readonly store;
|
|
114
|
-
private identity;
|
|
115
|
-
private disposed;
|
|
116
|
-
private currentSpeed;
|
|
117
|
-
private currentTime;
|
|
118
|
-
onTimeChanged: ((timeMs: number) => void) | null;
|
|
119
|
-
onError: ((code: number) => void) | null;
|
|
120
|
-
onCompleted: (() => void) | null;
|
|
121
|
-
constructor(store: TiStore);
|
|
122
|
-
get speed(): TiStoreReplaySpeed;
|
|
123
|
-
get currentTimeMs(): number | null;
|
|
124
|
-
play(startTimeMs: number, endTimeMs: number, initialTimeMs?: number): number;
|
|
125
|
-
pause(): number;
|
|
126
|
-
resume(): number;
|
|
127
|
-
seek(timeMs: number): number;
|
|
128
|
-
setSpeed(speed: TiStoreReplaySpeed): number;
|
|
129
|
-
startRecording(options: TiStoreStartRecordingOptions): Resp<TiStoreRecordingTask>;
|
|
130
|
-
stop(): number;
|
|
131
|
-
dispose(): number;
|
|
132
|
-
private command;
|
|
133
|
-
private ensureIdentity;
|
|
134
|
-
private handleEvent;
|
|
135
|
-
}
|
|
136
|
-
declare abstract class StoreOutputBase {
|
|
137
|
-
protected identity: NativeIdentity | null;
|
|
138
|
-
protected disposed: boolean;
|
|
139
|
-
protected bound: boolean;
|
|
140
|
-
protected abstract create(): ReturnType<typeof NativeTiRtc.storeCreateAudioOutput>;
|
|
141
|
-
protected ensureIdentity(): NativeIdentity | number;
|
|
142
|
-
protected abstract handleEvent(event: NativeTiRtcEvent): void;
|
|
143
|
-
protected releaseIdentity(): void;
|
|
144
|
-
}
|
|
145
|
-
export declare class TiStoreAudioOutput extends StoreOutputBase {
|
|
146
|
-
private currentState;
|
|
147
|
-
onStateChanged: ((state: TiStoreAudioOutputState) => void) | null;
|
|
148
|
-
onError: ((code: number) => void) | null;
|
|
149
|
-
protected create(): Readonly<{
|
|
150
|
-
code: number;
|
|
151
|
-
objectId: import("./specs/NativeTiRtc").NativeObjectId;
|
|
152
|
-
generation: number;
|
|
153
|
-
message: string | null;
|
|
154
|
-
}>;
|
|
155
|
-
get state(): TiStoreAudioOutputState;
|
|
156
|
-
attach(replay: TiStoreReplay, channelId: number): number;
|
|
157
|
-
setVolume(volumePercent: number): number;
|
|
158
|
-
detach(): number;
|
|
159
|
-
dispose(): number;
|
|
160
|
-
protected handleEvent(event: NativeTiRtcEvent): void;
|
|
161
|
-
}
|
|
162
|
-
export type TiStoreVideoOutputViewProps = ViewProps & Readonly<{
|
|
163
|
-
output: TiStoreVideoOutput;
|
|
164
|
-
resizeMode?: 'contain' | 'cover' | 'stretch';
|
|
165
|
-
}>;
|
|
166
|
-
export declare class TiStoreVideoOutput extends StoreOutputBase {
|
|
167
|
-
private currentState;
|
|
168
|
-
onStateChanged: ((state: TiStoreVideoOutputState) => void) | null;
|
|
169
|
-
onError: ((code: number) => void) | null;
|
|
170
|
-
protected create(): Readonly<{
|
|
171
|
-
code: number;
|
|
172
|
-
objectId: import("./specs/NativeTiRtc").NativeObjectId;
|
|
173
|
-
generation: number;
|
|
174
|
-
message: string | null;
|
|
175
|
-
}>;
|
|
176
|
-
get state(): TiStoreVideoOutputState;
|
|
177
|
-
view(props?: Omit<TiStoreVideoOutputViewProps, 'output'>): React.ReactElement;
|
|
178
|
-
attach(replay: TiStoreReplay, channelId: number): number;
|
|
179
|
-
takeSnapshot(): Promise<Resp<TiStoreSnapshotFile>>;
|
|
180
|
-
detach(): number;
|
|
181
|
-
dispose(): number;
|
|
182
|
-
protected handleEvent(event: NativeTiRtcEvent): void;
|
|
183
|
-
}
|
|
184
|
-
export declare function TiStoreVideoOutputView(props: TiStoreVideoOutputViewProps): React.ReactElement;
|
|
185
|
-
export declare class TiStoreRecordingTask {
|
|
186
|
-
private readonly taskId;
|
|
187
|
-
private readonly owner;
|
|
188
|
-
private stopPromise;
|
|
189
|
-
constructor(taskId: number, owner: TiStoreReplay);
|
|
190
|
-
stop(): Promise<Resp<TiStoreRecordingFile>>;
|
|
191
|
-
}
|
|
192
|
-
export declare class TiStoreExportTask {
|
|
193
|
-
private readonly taskId;
|
|
194
|
-
private readonly owner;
|
|
195
|
-
private readonly onProgress?;
|
|
196
|
-
private resultPromise;
|
|
197
|
-
constructor(taskId: number, owner: TiStore, onProgress?: ((progress: number) => void) | undefined);
|
|
198
|
-
get progress(): number;
|
|
199
|
-
get result(): Promise<Resp<TiStoreRecordingFile>>;
|
|
200
|
-
stop(): Promise<Resp<TiStoreRecordingFile>>;
|
|
201
|
-
}
|
|
202
|
-
export {};
|