@byteplus/react-native-live-pull 1.3.2-rc.0 → 1.4.0-rc.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 +14620 -0
- package/lib/module/index.js +14608 -0
- package/lib/typescript/codegen/android/api.d.ts +318 -0
- package/lib/typescript/codegen/android/callback.d.ts +206 -0
- package/lib/typescript/codegen/android/errorcode.d.ts +174 -0
- package/lib/typescript/codegen/android/external.d.ts +1 -0
- package/lib/typescript/codegen/android/index.d.ts +6 -0
- package/lib/typescript/codegen/android/keytype.d.ts +749 -0
- package/lib/typescript/codegen/android/types.d.ts +31 -0
- package/lib/typescript/codegen/ios/api.d.ts +295 -0
- package/lib/typescript/codegen/ios/callback.d.ts +176 -0
- package/lib/typescript/codegen/ios/errorcode.d.ts +160 -0
- package/lib/typescript/codegen/ios/external.d.ts +1 -0
- package/lib/typescript/codegen/ios/index.d.ts +6 -0
- package/lib/typescript/codegen/ios/keytype.d.ts +695 -0
- package/lib/typescript/codegen/ios/types.d.ts +46 -0
- package/lib/typescript/codegen/pack/api.d.ts +367 -0
- package/lib/typescript/codegen/pack/callback.d.ts +255 -0
- package/lib/typescript/codegen/pack/errorcode.d.ts +187 -0
- package/lib/typescript/codegen/pack/external.d.ts +1 -0
- package/lib/typescript/codegen/pack/index.d.ts +6 -0
- package/lib/typescript/codegen/pack/keytype.d.ts +909 -0
- package/lib/typescript/codegen/pack/types.d.ts +68 -0
- package/lib/typescript/component.d.ts +15 -0
- package/lib/typescript/core/api.d.ts +114 -0
- package/lib/typescript/core/appState.d.ts +3 -0
- package/lib/typescript/core/callback.d.ts +53 -0
- package/lib/typescript/core/env.d.ts +38 -0
- package/lib/typescript/core/errorcode.d.ts +1 -0
- package/lib/typescript/core/index.d.ts +6 -0
- package/lib/typescript/core/keytype.d.ts +33 -0
- package/lib/typescript/core/player.d.ts +16 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/platforms/android/extends.d.ts +42 -0
- package/lib/typescript/platforms/android/pictureInpicture.d.ts +26 -0
- package/lib/typescript/platforms/ios/extends.d.ts +46 -0
- package/lib/typescript/platforms/ios/pictureInpicture.d.ts +32 -0
- package/lib/typescript/runtime/index.d.ts +1 -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
|