@byteplus/react-native-live-pull 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/pull/EnvHelper.java +15 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/LoggerHelper.java +40 -0
- package/ios/VeLivePlayerHelper.h +14 -0
- package/ios/VeLivePlayerHelper.m +58 -0
- package/ios/VeLivePlayerLoggerHelper.h +14 -0
- package/ios/VeLivePlayerLoggerHelper.m +42 -0
- package/ios/VeLivePlayerMultiObserver.h +0 -1
- package/lib/commonjs/index.js +96 -31
- package/lib/module/index.js +96 -31
- package/lib/typescript/core/env.d.ts +1 -1
- package/lib/typescript/platforms/android/extends.d.ts +3 -0
- package/lib/typescript/platforms/ios/extends.d.ts +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package com.volcengine.velive.rn.pull;
|
|
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.pull;
|
|
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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// LoggerHelper.h
|
|
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 VeLivePlayerHelper : NSObject
|
|
11
|
+
|
|
12
|
+
+ (void)startWithConfiguration:(NSDictionary *)config;
|
|
13
|
+
|
|
14
|
+
@end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VeLivePlayerHelper.m // 修复:文件头部注释文件名错误
|
|
3
|
+
// react-native-live-pull
|
|
4
|
+
//
|
|
5
|
+
// Created by iOS Team on 2024/xx/xx.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <TTSDKFramework/TTSDKFramework.h>
|
|
10
|
+
#import "VeLivePlayerLoggerHelper.h"
|
|
11
|
+
|
|
12
|
+
#import "VeLivePlayerHelper.h"
|
|
13
|
+
@implementation VeLivePlayerHelper
|
|
14
|
+
|
|
15
|
+
+ (void)startWithConfiguration:(NSDictionary *)config {
|
|
16
|
+
if (!config || ![config isKindOfClass:NSDictionary.class]) {
|
|
17
|
+
NSLog(@"VeLivePlayerHelper: Invalid configuration");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
NSString *licenseUri = [config valueForKey:@"LicenseUri"];
|
|
22
|
+
NSString *appId = [config valueForKey:@"AppID"];
|
|
23
|
+
|
|
24
|
+
TTSDKConfiguration *cfg = [TTSDKConfiguration defaultConfigurationWithAppID:appId
|
|
25
|
+
licenseName:licenseUri];
|
|
26
|
+
|
|
27
|
+
TTSDKLogConfiguration *logCfg = [TTSDKLogConfiguration new];
|
|
28
|
+
logCfg.enableConsole = YES;
|
|
29
|
+
logCfg.enableLogFile = YES;
|
|
30
|
+
logCfg.enable = YES;
|
|
31
|
+
|
|
32
|
+
cfg.logConfiguration = logCfg;
|
|
33
|
+
// 通道配置,一般传分发类型,内测、公测、线上等
|
|
34
|
+
cfg.channel = [config valueForKey:@"AppChannel"];
|
|
35
|
+
// App 名称
|
|
36
|
+
cfg.appName = [config valueForKey:@"AppName"];
|
|
37
|
+
// 版本号
|
|
38
|
+
cfg.appVersion = [config valueForKey:@"AppVersion"];
|
|
39
|
+
|
|
40
|
+
id openLogValue = [config valueForKey:@"openLog"];
|
|
41
|
+
cfg.shouldInitAppLog = (openLogValue != nil && [openLogValue isKindOfClass:[NSNumber class]]) ? [openLogValue boolValue] : YES;
|
|
42
|
+
|
|
43
|
+
cfg.bizType = TTSDKServiceBizType_Live;
|
|
44
|
+
|
|
45
|
+
[TTSDKManager setCurrentUserUniqueID:[config valueForKey:@"UserUniqueID"]];
|
|
46
|
+
[TTSDKManager setShouldReportToAppLog:YES];
|
|
47
|
+
|
|
48
|
+
[TTSDKManager startWithConfiguration:cfg];
|
|
49
|
+
|
|
50
|
+
[VeLivePlayerLoggerHelper setHeaderInfo:@{
|
|
51
|
+
@"appId": [config valueForKey:@"appLogAid"],
|
|
52
|
+
@"headers": @{
|
|
53
|
+
@"hybrid_ua": [config valueForKey:@"hybrid_ua"],
|
|
54
|
+
}
|
|
55
|
+
}];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// LoggerHelper.h
|
|
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 VeLivePlayerLoggerHelper : NSObject
|
|
11
|
+
|
|
12
|
+
+ (void)setHeaderInfo:(NSDictionary *)params;
|
|
13
|
+
|
|
14
|
+
@end
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
#import <TTSDKFramework/TTSDKFramework.h>
|
|
10
|
+
|
|
11
|
+
@interface VeLivePlayerLoggerHelper : NSObject
|
|
12
|
+
|
|
13
|
+
+ (void)setHeaderInfo:(NSDictionary *)params;
|
|
14
|
+
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
@implementation VeLivePlayerLoggerHelper
|
|
18
|
+
|
|
19
|
+
+ (void)setHeaderInfo:(NSDictionary *)params {
|
|
20
|
+
NSString *appId = [params valueForKey:@"appId"];
|
|
21
|
+
if ([appId isKindOfClass:NSString.class] && appId.length > 0) {
|
|
22
|
+
Class autoTrack = NSClassFromString(@"BDAutoTrack");
|
|
23
|
+
if (!autoTrack || ![autoTrack respondsToSelector:NSSelectorFromString(@"trackWithAppID:")]) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
id trackInstance = [autoTrack performSelector:@selector(trackWithAppID:) withObject:appId];
|
|
28
|
+
if (![trackInstance respondsToSelector:@selector(setCustomHeaderValue:forKey:)]) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
id headers = [params valueForKey:@"headers"];
|
|
33
|
+
if ([headers isKindOfClass:NSDictionary.class]) {
|
|
34
|
+
NSDictionary *headersDict = (NSDictionary *)headers;
|
|
35
|
+
[headersDict enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
|
|
36
|
+
[trackInstance performSelector:@selector(setCustomHeaderValue:forKey:) withObject:obj withObject:key];
|
|
37
|
+
}];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@end
|
package/lib/commonjs/index.js
CHANGED
|
@@ -2933,15 +2933,15 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
2933
2933
|
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
2934
2934
|
|
|
2935
2935
|
|
|
2936
|
-
var __assign = function() {
|
|
2937
|
-
__assign = Object.assign || function __assign(t) {
|
|
2936
|
+
var __assign$1 = function() {
|
|
2937
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
2938
2938
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2939
2939
|
s = arguments[i];
|
|
2940
2940
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2941
2941
|
}
|
|
2942
2942
|
return t;
|
|
2943
2943
|
};
|
|
2944
|
-
return __assign.apply(this, arguments);
|
|
2944
|
+
return __assign$1.apply(this, arguments);
|
|
2945
2945
|
};
|
|
2946
2946
|
|
|
2947
2947
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
@@ -2954,7 +2954,7 @@ var ReactNativeEnv = /** @class */ (function () {
|
|
|
2954
2954
|
}
|
|
2955
2955
|
ReactNativeEnv.prototype.resolveImageResource = function (input) {
|
|
2956
2956
|
var r = reactNative.Image.resolveAssetSource(input);
|
|
2957
|
-
return __assign(__assign({}, r), { _type: "image_resource" /* ARG_TYPE.IMAGE_RESOURCE */ });
|
|
2957
|
+
return __assign$1(__assign$1({}, r), { _type: "image_resource" /* ARG_TYPE.IMAGE_RESOURCE */ });
|
|
2958
2958
|
};
|
|
2959
2959
|
ReactNativeEnv.prototype.os = function () {
|
|
2960
2960
|
return reactNative.Platform.OS;
|
|
@@ -2993,6 +2993,17 @@ function __extends(d, b) {
|
|
|
2993
2993
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2994
2994
|
}
|
|
2995
2995
|
|
|
2996
|
+
var __assign = function() {
|
|
2997
|
+
__assign = Object.assign || function __assign(t) {
|
|
2998
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2999
|
+
s = arguments[i];
|
|
3000
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3001
|
+
}
|
|
3002
|
+
return t;
|
|
3003
|
+
};
|
|
3004
|
+
return __assign.apply(this, arguments);
|
|
3005
|
+
};
|
|
3006
|
+
|
|
2996
3007
|
function __rest(s, e) {
|
|
2997
3008
|
var t = {};
|
|
2998
3009
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -5912,6 +5923,34 @@ var Env = function () {
|
|
|
5912
5923
|
})();
|
|
5913
5924
|
return _classThis;
|
|
5914
5925
|
}();
|
|
5926
|
+
var EnvHelper = function () {
|
|
5927
|
+
var _classDecorators = [NativeClass('com.volcengine.velive.rn.pull.EnvHelper')];
|
|
5928
|
+
var _classDescriptor;
|
|
5929
|
+
var _classExtraInitializers = [];
|
|
5930
|
+
var _classThis;
|
|
5931
|
+
var _staticExtraInitializers = [];
|
|
5932
|
+
var _static_init_decorators;
|
|
5933
|
+
_classThis = /** @class */ (function () {
|
|
5934
|
+
function EnvHelper_1() {
|
|
5935
|
+
}
|
|
5936
|
+
EnvHelper_1.init = function (cfg, logInfo) {
|
|
5937
|
+
throw new Error('');
|
|
5938
|
+
};
|
|
5939
|
+
return EnvHelper_1;
|
|
5940
|
+
}());
|
|
5941
|
+
__setFunctionName(_classThis, "EnvHelper");
|
|
5942
|
+
(function () {
|
|
5943
|
+
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
5944
|
+
_static_init_decorators = [NativeStaticMethodSync()];
|
|
5945
|
+
__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);
|
|
5946
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
5947
|
+
_classThis = _classDescriptor.value;
|
|
5948
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
5949
|
+
__runInitializers(_classThis, _staticExtraInitializers);
|
|
5950
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5951
|
+
})();
|
|
5952
|
+
return _classThis;
|
|
5953
|
+
}();
|
|
5915
5954
|
var ConfigBuilder = function () {
|
|
5916
5955
|
var _classDecorators = [NativeClass('com.pandora.common.env.config.Config$Builder')];
|
|
5917
5956
|
var _classDescriptor;
|
|
@@ -8461,7 +8500,7 @@ var NativeUIView = function () {
|
|
|
8461
8500
|
})();
|
|
8462
8501
|
return _classThis;
|
|
8463
8502
|
})();
|
|
8464
|
-
|
|
8503
|
+
(function () {
|
|
8465
8504
|
var _classDecorators = [NativeClass('TTSDKLogConfiguration')];
|
|
8466
8505
|
var _classDescriptor;
|
|
8467
8506
|
var _classExtraInitializers = [];
|
|
@@ -8501,8 +8540,8 @@ var TTSDKLogConfiguration = function () {
|
|
|
8501
8540
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
8502
8541
|
})();
|
|
8503
8542
|
return _classThis;
|
|
8504
|
-
}();
|
|
8505
|
-
|
|
8543
|
+
})();
|
|
8544
|
+
(function () {
|
|
8506
8545
|
var _classDecorators = [NativeClass('TTSDKConfiguration')];
|
|
8507
8546
|
var _classDescriptor;
|
|
8508
8547
|
var _classExtraInitializers = [];
|
|
@@ -8578,8 +8617,8 @@ var TTSDKConfiguration = function () {
|
|
|
8578
8617
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
8579
8618
|
})();
|
|
8580
8619
|
return TTSDKConfiguration = _classThis;
|
|
8581
|
-
}();
|
|
8582
|
-
|
|
8620
|
+
})();
|
|
8621
|
+
(function () {
|
|
8583
8622
|
var _classDecorators = [NativeClass('TTSDKManager')];
|
|
8584
8623
|
var _classDescriptor;
|
|
8585
8624
|
var _classExtraInitializers = [];
|
|
@@ -8624,6 +8663,34 @@ var TTSDKManager = function () {
|
|
|
8624
8663
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
8625
8664
|
})();
|
|
8626
8665
|
return _classThis;
|
|
8666
|
+
})();
|
|
8667
|
+
var VeLivePlayerHelper = function () {
|
|
8668
|
+
var _classDecorators = [NativeClass('VeLivePlayerHelper')];
|
|
8669
|
+
var _classDescriptor;
|
|
8670
|
+
var _classExtraInitializers = [];
|
|
8671
|
+
var _classThis;
|
|
8672
|
+
var _staticExtraInitializers = [];
|
|
8673
|
+
var _static_startWithConfiguration_decorators;
|
|
8674
|
+
_classThis = /** @class */ (function () {
|
|
8675
|
+
function VeLivePlayerHelper_1() {
|
|
8676
|
+
}
|
|
8677
|
+
VeLivePlayerHelper_1.startWithConfiguration = function (cfg) {
|
|
8678
|
+
//
|
|
8679
|
+
};
|
|
8680
|
+
return VeLivePlayerHelper_1;
|
|
8681
|
+
}());
|
|
8682
|
+
__setFunctionName(_classThis, "VeLivePlayerHelper");
|
|
8683
|
+
(function () {
|
|
8684
|
+
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
8685
|
+
_static_startWithConfiguration_decorators = [NativeStaticMethodSync('startWithConfiguration:')];
|
|
8686
|
+
__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);
|
|
8687
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
8688
|
+
_classThis = _classDescriptor.value;
|
|
8689
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
8690
|
+
__runInitializers(_classThis, _staticExtraInitializers);
|
|
8691
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
8692
|
+
})();
|
|
8693
|
+
return _classThis;
|
|
8627
8694
|
}();
|
|
8628
8695
|
(function () {
|
|
8629
8696
|
var _classDecorators = [NativeClass('VeLivePlayerConfiguration')];
|
|
@@ -14197,10 +14264,22 @@ extendsClassMethod(VeLivePlayer, 'setEnableIgnoreAudioInterruption', function ()
|
|
|
14197
14264
|
});
|
|
14198
14265
|
extendsClassMethod(VeLivePlayer, 'addExtraHttpRequestHeadersByUser', function () {
|
|
14199
14266
|
return function addExtraHttpRequestHeadersByUser(headers) {
|
|
14267
|
+
var defaultHeaders = { 'User-Agent': 'rn' };
|
|
14268
|
+
return runImpl(this, function (engine) {
|
|
14269
|
+
engine.addExtraHttpRequestHeadersByUser(__assign(__assign({}, defaultHeaders), headers));
|
|
14270
|
+
}, function (engine) {
|
|
14271
|
+
engine.addExtraHttpRequestHeadersByUser(__assign(__assign({}, defaultHeaders), headers));
|
|
14272
|
+
});
|
|
14273
|
+
};
|
|
14274
|
+
});
|
|
14275
|
+
extendsClassMethod(VeLivePlayer, 'play', function () {
|
|
14276
|
+
return function play() {
|
|
14200
14277
|
return runImpl(this, function (engine) {
|
|
14201
|
-
engine.addExtraHttpRequestHeadersByUser(
|
|
14278
|
+
engine.addExtraHttpRequestHeadersByUser({});
|
|
14279
|
+
engine.play();
|
|
14202
14280
|
}, function (engine) {
|
|
14203
|
-
engine.addExtraHttpRequestHeadersByUser(
|
|
14281
|
+
engine.addExtraHttpRequestHeadersByUser({});
|
|
14282
|
+
engine.play();
|
|
14204
14283
|
});
|
|
14205
14284
|
};
|
|
14206
14285
|
});
|
|
@@ -14366,7 +14445,9 @@ function initAndroidEnv(config) {
|
|
|
14366
14445
|
.setAppChannel(config.AppChannel)
|
|
14367
14446
|
.setLicenseUri(config.LicenseUri.android);
|
|
14368
14447
|
androidEnv = builder.build();
|
|
14369
|
-
|
|
14448
|
+
EnvHelper.init(androidEnv, {
|
|
14449
|
+
hybrid_ua: "rn|pull|".concat("1.4.0"),
|
|
14450
|
+
});
|
|
14370
14451
|
Env.openAppLog(config.openLog);
|
|
14371
14452
|
return [2 /*return*/];
|
|
14372
14453
|
}
|
|
@@ -14375,30 +14456,14 @@ function initAndroidEnv(config) {
|
|
|
14375
14456
|
}
|
|
14376
14457
|
function initIOSEnv(config) {
|
|
14377
14458
|
return __awaiter(this, void 0, void 0, function () {
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
return __generator(this, function (_b) {
|
|
14381
|
-
logCfg = new TTSDKLogConfiguration();
|
|
14382
|
-
logCfg.enableConsole = true;
|
|
14383
|
-
logCfg.enableLogFile = true;
|
|
14384
|
-
logCfg.enable = true;
|
|
14385
|
-
cfg = TTSDKConfiguration.defaultConfigurationWithAppID(config.AppID, config.LicenseUri.ios);
|
|
14386
|
-
cfg.channel = config.AppChannel;
|
|
14387
|
-
cfg.appName = config.AppName;
|
|
14388
|
-
cfg.appVersion = config.AppVersion;
|
|
14389
|
-
cfg.shouldInitAppLog = (_a = config.openLog) !== null && _a !== void 0 ? _a : true;
|
|
14390
|
-
cfg.logConfiguration = logCfg;
|
|
14391
|
-
TTSDKManager.setShouldReportToAppLog(true);
|
|
14392
|
-
if (config.UserUniqueID) {
|
|
14393
|
-
TTSDKManager.setCurrentUserUniqueID(config.UserUniqueID);
|
|
14394
|
-
}
|
|
14395
|
-
TTSDKManager.startWithConfiguration(cfg);
|
|
14459
|
+
return __generator(this, function (_a) {
|
|
14460
|
+
VeLivePlayerHelper.startWithConfiguration(__assign(__assign({}, config), { LicenseUri: config.LicenseUri.ios, appLogAid: '500808' , hybrid_ua: "rn|pull|".concat("1.4.0") }));
|
|
14396
14461
|
return [2 /*return*/];
|
|
14397
14462
|
});
|
|
14398
14463
|
});
|
|
14399
14464
|
}
|
|
14400
14465
|
var hasInitEnv = false;
|
|
14401
|
-
/**
|
|
14466
|
+
/**s
|
|
14402
14467
|
* @detail api
|
|
14403
14468
|
* @param config Env 初始化配置。
|
|
14404
14469
|
*/
|
package/lib/module/index.js
CHANGED
|
@@ -2931,15 +2931,15 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
2931
2931
|
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
2932
2932
|
|
|
2933
2933
|
|
|
2934
|
-
var __assign = function() {
|
|
2935
|
-
__assign = Object.assign || function __assign(t) {
|
|
2934
|
+
var __assign$1 = function() {
|
|
2935
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
2936
2936
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2937
2937
|
s = arguments[i];
|
|
2938
2938
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2939
2939
|
}
|
|
2940
2940
|
return t;
|
|
2941
2941
|
};
|
|
2942
|
-
return __assign.apply(this, arguments);
|
|
2942
|
+
return __assign$1.apply(this, arguments);
|
|
2943
2943
|
};
|
|
2944
2944
|
|
|
2945
2945
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
@@ -2952,7 +2952,7 @@ var ReactNativeEnv = /** @class */ (function () {
|
|
|
2952
2952
|
}
|
|
2953
2953
|
ReactNativeEnv.prototype.resolveImageResource = function (input) {
|
|
2954
2954
|
var r = Image.resolveAssetSource(input);
|
|
2955
|
-
return __assign(__assign({}, r), { _type: "image_resource" /* ARG_TYPE.IMAGE_RESOURCE */ });
|
|
2955
|
+
return __assign$1(__assign$1({}, r), { _type: "image_resource" /* ARG_TYPE.IMAGE_RESOURCE */ });
|
|
2956
2956
|
};
|
|
2957
2957
|
ReactNativeEnv.prototype.os = function () {
|
|
2958
2958
|
return Platform.OS;
|
|
@@ -2991,6 +2991,17 @@ function __extends(d, b) {
|
|
|
2991
2991
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2992
2992
|
}
|
|
2993
2993
|
|
|
2994
|
+
var __assign = function() {
|
|
2995
|
+
__assign = Object.assign || function __assign(t) {
|
|
2996
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2997
|
+
s = arguments[i];
|
|
2998
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2999
|
+
}
|
|
3000
|
+
return t;
|
|
3001
|
+
};
|
|
3002
|
+
return __assign.apply(this, arguments);
|
|
3003
|
+
};
|
|
3004
|
+
|
|
2994
3005
|
function __rest(s, e) {
|
|
2995
3006
|
var t = {};
|
|
2996
3007
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -5910,6 +5921,34 @@ var Env = function () {
|
|
|
5910
5921
|
})();
|
|
5911
5922
|
return _classThis;
|
|
5912
5923
|
}();
|
|
5924
|
+
var EnvHelper = function () {
|
|
5925
|
+
var _classDecorators = [NativeClass('com.volcengine.velive.rn.pull.EnvHelper')];
|
|
5926
|
+
var _classDescriptor;
|
|
5927
|
+
var _classExtraInitializers = [];
|
|
5928
|
+
var _classThis;
|
|
5929
|
+
var _staticExtraInitializers = [];
|
|
5930
|
+
var _static_init_decorators;
|
|
5931
|
+
_classThis = /** @class */ (function () {
|
|
5932
|
+
function EnvHelper_1() {
|
|
5933
|
+
}
|
|
5934
|
+
EnvHelper_1.init = function (cfg, logInfo) {
|
|
5935
|
+
throw new Error('');
|
|
5936
|
+
};
|
|
5937
|
+
return EnvHelper_1;
|
|
5938
|
+
}());
|
|
5939
|
+
__setFunctionName(_classThis, "EnvHelper");
|
|
5940
|
+
(function () {
|
|
5941
|
+
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
5942
|
+
_static_init_decorators = [NativeStaticMethodSync()];
|
|
5943
|
+
__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);
|
|
5944
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
5945
|
+
_classThis = _classDescriptor.value;
|
|
5946
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
5947
|
+
__runInitializers(_classThis, _staticExtraInitializers);
|
|
5948
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
5949
|
+
})();
|
|
5950
|
+
return _classThis;
|
|
5951
|
+
}();
|
|
5913
5952
|
var ConfigBuilder = function () {
|
|
5914
5953
|
var _classDecorators = [NativeClass('com.pandora.common.env.config.Config$Builder')];
|
|
5915
5954
|
var _classDescriptor;
|
|
@@ -8459,7 +8498,7 @@ var NativeUIView = function () {
|
|
|
8459
8498
|
})();
|
|
8460
8499
|
return _classThis;
|
|
8461
8500
|
})();
|
|
8462
|
-
|
|
8501
|
+
(function () {
|
|
8463
8502
|
var _classDecorators = [NativeClass('TTSDKLogConfiguration')];
|
|
8464
8503
|
var _classDescriptor;
|
|
8465
8504
|
var _classExtraInitializers = [];
|
|
@@ -8499,8 +8538,8 @@ var TTSDKLogConfiguration = function () {
|
|
|
8499
8538
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
8500
8539
|
})();
|
|
8501
8540
|
return _classThis;
|
|
8502
|
-
}();
|
|
8503
|
-
|
|
8541
|
+
})();
|
|
8542
|
+
(function () {
|
|
8504
8543
|
var _classDecorators = [NativeClass('TTSDKConfiguration')];
|
|
8505
8544
|
var _classDescriptor;
|
|
8506
8545
|
var _classExtraInitializers = [];
|
|
@@ -8576,8 +8615,8 @@ var TTSDKConfiguration = function () {
|
|
|
8576
8615
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
8577
8616
|
})();
|
|
8578
8617
|
return TTSDKConfiguration = _classThis;
|
|
8579
|
-
}();
|
|
8580
|
-
|
|
8618
|
+
})();
|
|
8619
|
+
(function () {
|
|
8581
8620
|
var _classDecorators = [NativeClass('TTSDKManager')];
|
|
8582
8621
|
var _classDescriptor;
|
|
8583
8622
|
var _classExtraInitializers = [];
|
|
@@ -8622,6 +8661,34 @@ var TTSDKManager = function () {
|
|
|
8622
8661
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
8623
8662
|
})();
|
|
8624
8663
|
return _classThis;
|
|
8664
|
+
})();
|
|
8665
|
+
var VeLivePlayerHelper = function () {
|
|
8666
|
+
var _classDecorators = [NativeClass('VeLivePlayerHelper')];
|
|
8667
|
+
var _classDescriptor;
|
|
8668
|
+
var _classExtraInitializers = [];
|
|
8669
|
+
var _classThis;
|
|
8670
|
+
var _staticExtraInitializers = [];
|
|
8671
|
+
var _static_startWithConfiguration_decorators;
|
|
8672
|
+
_classThis = /** @class */ (function () {
|
|
8673
|
+
function VeLivePlayerHelper_1() {
|
|
8674
|
+
}
|
|
8675
|
+
VeLivePlayerHelper_1.startWithConfiguration = function (cfg) {
|
|
8676
|
+
//
|
|
8677
|
+
};
|
|
8678
|
+
return VeLivePlayerHelper_1;
|
|
8679
|
+
}());
|
|
8680
|
+
__setFunctionName(_classThis, "VeLivePlayerHelper");
|
|
8681
|
+
(function () {
|
|
8682
|
+
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
8683
|
+
_static_startWithConfiguration_decorators = [NativeStaticMethodSync('startWithConfiguration:')];
|
|
8684
|
+
__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);
|
|
8685
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
8686
|
+
_classThis = _classDescriptor.value;
|
|
8687
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
8688
|
+
__runInitializers(_classThis, _staticExtraInitializers);
|
|
8689
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
8690
|
+
})();
|
|
8691
|
+
return _classThis;
|
|
8625
8692
|
}();
|
|
8626
8693
|
(function () {
|
|
8627
8694
|
var _classDecorators = [NativeClass('VeLivePlayerConfiguration')];
|
|
@@ -14195,10 +14262,22 @@ extendsClassMethod(VeLivePlayer, 'setEnableIgnoreAudioInterruption', function ()
|
|
|
14195
14262
|
});
|
|
14196
14263
|
extendsClassMethod(VeLivePlayer, 'addExtraHttpRequestHeadersByUser', function () {
|
|
14197
14264
|
return function addExtraHttpRequestHeadersByUser(headers) {
|
|
14265
|
+
var defaultHeaders = { 'User-Agent': 'rn' };
|
|
14266
|
+
return runImpl(this, function (engine) {
|
|
14267
|
+
engine.addExtraHttpRequestHeadersByUser(__assign(__assign({}, defaultHeaders), headers));
|
|
14268
|
+
}, function (engine) {
|
|
14269
|
+
engine.addExtraHttpRequestHeadersByUser(__assign(__assign({}, defaultHeaders), headers));
|
|
14270
|
+
});
|
|
14271
|
+
};
|
|
14272
|
+
});
|
|
14273
|
+
extendsClassMethod(VeLivePlayer, 'play', function () {
|
|
14274
|
+
return function play() {
|
|
14198
14275
|
return runImpl(this, function (engine) {
|
|
14199
|
-
engine.addExtraHttpRequestHeadersByUser(
|
|
14276
|
+
engine.addExtraHttpRequestHeadersByUser({});
|
|
14277
|
+
engine.play();
|
|
14200
14278
|
}, function (engine) {
|
|
14201
|
-
engine.addExtraHttpRequestHeadersByUser(
|
|
14279
|
+
engine.addExtraHttpRequestHeadersByUser({});
|
|
14280
|
+
engine.play();
|
|
14202
14281
|
});
|
|
14203
14282
|
};
|
|
14204
14283
|
});
|
|
@@ -14364,7 +14443,9 @@ function initAndroidEnv(config) {
|
|
|
14364
14443
|
.setAppChannel(config.AppChannel)
|
|
14365
14444
|
.setLicenseUri(config.LicenseUri.android);
|
|
14366
14445
|
androidEnv = builder.build();
|
|
14367
|
-
|
|
14446
|
+
EnvHelper.init(androidEnv, {
|
|
14447
|
+
hybrid_ua: "rn|pull|".concat("1.4.0"),
|
|
14448
|
+
});
|
|
14368
14449
|
Env.openAppLog(config.openLog);
|
|
14369
14450
|
return [2 /*return*/];
|
|
14370
14451
|
}
|
|
@@ -14373,30 +14454,14 @@ function initAndroidEnv(config) {
|
|
|
14373
14454
|
}
|
|
14374
14455
|
function initIOSEnv(config) {
|
|
14375
14456
|
return __awaiter(this, void 0, void 0, function () {
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
return __generator(this, function (_b) {
|
|
14379
|
-
logCfg = new TTSDKLogConfiguration();
|
|
14380
|
-
logCfg.enableConsole = true;
|
|
14381
|
-
logCfg.enableLogFile = true;
|
|
14382
|
-
logCfg.enable = true;
|
|
14383
|
-
cfg = TTSDKConfiguration.defaultConfigurationWithAppID(config.AppID, config.LicenseUri.ios);
|
|
14384
|
-
cfg.channel = config.AppChannel;
|
|
14385
|
-
cfg.appName = config.AppName;
|
|
14386
|
-
cfg.appVersion = config.AppVersion;
|
|
14387
|
-
cfg.shouldInitAppLog = (_a = config.openLog) !== null && _a !== void 0 ? _a : true;
|
|
14388
|
-
cfg.logConfiguration = logCfg;
|
|
14389
|
-
TTSDKManager.setShouldReportToAppLog(true);
|
|
14390
|
-
if (config.UserUniqueID) {
|
|
14391
|
-
TTSDKManager.setCurrentUserUniqueID(config.UserUniqueID);
|
|
14392
|
-
}
|
|
14393
|
-
TTSDKManager.startWithConfiguration(cfg);
|
|
14457
|
+
return __generator(this, function (_a) {
|
|
14458
|
+
VeLivePlayerHelper.startWithConfiguration(__assign(__assign({}, config), { LicenseUri: config.LicenseUri.ios, appLogAid: '500808' , hybrid_ua: "rn|pull|".concat("1.4.0") }));
|
|
14394
14459
|
return [2 /*return*/];
|
|
14395
14460
|
});
|
|
14396
14461
|
});
|
|
14397
14462
|
}
|
|
14398
14463
|
var hasInitEnv = false;
|
|
14399
|
-
/**
|
|
14464
|
+
/**s
|
|
14400
14465
|
* @detail api
|
|
14401
14466
|
* @param config Env 初始化配置。
|
|
14402
14467
|
*/
|
|
@@ -24,6 +24,9 @@ export declare class Env {
|
|
|
24
24
|
static openAppLog(cfg: any): void;
|
|
25
25
|
static getApplicationContext(): ApplicationContext;
|
|
26
26
|
}
|
|
27
|
+
export declare class EnvHelper {
|
|
28
|
+
static init(cfg: any, logInfo: any): void;
|
|
29
|
+
}
|
|
27
30
|
declare class ConfigBuilder {
|
|
28
31
|
setApplicationContext(appContext: ApplicationContext): ConfigBuilder;
|
|
29
32
|
setAppID(appId: string): ConfigBuilder;
|
|
@@ -28,6 +28,9 @@ export declare class TTSDKManager {
|
|
|
28
28
|
static setAppLogCustomData(val: Record<string, string>): void;
|
|
29
29
|
static startWithConfiguration(cfg: TTSDKConfiguration): void;
|
|
30
30
|
}
|
|
31
|
+
export declare class VeLivePlayerHelper {
|
|
32
|
+
static startWithConfiguration(cfg: any): void;
|
|
33
|
+
}
|
|
31
34
|
export declare class VeLivePlayerConfiguration {
|
|
32
35
|
enableStatisticsCallback: boolean;
|
|
33
36
|
statisticsCallbackInterval: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteplus/react-native-live-pull",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "*",
|
|
6
6
|
"react-native": "*"
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
},
|
|
34
34
|
"nativeVersion": {
|
|
35
35
|
"volc": {
|
|
36
|
-
"android": "1.
|
|
36
|
+
"android": "1.47.3.8",
|
|
37
37
|
"ios": "1.46.3.10-premium"
|
|
38
38
|
},
|
|
39
39
|
"byteplus": {
|
|
40
|
-
"android": "1.
|
|
40
|
+
"android": "1.47.300.4",
|
|
41
41
|
"ios": "1.46.300.7-premium"
|
|
42
42
|
}
|
|
43
43
|
}
|