@byteplus/react-native-live-pull 1.0.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/LICENSE +21 -0
- package/README.md +2 -0
- package/android/build.gradle +93 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +9 -0
- package/android/src/main/AndroidManifestNew.xml +8 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/NativeVariableManager.java +15 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModule.java +108 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModuleSpec.java +17 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLivePackage.java +27 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/VolcView.java +32 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/VolcViewManager.java +87 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/autogen/MethodSignature.java +129 -0
- package/ios/VeLivePullSDK.h +24 -0
- package/ios/VeLivePullSDK.m +91 -0
- package/ios/VeLivePullView.h +25 -0
- package/ios/VeLivePullView.m +74 -0
- package/ios/VeLivePullViewManager.m +59 -0
- package/lib/commonjs/index.js +10697 -0
- package/lib/module/index.js +10684 -0
- package/lib/typescript/codegen/android/api.d.ts +61 -0
- package/lib/typescript/codegen/android/callback.d.ts +40 -0
- package/lib/typescript/codegen/android/errorcode.d.ts +53 -0
- package/lib/typescript/codegen/android/index.d.ts +5 -0
- package/lib/typescript/codegen/android/keytype.d.ts +263 -0
- package/lib/typescript/codegen/android/types.d.ts +30 -0
- package/lib/typescript/codegen/ios/api.d.ts +81 -0
- package/lib/typescript/codegen/ios/callback.d.ts +44 -0
- package/lib/typescript/codegen/ios/errorcode.d.ts +56 -0
- package/lib/typescript/codegen/ios/index.d.ts +5 -0
- package/lib/typescript/codegen/ios/keytype.d.ts +271 -0
- package/lib/typescript/codegen/ios/types.d.ts +35 -0
- package/lib/typescript/codegen/pack/api.d.ts +381 -0
- package/lib/typescript/codegen/pack/callback.d.ts +217 -0
- package/lib/typescript/codegen/pack/errorcode.d.ts +150 -0
- package/lib/typescript/codegen/pack/index.d.ts +5 -0
- package/lib/typescript/codegen/pack/keytype.d.ts +931 -0
- package/lib/typescript/codegen/pack/types.d.ts +1 -0
- package/lib/typescript/component.d.ts +8 -0
- package/lib/typescript/core/api.d.ts +1 -0
- package/lib/typescript/core/callback.d.ts +1 -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 +1 -0
- package/lib/typescript/core/player.d.ts +16 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/platforms/android/extends.d.ts +39 -0
- package/lib/typescript/platforms/ios/extends.d.ts +41 -0
- package/lib/typescript/runtime/index.d.ts +1 -0
- package/package.json +32 -0
- package/react-native-velive-pull.podspec +45 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VeUIView.h
|
|
3
|
+
// rn
|
|
4
|
+
//
|
|
5
|
+
// Created by ByteDance on 2024/3/27.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <UIKit/UIKit.h>
|
|
10
|
+
#import <React/RCTComponent.h>
|
|
11
|
+
|
|
12
|
+
#ifndef VeUIView_h
|
|
13
|
+
#define VVeUIView_h
|
|
14
|
+
|
|
15
|
+
@interface VeUIView : UIView
|
|
16
|
+
|
|
17
|
+
@property (nonatomic, strong) NSString* viewId;
|
|
18
|
+
|
|
19
|
+
@property (nonatomic) BOOL hasRegister;
|
|
20
|
+
|
|
21
|
+
@property (nonatomic, copy) RCTBubblingEventBlock onLoad;
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
#endif /* VeUIView_h */
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VeUIView.m
|
|
3
|
+
// rn
|
|
4
|
+
//
|
|
5
|
+
// Created by ByteDance on 2024/5/20.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import "VeLivePullView.h"
|
|
10
|
+
|
|
11
|
+
@implementation VeUIView
|
|
12
|
+
|
|
13
|
+
- (instancetype) init {
|
|
14
|
+
self = [super init];
|
|
15
|
+
if (self != nil) {
|
|
16
|
+
self.clipsToBounds = YES;
|
|
17
|
+
}
|
|
18
|
+
return self;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
- (void) setViewId:(NSString *)viewId {
|
|
22
|
+
if ([_viewId isEqualToString:viewId]) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_viewId = viewId;
|
|
27
|
+
self.hasRegister = TRUE;
|
|
28
|
+
self.accessibilityLabel = [NSString stringWithFormat:@"VeUIView@%@", viewId];
|
|
29
|
+
|
|
30
|
+
[self emitLoaded];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
- (void) setOnLoad:(RCTBubblingEventBlock)onLoad {
|
|
34
|
+
_onLoad = onLoad;
|
|
35
|
+
|
|
36
|
+
[self emitLoaded];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
- (void) emitLoaded
|
|
40
|
+
{
|
|
41
|
+
if (_onLoad != nil && _hasRegister == TRUE) {
|
|
42
|
+
_onLoad(@{});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (void) insertSubview:(UIView *)view atIndex:(NSInteger)index {
|
|
47
|
+
// NSLog(@"insert playview, self bounds=%f x %f", self.bounds.size.width, self.bounds.size.height);
|
|
48
|
+
// NSLog(@"insert playview, view frame=%f x %f", view.frame.size.width, view.frame.size.height);
|
|
49
|
+
|
|
50
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
51
|
+
[super insertSubview:view atIndex:index];
|
|
52
|
+
[self setSubViewLayout:view];
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
- (void) addSubview:(UIView *)view {
|
|
57
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
58
|
+
[super addSubview:view];
|
|
59
|
+
[self setSubViewLayout:view];
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 设置 Auto Layout,确保 subView 始终匹配 view 尺寸
|
|
64
|
+
- (void) setSubViewLayout:(UIView *)view {
|
|
65
|
+
view.translatesAutoresizingMaskIntoConstraints = NO;
|
|
66
|
+
[NSLayoutConstraint activateConstraints:@[
|
|
67
|
+
[view.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],
|
|
68
|
+
[view.trailingAnchor constraintEqualToAnchor:self.trailingAnchor],
|
|
69
|
+
[view.topAnchor constraintEqualToAnchor:self.topAnchor],
|
|
70
|
+
[view.bottomAnchor constraintEqualToAnchor:self.bottomAnchor]
|
|
71
|
+
]];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VeUIView.m
|
|
3
|
+
// rn
|
|
4
|
+
//
|
|
5
|
+
// Created by ByteDance on 2024/3/27.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <React/RCTViewManager.h>
|
|
10
|
+
#import "VolcApiEngine/VolcViewManager.h"
|
|
11
|
+
#import "VeLivePullView.h"
|
|
12
|
+
|
|
13
|
+
@interface VeUIViewManager : RCTViewManager
|
|
14
|
+
|
|
15
|
+
@end
|
|
16
|
+
|
|
17
|
+
@implementation VeUIViewManager
|
|
18
|
+
|
|
19
|
+
RCT_EXPORT_MODULE(VolcView)
|
|
20
|
+
|
|
21
|
+
// 导出 events
|
|
22
|
+
RCT_EXPORT_VIEW_PROPERTY(onLoad, RCTBubblingEventBlock)
|
|
23
|
+
|
|
24
|
+
// 导出 events
|
|
25
|
+
RCT_CUSTOM_VIEW_PROPERTY(viewId, NSString, VeUIView)
|
|
26
|
+
{
|
|
27
|
+
if (json == nil) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
NSString * viewId = [RCTConvert NSString:json];
|
|
32
|
+
[view setViewId:viewId];
|
|
33
|
+
[VolcViewManager registerView:viewId view:view];
|
|
34
|
+
NSLog(@"[View] register view success viewId=%@", viewId);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
RCT_CUSTOM_VIEW_PROPERTY(kind, NSString, VeUIView)
|
|
38
|
+
{
|
|
39
|
+
if (json == nil) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// NSString *viewKind = [RCTConvert NSString:json];
|
|
44
|
+
// if ([viewKind isEqualToString:@"UIView"]) {
|
|
45
|
+
// UIView *sub = [[UIView alloc] init];
|
|
46
|
+
// [view insertSubview:sub atIndex:0];
|
|
47
|
+
// NSLog(@"[View] insert view with kind=%@", viewKind);
|
|
48
|
+
// }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
- (VeUIView *)view
|
|
52
|
+
{
|
|
53
|
+
VeUIView *view = [[VeUIView alloc] init];
|
|
54
|
+
view.accessibilityLabel = @"VolcView";
|
|
55
|
+
NSLog(@"[View] create VolcView success");
|
|
56
|
+
return view;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@end
|