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
|
@@ -116,12 +116,12 @@
|
|
|
116
116
|
eventSink:(TiRtcReactNativeEventSink*)eventSink;
|
|
117
117
|
@end
|
|
118
118
|
|
|
119
|
-
@interface
|
|
119
|
+
@interface TiRtcReactNativeCloudStorageAudioOutputDelegate : NSObject <TiCloudStorageAudioOutputDelegate>
|
|
120
120
|
- (instancetype)initWithObjectId:(NSInteger)objectId
|
|
121
121
|
eventSink:(TiRtcReactNativeEventSink*)eventSink;
|
|
122
122
|
@end
|
|
123
123
|
|
|
124
|
-
@implementation
|
|
124
|
+
@implementation TiRtcReactNativeCloudStorageAudioOutputDelegate {
|
|
125
125
|
NSInteger _objectId;
|
|
126
126
|
TiRtcReactNativeEventSink* _eventSink;
|
|
127
127
|
}
|
|
@@ -135,31 +135,31 @@
|
|
|
135
135
|
return self;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
- (void)audioOutput:(
|
|
138
|
+
- (void)audioOutput:(TiCloudStorageAudioOutput*)output didChangeState:(TiCloudStorageAudioOutputState)state {
|
|
139
139
|
NSString* value;
|
|
140
140
|
switch (state) {
|
|
141
|
-
case
|
|
142
|
-
case
|
|
143
|
-
case
|
|
144
|
-
case
|
|
145
|
-
case
|
|
146
|
-
case
|
|
141
|
+
case TiCloudStorageAudioOutputStateIdle: value = @"idle"; break;
|
|
142
|
+
case TiCloudStorageAudioOutputStateBuffering: value = @"buffering"; break;
|
|
143
|
+
case TiCloudStorageAudioOutputStatePlaying: value = @"playing"; break;
|
|
144
|
+
case TiCloudStorageAudioOutputStatePaused: value = @"paused"; break;
|
|
145
|
+
case TiCloudStorageAudioOutputStateCompleted: value = @"completed"; break;
|
|
146
|
+
case TiCloudStorageAudioOutputStateFailed: default: value = @"failed"; break;
|
|
147
147
|
}
|
|
148
148
|
[_eventSink audioOutputStateChanged:_objectId state:value];
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
- (void)audioOutput:(
|
|
151
|
+
- (void)audioOutput:(TiCloudStorageAudioOutput*)output didFailWithCode:(int32_t)code {
|
|
152
152
|
[_eventSink audioOutputError:_objectId code:code message:nil];
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
@end
|
|
156
156
|
|
|
157
|
-
@interface
|
|
157
|
+
@interface TiRtcReactNativeCloudStorageVideoOutputDelegate : NSObject <TiCloudStorageVideoOutputDelegate>
|
|
158
158
|
- (instancetype)initWithObjectId:(NSInteger)objectId
|
|
159
159
|
eventSink:(TiRtcReactNativeEventSink*)eventSink;
|
|
160
160
|
@end
|
|
161
161
|
|
|
162
|
-
@implementation
|
|
162
|
+
@implementation TiRtcReactNativeCloudStorageVideoOutputDelegate {
|
|
163
163
|
NSInteger _objectId;
|
|
164
164
|
TiRtcReactNativeEventSink* _eventSink;
|
|
165
165
|
}
|
|
@@ -173,20 +173,20 @@
|
|
|
173
173
|
return self;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
- (void)videoOutput:(
|
|
176
|
+
- (void)videoOutput:(TiCloudStorageVideoOutput*)output didChangeState:(TiCloudStorageVideoOutputState)state {
|
|
177
177
|
NSString* value;
|
|
178
178
|
switch (state) {
|
|
179
|
-
case
|
|
180
|
-
case
|
|
181
|
-
case
|
|
182
|
-
case
|
|
183
|
-
case
|
|
184
|
-
case
|
|
179
|
+
case TiCloudStorageVideoOutputStateIdle: value = @"idle"; break;
|
|
180
|
+
case TiCloudStorageVideoOutputStateBuffering: value = @"buffering"; break;
|
|
181
|
+
case TiCloudStorageVideoOutputStateRendering: value = @"rendering"; break;
|
|
182
|
+
case TiCloudStorageVideoOutputStatePaused: value = @"paused"; break;
|
|
183
|
+
case TiCloudStorageVideoOutputStateCompleted: value = @"completed"; break;
|
|
184
|
+
case TiCloudStorageVideoOutputStateFailed: default: value = @"failed"; break;
|
|
185
185
|
}
|
|
186
186
|
[_eventSink videoOutputStateChanged:_objectId state:value];
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
- (void)videoOutput:(
|
|
189
|
+
- (void)videoOutput:(TiCloudStorageVideoOutput*)output didFailWithCode:(int32_t)code {
|
|
190
190
|
[_eventSink videoOutputError:_objectId code:code message:nil];
|
|
191
191
|
}
|
|
192
192
|
|
|
@@ -299,30 +299,28 @@
|
|
|
299
299
|
return delegate;
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
- (id)
|
|
303
|
-
TiRtcReactNativeEventSink* sink = _eventSink;
|
|
304
|
-
store.onTokenExpired = ^{ [sink storeTokenExpired:objectId]; };
|
|
302
|
+
- (id)wireCloudStorage:(TiCloudStorage*)cloudStorage objectId:(NSInteger)objectId {
|
|
305
303
|
return nil;
|
|
306
304
|
}
|
|
307
305
|
|
|
308
|
-
- (id)
|
|
306
|
+
- (id)wireCloudStorageReplay:(TiCloudStorageReplay*)replay objectId:(NSInteger)objectId {
|
|
309
307
|
TiRtcReactNativeEventSink* sink = _eventSink;
|
|
310
|
-
replay.onTimeChanged = ^(int64_t timeMs) { [sink
|
|
311
|
-
replay.onCompleted = ^{ [sink
|
|
312
|
-
replay.onError = ^(int32_t code) { [sink
|
|
308
|
+
replay.onTimeChanged = ^(int64_t timeMs) { [sink tiCloudStorageReplayTimeChanged:objectId timestampMs:timeMs]; };
|
|
309
|
+
replay.onCompleted = ^{ [sink tiCloudStorageReplayCompleted:objectId]; };
|
|
310
|
+
replay.onError = ^(int32_t code) { [sink tiCloudStorageReplayError:objectId code:code]; };
|
|
313
311
|
return nil;
|
|
314
312
|
}
|
|
315
313
|
|
|
316
|
-
- (id)
|
|
317
|
-
|
|
318
|
-
[[
|
|
314
|
+
- (id)wireCloudStorageAudioOutput:(TiCloudStorageAudioOutput*)output objectId:(NSInteger)objectId {
|
|
315
|
+
TiRtcReactNativeCloudStorageAudioOutputDelegate* delegate =
|
|
316
|
+
[[TiRtcReactNativeCloudStorageAudioOutputDelegate alloc] initWithObjectId:objectId eventSink:_eventSink];
|
|
319
317
|
output.delegate = delegate;
|
|
320
318
|
return delegate;
|
|
321
319
|
}
|
|
322
320
|
|
|
323
|
-
- (id)
|
|
324
|
-
|
|
325
|
-
[[
|
|
321
|
+
- (id)wireCloudStorageVideoOutput:(TiCloudStorageVideoOutput*)output objectId:(NSInteger)objectId {
|
|
322
|
+
TiRtcReactNativeCloudStorageVideoOutputDelegate* delegate =
|
|
323
|
+
[[TiRtcReactNativeCloudStorageVideoOutputDelegate alloc] initWithObjectId:objectId eventSink:_eventSink];
|
|
326
324
|
output.delegate = delegate;
|
|
327
325
|
return delegate;
|
|
328
326
|
}
|
|
@@ -15,10 +15,9 @@ typedef void (^TiRtcReactNativeEmitBlock)(NSDictionary* event);
|
|
|
15
15
|
streamId:(uint8_t)streamId
|
|
16
16
|
timestampMs:(uint32_t)timestampMs
|
|
17
17
|
data:(NSData*)data;
|
|
18
|
-
- (void)
|
|
19
|
-
- (void)
|
|
20
|
-
- (void)
|
|
21
|
-
- (void)storeReplayError:(NSInteger)objectId code:(int32_t)code;
|
|
18
|
+
- (void)tiCloudStorageReplayTimeChanged:(NSInteger)objectId timestampMs:(int64_t)timestampMs;
|
|
19
|
+
- (void)tiCloudStorageReplayCompleted:(NSInteger)objectId;
|
|
20
|
+
- (void)tiCloudStorageReplayError:(NSInteger)objectId code:(int32_t)code;
|
|
22
21
|
- (void)audioOutputStateChanged:(NSInteger)objectId state:(NSString*)state;
|
|
23
22
|
- (void)audioOutputError:(NSInteger)objectId code:(int32_t)code message:(NSString*)message;
|
|
24
23
|
- (void)videoOutputStateChanged:(NSInteger)objectId state:(NSString*)state;
|
|
@@ -43,22 +43,18 @@
|
|
|
43
43
|
[self emit:event];
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
- (void)
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
- (void)storeReplayTimeChanged:(NSInteger)objectId timestampMs:(int64_t)timestampMs {
|
|
51
|
-
NSMutableDictionary* event = [self base:@"storeReplayTimeChanged" objectId:objectId];
|
|
46
|
+
- (void)tiCloudStorageReplayTimeChanged:(NSInteger)objectId timestampMs:(int64_t)timestampMs {
|
|
47
|
+
NSMutableDictionary* event = [self base:@"tiCloudStorageReplayTimeChanged" objectId:objectId];
|
|
52
48
|
event[@"timestampMs"] = @(timestampMs);
|
|
53
49
|
[self emit:event];
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
- (void)
|
|
57
|
-
[self emit:[self base:@"
|
|
52
|
+
- (void)tiCloudStorageReplayCompleted:(NSInteger)objectId {
|
|
53
|
+
[self emit:[self base:@"tiCloudStorageReplayCompleted" objectId:objectId]];
|
|
58
54
|
}
|
|
59
55
|
|
|
60
|
-
- (void)
|
|
61
|
-
NSMutableDictionary* event = [self base:@"
|
|
56
|
+
- (void)tiCloudStorageReplayError:(NSInteger)objectId code:(int32_t)code {
|
|
57
|
+
NSMutableDictionary* event = [self base:@"tiCloudStorageReplayError" objectId:objectId];
|
|
62
58
|
event[@"code"] = @(TiRtcReactNativeNormalizeDarwin(code));
|
|
63
59
|
[self emit:event];
|
|
64
60
|
}
|
|
@@ -115,8 +115,8 @@ static AVLayerVideoGravity TiRtcVideoOutputGravityForResizeMode(
|
|
|
115
115
|
_attachedObjectId = _nativeObjectId;
|
|
116
116
|
_attachedGeneration = _generation;
|
|
117
117
|
[self applyVideoLayerGeometry];
|
|
118
|
-
} else if ([object isKindOfClass:[
|
|
119
|
-
int32_t code = [(
|
|
118
|
+
} else if ([object isKindOfClass:[TiCloudStorageVideoOutput class]]) {
|
|
119
|
+
int32_t code = [(TiCloudStorageVideoOutput*)object attachView:self];
|
|
120
120
|
if (code != 0) {
|
|
121
121
|
[registry reportVideoOutputError:_nativeObjectId code:code message:@"view attach failed"];
|
|
122
122
|
return;
|
|
@@ -134,8 +134,8 @@ static AVLayerVideoGravity TiRtcVideoOutputGravityForResizeMode(
|
|
|
134
134
|
id object = [[TiRtcReactNativeRegistry sharedRegistry] objectForId:objectId];
|
|
135
135
|
if ([object isKindOfClass:[TiRtcVideoOutput class]]) {
|
|
136
136
|
__unused int32_t code = [(TiRtcVideoOutput*)object detachView];
|
|
137
|
-
} else if ([object isKindOfClass:[
|
|
138
|
-
__unused int32_t code = [(
|
|
137
|
+
} else if ([object isKindOfClass:[TiCloudStorageVideoOutput class]]) {
|
|
138
|
+
__unused int32_t code = [(TiCloudStorageVideoOutput*)object detachView];
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
package/lib/module/index.js
CHANGED
|
@@ -7,5 +7,5 @@ export { TiRtcAudioInput } from './audio_input';
|
|
|
7
7
|
export { TiRtcVideoInput, TiRtcVideoInputPreview } from './video_input';
|
|
8
8
|
export { TiRtcLogging } from './logging';
|
|
9
9
|
export { TiRtcRecordingTask } from './recording';
|
|
10
|
-
export {
|
|
10
|
+
export { TI_CLOUD_STORAGE_ERROR_OK, TI_CLOUD_STORAGE_ERROR_INVALID_ARGUMENT, TI_CLOUD_STORAGE_ERROR_NOT_INITIALIZED, TI_CLOUD_STORAGE_ERROR_TOKEN_EXPIRED, TI_CLOUD_STORAGE_ERROR_ALREADY_INITIALIZED, TI_CLOUD_STORAGE_ERROR_PERMISSION_DENIED, TI_CLOUD_STORAGE_ERROR_IN_USE, TI_CLOUD_STORAGE_ERROR_NOT_STARTED, TI_CLOUD_STORAGE_ERROR_NOT_BOUND, TI_CLOUD_STORAGE_ERROR_NOT_CONFIGURED, TI_CLOUD_STORAGE_ERROR_RESOURCE_EXHAUSTED, TI_CLOUD_STORAGE_ERROR_FILE_WRITE_FAILED, TI_CLOUD_STORAGE_ERROR_UNSUPPORTED_FORMAT, TI_CLOUD_STORAGE_ERROR_IO_FAILED, TI_CLOUD_STORAGE_ERROR_CANCELLED, TI_CLOUD_STORAGE_ERROR_RANGE_TOO_LARGE, TI_CLOUD_STORAGE_ERROR_NO_FRAME, TI_CLOUD_STORAGE_ERROR_NO_RECORDABLE_MEDIA, TI_CLOUD_STORAGE_ERROR_RECORDING_OVERRUN, TI_CLOUD_STORAGE_ERROR_RECORDING_UNREADABLE, TI_CLOUD_STORAGE_ERROR_UNAVAILABLE, TI_CLOUD_STORAGE_ERROR_STOPPED, TiCloudStorageReplaySpeed, TiCloudStorageAudioOutputState, TiCloudStorageVideoOutputState, TiCloudStorage, TiCloudStorageReplay, TiCloudStorageAudioOutput, TiCloudStorageVideoOutput, TiCloudStorageVideoOutputView, TiCloudStorageRecordingTask, TiCloudStorageExportTask, } from './storage';
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAmCjB,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,eAAe,EAAE,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAQ/C,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.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