@byteplus/react-native-live-push 1.3.3-rc.0 → 1.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/android/src/main/java/com/volcengine/velive/rn/push/EnvHelper.java +15 -0
- package/android/src/main/java/com/volcengine/velive/rn/push/LoggerHelper.java +40 -0
- package/ios/VeLivePushHelper.h +3 -0
- package/ios/VeLivePushHelper.m +44 -0
- package/ios/VeLivePushLoggerHelper.h +14 -0
- package/ios/VeLivePushLoggerHelper.m +41 -0
- package/lib/commonjs/index.js +119 -99
- package/lib/commonjs/typescript/android/index.d.ts +3 -0
- package/lib/commonjs/typescript/codegen/android/keytype.d.ts +5 -6
- package/lib/commonjs/typescript/codegen/pack/keytype.d.ts +5 -6
- package/lib/commonjs/typescript/platforms/ios/helper.d.ts +1 -0
- package/lib/module/index.js +119 -99
- package/lib/module/typescript/android/index.d.ts +3 -0
- package/lib/module/typescript/codegen/android/keytype.d.ts +5 -6
- package/lib/module/typescript/codegen/pack/keytype.d.ts +5 -6
- package/lib/module/typescript/platforms/ios/helper.d.ts +1 -0
- package/lib/typescript/android/index.d.ts +3 -0
- package/lib/typescript/codegen/android/keytype.d.ts +5 -6
- package/lib/typescript/codegen/pack/keytype.d.ts +5 -6
- package/lib/typescript/platforms/ios/helper.d.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package com.volcengine.velive.rn.push;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
import com.pandora.common.env.Env;
|
|
6
|
+
import com.pandora.common.env.config.Config;
|
|
7
|
+
|
|
8
|
+
import java.util.HashMap;
|
|
9
|
+
|
|
10
|
+
public class EnvHelper{
|
|
11
|
+
public static void init(@NonNull Config config, HashMap<String, Object> logHeaders) {
|
|
12
|
+
Env.init(config);
|
|
13
|
+
LoggerHelper.setHeaderInfo(logHeaders);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
package com.volcengine.velive.rn.push;
|
|
2
|
+
|
|
3
|
+
import com.pandora.common.BuildConfig;
|
|
4
|
+
import com.pandora.common.Constants;
|
|
5
|
+
import com.pandora.common.applog.AppLogWrapper;
|
|
6
|
+
import com.bytedance.applog.IAppLogInstance;
|
|
7
|
+
|
|
8
|
+
import java.lang.reflect.Field;
|
|
9
|
+
import java.util.HashMap;
|
|
10
|
+
|
|
11
|
+
public class LoggerHelper {
|
|
12
|
+
static void setHeaderInfo(HashMap<String, Object> headers) {
|
|
13
|
+
if(BuildConfig.SDK_REGION.equals(Constants.SDKRegion.GLOBAL)) {
|
|
14
|
+
try {
|
|
15
|
+
Class<?> clazz = Class.forName("com.pandora.common.applog.AppLogWrapper");
|
|
16
|
+
|
|
17
|
+
Field field = clazz.getDeclaredField("mBytePlusAppLogInstance");
|
|
18
|
+
field.setAccessible(true);
|
|
19
|
+
|
|
20
|
+
Object obj = field.get(null);
|
|
21
|
+
|
|
22
|
+
if (obj instanceof IAppLogInstance) {
|
|
23
|
+
IAppLogInstance instance = (IAppLogInstance) obj;
|
|
24
|
+
if (headers != null && instance != null) {
|
|
25
|
+
instance.setHeaderInfo(headers);
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
System.out.println("mBytePlusAppLogInstance is null or wrong type");
|
|
29
|
+
}
|
|
30
|
+
} catch (Exception e) {
|
|
31
|
+
e.printStackTrace();
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
IAppLogInstance appLogInstance = AppLogWrapper.getAppLogInstance();
|
|
35
|
+
if (headers != null && appLogInstance != null) {
|
|
36
|
+
appLogInstance.setHeaderInfo(headers);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
package/ios/VeLivePushHelper.h
CHANGED
package/ios/VeLivePushHelper.m
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
#import "VeLivePushHelper.h"
|
|
9
|
+
#import <TTSDKFramework/TTSDKFramework.h>
|
|
10
|
+
#import "VeLivePushLoggerHelper.h"
|
|
9
11
|
// 使用TTSDKFramework的VeLivePusher类,但在此不直接导入
|
|
10
12
|
// 在包含此SDK的项目中,VeLivePusher会被正确解析
|
|
11
13
|
|
|
@@ -47,4 +49,46 @@ static NSMapTable<NSString *, VeLivePusher *> *pusherMap;
|
|
|
47
49
|
return [NSBundle.mainBundle pathForResource:subPath ofType:nil];
|
|
48
50
|
}
|
|
49
51
|
|
|
52
|
+
+ (void)startWithConfiguration:(NSDictionary *)config {
|
|
53
|
+
if (!config || ![config isKindOfClass:NSDictionary.class]) {
|
|
54
|
+
NSLog(@"VeLivePlayerHelper: Invalid configuration");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
NSString *licenseUri = [config valueForKey:@"LicenseUri"];
|
|
59
|
+
NSString *appId = [config valueForKey:@"AppID"];
|
|
60
|
+
|
|
61
|
+
TTSDKConfiguration *cfg = [TTSDKConfiguration defaultConfigurationWithAppID:appId
|
|
62
|
+
licenseName:licenseUri];
|
|
63
|
+
|
|
64
|
+
TTSDKLogConfiguration *logCfg = [TTSDKLogConfiguration new];
|
|
65
|
+
logCfg.enableConsole = YES;
|
|
66
|
+
logCfg.enableLogFile = YES;
|
|
67
|
+
logCfg.enable = YES;
|
|
68
|
+
|
|
69
|
+
cfg.logConfiguration = logCfg;
|
|
70
|
+
cfg.channel = [config valueForKey:@"AppChannel"];
|
|
71
|
+
// App 名称
|
|
72
|
+
cfg.appName = [config valueForKey:@"AppName"];
|
|
73
|
+
// 版本号
|
|
74
|
+
cfg.appVersion = [config valueForKey:@"AppVersion"];
|
|
75
|
+
|
|
76
|
+
id openLogValue = [config valueForKey:@"openLog"];
|
|
77
|
+
cfg.shouldInitAppLog = (openLogValue != nil && [openLogValue isKindOfClass:[NSNumber class]]) ? [openLogValue boolValue] : YES;
|
|
78
|
+
|
|
79
|
+
cfg.bizType = TTSDKServiceBizType_Live;
|
|
80
|
+
|
|
81
|
+
[TTSDKManager setCurrentUserUniqueID:[config valueForKey:@"UserUniqueID"]];
|
|
82
|
+
[TTSDKManager setShouldReportToAppLog:YES];
|
|
83
|
+
|
|
84
|
+
[TTSDKManager startWithConfiguration:cfg];
|
|
85
|
+
|
|
86
|
+
[VeLivePushLoggerHelper setHeaderInfo:@{
|
|
87
|
+
@"appId": [config valueForKey:@"appLogAid"],
|
|
88
|
+
@"headers": @{
|
|
89
|
+
@"hybrid_ua": [config valueForKey:@"hybrid_ua"],
|
|
90
|
+
}
|
|
91
|
+
}];
|
|
92
|
+
}
|
|
93
|
+
|
|
50
94
|
@end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//
|
|
2
|
+
// LoggerHelper.m
|
|
3
|
+
// react-native-live-pull
|
|
4
|
+
//
|
|
5
|
+
// Created by iOS Team on 2024/xx/xx.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@interface VeLivePushLoggerHelper : NSObject
|
|
11
|
+
|
|
12
|
+
+ (void)setHeaderInfo:(NSDictionary *)params;
|
|
13
|
+
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
@implementation VeLivePushLoggerHelper
|
|
17
|
+
|
|
18
|
+
+ (void)setHeaderInfo:(NSDictionary *)params {
|
|
19
|
+
NSString *appId = [params valueForKey:@"appId"];
|
|
20
|
+
if ([appId isKindOfClass:NSString.class] && appId.length > 0) {
|
|
21
|
+
Class autoTrack = NSClassFromString(@"BDAutoTrack");
|
|
22
|
+
if (!autoTrack || ![autoTrack respondsToSelector:NSSelectorFromString(@"trackWithAppID:")]) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
id trackInstance = [autoTrack performSelector:@selector(trackWithAppID:) withObject:appId];
|
|
27
|
+
if (![trackInstance respondsToSelector:@selector(setCustomHeaderValue:forKey:)]) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
id headers = [params valueForKey:@"headers"];
|
|
32
|
+
if ([headers isKindOfClass:NSDictionary.class]) {
|
|
33
|
+
NSDictionary *headersDict = (NSDictionary *)headers;
|
|
34
|
+
[headersDict enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
|
|
35
|
+
[trackInstance performSelector:@selector(setCustomHeaderValue:forKey:) withObject:obj withObject:key];
|
|
36
|
+
}];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@end
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3259,6 +3259,7 @@ var VeLivePushHelper = function () {
|
|
|
3259
3259
|
var _static_setVeLivePusher_decorators;
|
|
3260
3260
|
var _static_removeVeLivePusher_decorators;
|
|
3261
3261
|
var _static_getResourcePath_decorators;
|
|
3262
|
+
var _static_startWithConfiguration_decorators;
|
|
3262
3263
|
var VeLivePushHelper = _classThis = /** @class */ (function () {
|
|
3263
3264
|
function VeLivePushHelper_1() {
|
|
3264
3265
|
}
|
|
@@ -3282,6 +3283,9 @@ var VeLivePushHelper = function () {
|
|
|
3282
3283
|
VeLivePushHelper_1.getResourcePath = function (subPath) {
|
|
3283
3284
|
throw new Error('');
|
|
3284
3285
|
};
|
|
3286
|
+
VeLivePushHelper_1.startWithConfiguration = function (cfg) {
|
|
3287
|
+
//
|
|
3288
|
+
};
|
|
3285
3289
|
return VeLivePushHelper_1;
|
|
3286
3290
|
}());
|
|
3287
3291
|
__setFunctionName(_classThis, "VeLivePushHelper");
|
|
@@ -3290,9 +3294,11 @@ var VeLivePushHelper = function () {
|
|
|
3290
3294
|
_static_setVeLivePusher_decorators = [NativeStaticMethodSync('setVeLivePusher:forKey:')];
|
|
3291
3295
|
_static_removeVeLivePusher_decorators = [NativeStaticMethodSync('removeVeLivePusher:')];
|
|
3292
3296
|
_static_getResourcePath_decorators = [NativeStaticMethodSync('getResourcePath:')];
|
|
3297
|
+
_static_startWithConfiguration_decorators = [NativeStaticMethodSync('startWithConfiguration:')];
|
|
3293
3298
|
__esDecorate(_classThis, null, _static_setVeLivePusher_decorators, { kind: "method", name: "setVeLivePusher", static: true, private: false, access: { has: function (obj) { return "setVeLivePusher" in obj; }, get: function (obj) { return obj.setVeLivePusher; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
3294
3299
|
__esDecorate(_classThis, null, _static_removeVeLivePusher_decorators, { kind: "method", name: "removeVeLivePusher", static: true, private: false, access: { has: function (obj) { return "removeVeLivePusher" in obj; }, get: function (obj) { return obj.removeVeLivePusher; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
3295
3300
|
__esDecorate(_classThis, null, _static_getResourcePath_decorators, { kind: "method", name: "getResourcePath", static: true, private: false, access: { has: function (obj) { return "getResourcePath" in obj; }, get: function (obj) { return obj.getResourcePath; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
3301
|
+
__esDecorate(_classThis, null, _static_startWithConfiguration_decorators, { kind: "method", name: "startWithConfiguration", static: true, private: false, access: { has: function (obj) { return "startWithConfiguration" in obj; }, get: function (obj) { return obj.startWithConfiguration; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
3296
3302
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
3297
3303
|
VeLivePushHelper = _classThis = _classDescriptor.value;
|
|
3298
3304
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
@@ -4530,7 +4536,7 @@ var VeLiveVideoCaptureType$1;
|
|
|
4530
4536
|
* @brief Capture the video with dual cameras.
|
|
4531
4537
|
*
|
|
4532
4538
|
*/
|
|
4533
|
-
|
|
4539
|
+
// VeLiveVideoCaptureDualCamera = 2,
|
|
4534
4540
|
/** {zh}
|
|
4535
4541
|
* @brief 使用屏幕采集。
|
|
4536
4542
|
*
|
|
@@ -4539,7 +4545,7 @@ var VeLiveVideoCaptureType$1;
|
|
|
4539
4545
|
* @brief Capture the screen.
|
|
4540
4546
|
*
|
|
4541
4547
|
*/
|
|
4542
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureScreen"] =
|
|
4548
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureScreen"] = 2] = "VeLiveVideoCaptureScreen";
|
|
4543
4549
|
/** {zh}
|
|
4544
4550
|
* @brief 使用外部设备或源进行视频采集。
|
|
4545
4551
|
*
|
|
@@ -4548,7 +4554,7 @@ var VeLiveVideoCaptureType$1;
|
|
|
4548
4554
|
* @brief Capture the video with an external device or source.
|
|
4549
4555
|
*
|
|
4550
4556
|
*/
|
|
4551
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureExternal"] =
|
|
4557
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureExternal"] = 3] = "VeLiveVideoCaptureExternal";
|
|
4552
4558
|
/** {zh}
|
|
4553
4559
|
* @brief 使用指定的静态图片作为视频源。
|
|
4554
4560
|
*
|
|
@@ -4557,7 +4563,7 @@ var VeLiveVideoCaptureType$1;
|
|
|
4557
4563
|
* @brief Use a static image as the video source.
|
|
4558
4564
|
*
|
|
4559
4565
|
*/
|
|
4560
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureCustomImage"] =
|
|
4566
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureCustomImage"] = 4] = "VeLiveVideoCaptureCustomImage";
|
|
4561
4567
|
/** {zh}
|
|
4562
4568
|
* @brief 使用最近采集的一帧图像重复作为视频源。
|
|
4563
4569
|
*
|
|
@@ -4566,7 +4572,7 @@ var VeLiveVideoCaptureType$1;
|
|
|
4566
4572
|
* @brief Use the last frame as the video source.
|
|
4567
4573
|
*
|
|
4568
4574
|
*/
|
|
4569
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureLastFrame"] =
|
|
4575
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureLastFrame"] = 5] = "VeLiveVideoCaptureLastFrame";
|
|
4570
4576
|
/** {zh}
|
|
4571
4577
|
* @brief 使用黑色帧作为视频源,一般用于调试或特殊需求。
|
|
4572
4578
|
*
|
|
@@ -4575,7 +4581,7 @@ var VeLiveVideoCaptureType$1;
|
|
|
4575
4581
|
* @brief Use a black frame as the video source. This is usually used for debugging purposes or in special circumstances.
|
|
4576
4582
|
*
|
|
4577
4583
|
*/
|
|
4578
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureDummyFrame"] =
|
|
4584
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureDummyFrame"] = 6] = "VeLiveVideoCaptureDummyFrame";
|
|
4579
4585
|
})(VeLiveVideoCaptureType$1 || (VeLiveVideoCaptureType$1 = {}));
|
|
4580
4586
|
var VeLiveVideoProfile;
|
|
4581
4587
|
(function (VeLiveVideoProfile) {
|
|
@@ -15833,7 +15839,7 @@ exports.VeLiveVideoCaptureType = void 0;
|
|
|
15833
15839
|
* @brief Capture the video with dual cameras.
|
|
15834
15840
|
*
|
|
15835
15841
|
*/
|
|
15836
|
-
|
|
15842
|
+
// VeLiveVideoCaptureDualCamera = 2,
|
|
15837
15843
|
/** {zh}
|
|
15838
15844
|
* @platform android
|
|
15839
15845
|
* @brief 使用屏幕采集。
|
|
@@ -15844,7 +15850,7 @@ exports.VeLiveVideoCaptureType = void 0;
|
|
|
15844
15850
|
* @brief Capture the screen.
|
|
15845
15851
|
*
|
|
15846
15852
|
*/
|
|
15847
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureScreen"] =
|
|
15853
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureScreen"] = 2] = "VeLiveVideoCaptureScreen";
|
|
15848
15854
|
/** {zh}
|
|
15849
15855
|
* @brief 使用外部设备或源进行视频采集。
|
|
15850
15856
|
*
|
|
@@ -15853,7 +15859,7 @@ exports.VeLiveVideoCaptureType = void 0;
|
|
|
15853
15859
|
* @brief Capture the video with an external device or source.
|
|
15854
15860
|
*
|
|
15855
15861
|
*/
|
|
15856
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureExternal"] =
|
|
15862
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureExternal"] = 3] = "VeLiveVideoCaptureExternal";
|
|
15857
15863
|
/** {zh}
|
|
15858
15864
|
* @brief 使用指定的静态图片作为视频源。
|
|
15859
15865
|
*
|
|
@@ -15862,7 +15868,7 @@ exports.VeLiveVideoCaptureType = void 0;
|
|
|
15862
15868
|
* @brief Use a static image as the video source.
|
|
15863
15869
|
*
|
|
15864
15870
|
*/
|
|
15865
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureCustomImage"] =
|
|
15871
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureCustomImage"] = 4] = "VeLiveVideoCaptureCustomImage";
|
|
15866
15872
|
/** {zh}
|
|
15867
15873
|
* @brief 使用最近采集的一帧图像重复作为视频源。
|
|
15868
15874
|
*
|
|
@@ -15871,7 +15877,7 @@ exports.VeLiveVideoCaptureType = void 0;
|
|
|
15871
15877
|
* @brief Use the last frame as the video source.
|
|
15872
15878
|
*
|
|
15873
15879
|
*/
|
|
15874
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureLastFrame"] =
|
|
15880
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureLastFrame"] = 5] = "VeLiveVideoCaptureLastFrame";
|
|
15875
15881
|
/** {zh}
|
|
15876
15882
|
* @brief 使用黑色帧作为视频源,一般用于调试或特殊需求。
|
|
15877
15883
|
*
|
|
@@ -15880,7 +15886,7 @@ exports.VeLiveVideoCaptureType = void 0;
|
|
|
15880
15886
|
* @brief Use a black frame as the video source. This is usually used for debugging purposes or in special circumstances.
|
|
15881
15887
|
*
|
|
15882
15888
|
*/
|
|
15883
|
-
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureDummyFrame"] =
|
|
15889
|
+
VeLiveVideoCaptureType[VeLiveVideoCaptureType["VeLiveVideoCaptureDummyFrame"] = 6] = "VeLiveVideoCaptureDummyFrame";
|
|
15884
15890
|
})(exports.VeLiveVideoCaptureType || (exports.VeLiveVideoCaptureType = {}));
|
|
15885
15891
|
/** {zh}
|
|
15886
15892
|
* @detail keytype
|
|
@@ -20480,7 +20486,7 @@ var t_VeLiveVideoCaptureType = /** @class */ (function () {
|
|
|
20480
20486
|
var $m = (_a = {},
|
|
20481
20487
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureFrontCamera] = VeLiveVideoCaptureType$1.VeLiveVideoCaptureFrontCamera,
|
|
20482
20488
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureBackCamera] = VeLiveVideoCaptureType$1.VeLiveVideoCaptureBackCamera,
|
|
20483
|
-
|
|
20489
|
+
// [VeLiveVideoCaptureType.VeLiveVideoCaptureDualCamera]: $p_a.VeLiveVideoCaptureType.VeLiveVideoCaptureDualCamera,
|
|
20484
20490
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureScreen] = VeLiveVideoCaptureType$1.VeLiveVideoCaptureScreen,
|
|
20485
20491
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureExternal] = VeLiveVideoCaptureType$1.VeLiveVideoCaptureExternal,
|
|
20486
20492
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureCustomImage] = VeLiveVideoCaptureType$1.VeLiveVideoCaptureCustomImage,
|
|
@@ -20498,7 +20504,7 @@ var t_VeLiveVideoCaptureType = /** @class */ (function () {
|
|
|
20498
20504
|
var $m = (_a = {},
|
|
20499
20505
|
_a[VeLiveVideoCaptureType$1.VeLiveVideoCaptureFrontCamera] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureFrontCamera,
|
|
20500
20506
|
_a[VeLiveVideoCaptureType$1.VeLiveVideoCaptureBackCamera] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureBackCamera,
|
|
20501
|
-
|
|
20507
|
+
// [$p_a.VeLiveVideoCaptureType.VeLiveVideoCaptureDualCamera]: VeLiveVideoCaptureType.VeLiveVideoCaptureDualCamera,
|
|
20502
20508
|
_a[VeLiveVideoCaptureType$1.VeLiveVideoCaptureScreen] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureScreen,
|
|
20503
20509
|
_a[VeLiveVideoCaptureType$1.VeLiveVideoCaptureExternal] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureExternal,
|
|
20504
20510
|
_a[VeLiveVideoCaptureType$1.VeLiveVideoCaptureCustomImage] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureCustomImage,
|
|
@@ -20516,7 +20522,7 @@ var t_VeLiveVideoCaptureType = /** @class */ (function () {
|
|
|
20516
20522
|
var $m = (_a = {},
|
|
20517
20523
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureFrontCamera] = VeLiveVideoCaptureType.VeLiveVideoCaptureFrontCamera,
|
|
20518
20524
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureBackCamera] = VeLiveVideoCaptureType.VeLiveVideoCaptureBackCamera,
|
|
20519
|
-
|
|
20525
|
+
// [VeLiveVideoCaptureType.VeLiveVideoCaptureDualCamera]: $p_i.VeLiveVideoCaptureType.VeLiveVideoCaptureDualCamera,
|
|
20520
20526
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureExternal] = VeLiveVideoCaptureType.VeLiveVideoCaptureExternal,
|
|
20521
20527
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureCustomImage] = VeLiveVideoCaptureType.VeLiveVideoCaptureCustomImage,
|
|
20522
20528
|
_a[exports.VeLiveVideoCaptureType.VeLiveVideoCaptureLastFrame] = VeLiveVideoCaptureType.VeLiveVideoCaptureLastFrame,
|
|
@@ -20533,7 +20539,7 @@ var t_VeLiveVideoCaptureType = /** @class */ (function () {
|
|
|
20533
20539
|
var $m = (_a = {},
|
|
20534
20540
|
_a[VeLiveVideoCaptureType.VeLiveVideoCaptureFrontCamera] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureFrontCamera,
|
|
20535
20541
|
_a[VeLiveVideoCaptureType.VeLiveVideoCaptureBackCamera] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureBackCamera,
|
|
20536
|
-
|
|
20542
|
+
// [$p_i.VeLiveVideoCaptureType.VeLiveVideoCaptureDualCamera]: VeLiveVideoCaptureType.VeLiveVideoCaptureDualCamera,
|
|
20537
20543
|
_a[VeLiveVideoCaptureType.VeLiveVideoCaptureExternal] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureExternal,
|
|
20538
20544
|
_a[VeLiveVideoCaptureType.VeLiveVideoCaptureCustomImage] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureCustomImage,
|
|
20539
20545
|
_a[VeLiveVideoCaptureType.VeLiveVideoCaptureLastFrame] = exports.VeLiveVideoCaptureType.VeLiveVideoCaptureLastFrame,
|
|
@@ -26501,6 +26507,34 @@ var Env = function () {
|
|
|
26501
26507
|
})();
|
|
26502
26508
|
return _classThis;
|
|
26503
26509
|
}();
|
|
26510
|
+
var EnvHelper = function () {
|
|
26511
|
+
var _classDecorators = [NativeClass('com.volcengine.velive.rn.push.EnvHelper')];
|
|
26512
|
+
var _classDescriptor;
|
|
26513
|
+
var _classExtraInitializers = [];
|
|
26514
|
+
var _classThis;
|
|
26515
|
+
var _staticExtraInitializers = [];
|
|
26516
|
+
var _static_init_decorators;
|
|
26517
|
+
_classThis = /** @class */ (function () {
|
|
26518
|
+
function EnvHelper_1() {
|
|
26519
|
+
}
|
|
26520
|
+
EnvHelper_1.init = function (cfg, logHeaders) {
|
|
26521
|
+
throw new Error('');
|
|
26522
|
+
};
|
|
26523
|
+
return EnvHelper_1;
|
|
26524
|
+
}());
|
|
26525
|
+
__setFunctionName(_classThis, "EnvHelper");
|
|
26526
|
+
(function () {
|
|
26527
|
+
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
26528
|
+
_static_init_decorators = [NativeStaticMethodSync()];
|
|
26529
|
+
__esDecorate(_classThis, null, _static_init_decorators, { kind: "method", name: "init", static: true, private: false, access: { has: function (obj) { return "init" in obj; }, get: function (obj) { return obj.init; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
26530
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
26531
|
+
_classThis = _classDescriptor.value;
|
|
26532
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
26533
|
+
__runInitializers(_classThis, _staticExtraInitializers);
|
|
26534
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
26535
|
+
})();
|
|
26536
|
+
return _classThis;
|
|
26537
|
+
}();
|
|
26504
26538
|
var ConfigBuilder = function () {
|
|
26505
26539
|
var _classDecorators = [NativeClass('com.pandora.common.env.config.Config$Builder')];
|
|
26506
26540
|
var _classDescriptor;
|
|
@@ -26577,6 +26611,69 @@ var Config = /** @class */ (function () {
|
|
|
26577
26611
|
return Config;
|
|
26578
26612
|
}());
|
|
26579
26613
|
|
|
26614
|
+
function initAndroidEnv(config) {
|
|
26615
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
26616
|
+
var builder, context, androidEnv;
|
|
26617
|
+
return __generator(this, function (_a) {
|
|
26618
|
+
switch (_a.label) {
|
|
26619
|
+
case 0:
|
|
26620
|
+
builder = new Config.Builder();
|
|
26621
|
+
return [4 /*yield*/, NativeVariables.getApplicationContext()];
|
|
26622
|
+
case 1:
|
|
26623
|
+
context = _a.sent();
|
|
26624
|
+
builder
|
|
26625
|
+
.setApplicationContext(context)
|
|
26626
|
+
.setAppID(config.AppID)
|
|
26627
|
+
.setAppName(config.AppName)
|
|
26628
|
+
.setAppVersion(config.AppVersion) // 合法版本号应大于、等于 2 个分隔符,如:"1.3.2"
|
|
26629
|
+
.setAppChannel(config.AppChannel)
|
|
26630
|
+
.setLicenseUri(config.LicenseUri.android);
|
|
26631
|
+
androidEnv = builder.build();
|
|
26632
|
+
EnvHelper.init(androidEnv, {
|
|
26633
|
+
hybrid_ua: "rn|push|".concat("1.4.0"),
|
|
26634
|
+
});
|
|
26635
|
+
Env.openAppLog(config.openLog);
|
|
26636
|
+
TTNetManager.initTTNet(context);
|
|
26637
|
+
return [2 /*return*/];
|
|
26638
|
+
}
|
|
26639
|
+
});
|
|
26640
|
+
});
|
|
26641
|
+
}
|
|
26642
|
+
function initIOSEnv(config) {
|
|
26643
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
26644
|
+
return __generator(this, function (_a) {
|
|
26645
|
+
VeLivePushHelper.startWithConfiguration(__assign(__assign({}, config), { LicenseUri: config.LicenseUri.ios, appLogAid: '500808' , hybrid_ua: "rn|push|".concat("1.4.0") }));
|
|
26646
|
+
return [2 /*return*/];
|
|
26647
|
+
});
|
|
26648
|
+
});
|
|
26649
|
+
}
|
|
26650
|
+
var hasInitEnv = false;
|
|
26651
|
+
function initEnv(config) {
|
|
26652
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
26653
|
+
var mergedConfig;
|
|
26654
|
+
return __generator(this, function (_a) {
|
|
26655
|
+
if (hasInitEnv) {
|
|
26656
|
+
return [2 /*return*/];
|
|
26657
|
+
}
|
|
26658
|
+
mergedConfig = Object.assign({
|
|
26659
|
+
openLog: true,
|
|
26660
|
+
}, config);
|
|
26661
|
+
switch (reactNative.Platform.OS) {
|
|
26662
|
+
case 'android':
|
|
26663
|
+
initAndroidEnv(mergedConfig);
|
|
26664
|
+
break;
|
|
26665
|
+
case 'ios':
|
|
26666
|
+
initIOSEnv(mergedConfig);
|
|
26667
|
+
break;
|
|
26668
|
+
default:
|
|
26669
|
+
throw new Error('Unsupported platform');
|
|
26670
|
+
}
|
|
26671
|
+
hasInitEnv = true;
|
|
26672
|
+
return [2 /*return*/];
|
|
26673
|
+
});
|
|
26674
|
+
});
|
|
26675
|
+
}
|
|
26676
|
+
|
|
26580
26677
|
var IosUIView = function () {
|
|
26581
26678
|
var _a;
|
|
26582
26679
|
var _classSuper = NativeView;
|
|
@@ -26640,7 +26737,7 @@ var IosUIView = function () {
|
|
|
26640
26737
|
// export class TVLPlayerItem extends TVLManager {
|
|
26641
26738
|
// //
|
|
26642
26739
|
// }
|
|
26643
|
-
|
|
26740
|
+
(function () {
|
|
26644
26741
|
var _classDecorators = [NativeClass('TTSDKLogConfiguration')];
|
|
26645
26742
|
var _classDescriptor;
|
|
26646
26743
|
var _classExtraInitializers = [];
|
|
@@ -26680,8 +26777,8 @@ var TTSDKLogConfiguration = function () {
|
|
|
26680
26777
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
26681
26778
|
})();
|
|
26682
26779
|
return _classThis;
|
|
26683
|
-
}();
|
|
26684
|
-
|
|
26780
|
+
})();
|
|
26781
|
+
(function () {
|
|
26685
26782
|
var _classDecorators = [NativeClass('TTSDKConfiguration')];
|
|
26686
26783
|
var _classDescriptor;
|
|
26687
26784
|
var _classExtraInitializers = [];
|
|
@@ -26757,8 +26854,8 @@ var TTSDKConfiguration = function () {
|
|
|
26757
26854
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
26758
26855
|
})();
|
|
26759
26856
|
return TTSDKConfiguration = _classThis;
|
|
26760
|
-
}();
|
|
26761
|
-
|
|
26857
|
+
})();
|
|
26858
|
+
(function () {
|
|
26762
26859
|
var _classDecorators = [NativeClass('TTSDKManager')];
|
|
26763
26860
|
var _classDescriptor;
|
|
26764
26861
|
var _classExtraInitializers = [];
|
|
@@ -26803,7 +26900,7 @@ var TTSDKManager = function () {
|
|
|
26803
26900
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
26804
26901
|
})();
|
|
26805
26902
|
return _classThis;
|
|
26806
|
-
}();
|
|
26903
|
+
})();
|
|
26807
26904
|
(function () {
|
|
26808
26905
|
var _classDecorators = [NativeClass('VeLivePlayerConfiguration')];
|
|
26809
26906
|
var _classDescriptor;
|
|
@@ -26848,83 +26945,6 @@ var TTSDKServiceVendor;
|
|
|
26848
26945
|
TTSDKServiceVendor[TTSDKServiceVendor["TTSDKServiceVendorCN"] = 1] = "TTSDKServiceVendorCN";
|
|
26849
26946
|
})(TTSDKServiceVendor || (TTSDKServiceVendor = {}));
|
|
26850
26947
|
|
|
26851
|
-
function initAndroidEnv(config) {
|
|
26852
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
26853
|
-
var builder, context, androidEnv;
|
|
26854
|
-
return __generator(this, function (_a) {
|
|
26855
|
-
switch (_a.label) {
|
|
26856
|
-
case 0:
|
|
26857
|
-
builder = new Config.Builder();
|
|
26858
|
-
return [4 /*yield*/, NativeVariables.getApplicationContext()];
|
|
26859
|
-
case 1:
|
|
26860
|
-
context = _a.sent();
|
|
26861
|
-
builder
|
|
26862
|
-
.setApplicationContext(context)
|
|
26863
|
-
.setAppID(config.AppID)
|
|
26864
|
-
.setAppName(config.AppName)
|
|
26865
|
-
.setAppVersion(config.AppVersion) // 合法版本号应大于、等于 2 个分隔符,如:"1.3.2"
|
|
26866
|
-
.setAppChannel(config.AppChannel)
|
|
26867
|
-
.setLicenseUri(config.LicenseUri.android);
|
|
26868
|
-
androidEnv = builder.build();
|
|
26869
|
-
Env.init(androidEnv);
|
|
26870
|
-
Env.openAppLog(config.openLog);
|
|
26871
|
-
TTNetManager.initTTNet(context);
|
|
26872
|
-
return [2 /*return*/];
|
|
26873
|
-
}
|
|
26874
|
-
});
|
|
26875
|
-
});
|
|
26876
|
-
}
|
|
26877
|
-
function initIOSEnv(config) {
|
|
26878
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
26879
|
-
var logCfg, cfg;
|
|
26880
|
-
var _a;
|
|
26881
|
-
return __generator(this, function (_b) {
|
|
26882
|
-
logCfg = new TTSDKLogConfiguration();
|
|
26883
|
-
logCfg.enableConsole = true;
|
|
26884
|
-
logCfg.enableLogFile = true;
|
|
26885
|
-
logCfg.enable = true;
|
|
26886
|
-
cfg = TTSDKConfiguration.defaultConfigurationWithAppID(config.AppID, config.LicenseUri.ios);
|
|
26887
|
-
cfg.channel = config.AppChannel;
|
|
26888
|
-
cfg.appName = config.AppName;
|
|
26889
|
-
cfg.appVersion = config.AppVersion;
|
|
26890
|
-
cfg.shouldInitAppLog = (_a = config.openLog) !== null && _a !== void 0 ? _a : true;
|
|
26891
|
-
cfg.logConfiguration = logCfg;
|
|
26892
|
-
TTSDKManager.setShouldReportToAppLog(true);
|
|
26893
|
-
if (config.UserUniqueID) {
|
|
26894
|
-
TTSDKManager.setCurrentUserUniqueID(config.UserUniqueID);
|
|
26895
|
-
}
|
|
26896
|
-
TTSDKManager.startWithConfiguration(cfg);
|
|
26897
|
-
return [2 /*return*/];
|
|
26898
|
-
});
|
|
26899
|
-
});
|
|
26900
|
-
}
|
|
26901
|
-
var hasInitEnv = false;
|
|
26902
|
-
function initEnv(config) {
|
|
26903
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
26904
|
-
var mergedConfig;
|
|
26905
|
-
return __generator(this, function (_a) {
|
|
26906
|
-
if (hasInitEnv) {
|
|
26907
|
-
return [2 /*return*/];
|
|
26908
|
-
}
|
|
26909
|
-
mergedConfig = Object.assign({
|
|
26910
|
-
openLog: true,
|
|
26911
|
-
}, config);
|
|
26912
|
-
switch (reactNative.Platform.OS) {
|
|
26913
|
-
case 'android':
|
|
26914
|
-
initAndroidEnv(mergedConfig);
|
|
26915
|
-
break;
|
|
26916
|
-
case 'ios':
|
|
26917
|
-
initIOSEnv(mergedConfig);
|
|
26918
|
-
break;
|
|
26919
|
-
default:
|
|
26920
|
-
throw new Error('Unsupported platform');
|
|
26921
|
-
}
|
|
26922
|
-
hasInitEnv = true;
|
|
26923
|
-
return [2 /*return*/];
|
|
26924
|
-
});
|
|
26925
|
-
});
|
|
26926
|
-
}
|
|
26927
|
-
|
|
26928
26948
|
var defaultConfig = {};
|
|
26929
26949
|
function initAndroidPusher(options) {
|
|
26930
26950
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -29,6 +29,9 @@ export declare class Env {
|
|
|
29
29
|
static openAppLog(cfg: any): void;
|
|
30
30
|
static getApplicationContext(): ApplicationContext;
|
|
31
31
|
}
|
|
32
|
+
export declare class EnvHelper {
|
|
33
|
+
static init(cfg: any, logHeaders: any): void;
|
|
34
|
+
}
|
|
32
35
|
declare class ConfigBuilder {
|
|
33
36
|
setApplicationContext(appContext: ApplicationContext): ConfigBuilder;
|
|
34
37
|
setAppID(appId: string): ConfigBuilder;
|
|
@@ -566,37 +566,36 @@ export declare enum VeLiveVideoCaptureType {
|
|
|
566
566
|
* @brief Capture the video with dual cameras.
|
|
567
567
|
*
|
|
568
568
|
*/
|
|
569
|
-
VeLiveVideoCaptureDualCamera = 2,
|
|
570
569
|
|
|
571
570
|
/** {en}
|
|
572
571
|
* @brief Capture the screen.
|
|
573
572
|
*
|
|
574
573
|
*/
|
|
575
|
-
VeLiveVideoCaptureScreen =
|
|
574
|
+
VeLiveVideoCaptureScreen = 2,
|
|
576
575
|
|
|
577
576
|
/** {en}
|
|
578
577
|
* @brief Capture the video with an external device or source.
|
|
579
578
|
*
|
|
580
579
|
*/
|
|
581
|
-
VeLiveVideoCaptureExternal =
|
|
580
|
+
VeLiveVideoCaptureExternal = 3,
|
|
582
581
|
|
|
583
582
|
/** {en}
|
|
584
583
|
* @brief Use a static image as the video source.
|
|
585
584
|
*
|
|
586
585
|
*/
|
|
587
|
-
VeLiveVideoCaptureCustomImage =
|
|
586
|
+
VeLiveVideoCaptureCustomImage = 4,
|
|
588
587
|
|
|
589
588
|
/** {en}
|
|
590
589
|
* @brief Use the last frame as the video source.
|
|
591
590
|
*
|
|
592
591
|
*/
|
|
593
|
-
VeLiveVideoCaptureLastFrame =
|
|
592
|
+
VeLiveVideoCaptureLastFrame = 5,
|
|
594
593
|
|
|
595
594
|
/** {en}
|
|
596
595
|
* @brief Use a black frame as the video source. This is usually used for debugging purposes or in special circumstances.
|
|
597
596
|
*
|
|
598
597
|
*/
|
|
599
|
-
VeLiveVideoCaptureDummyFrame =
|
|
598
|
+
VeLiveVideoCaptureDummyFrame = 6
|
|
600
599
|
}
|
|
601
600
|
export declare enum VeLiveVideoProfile {
|
|
602
601
|
|