@byteplus/react-native-live-pull 1.3.0-rc.1 → 1.3.0-rc.10
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/build.gradle +37 -2
- package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowHelper.java +1 -1
- package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowService.java +2 -0
- package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/PictureInPictureManager.java +3 -0
- package/ios/VeLivePullSDK.m +26 -28
- package/ios/pictureInpicture/PictureInPictureManager.m +84 -4
- package/lib/commonjs/index.js +23 -14
- package/lib/module/index.js +11 -3
- package/lib/typescript/index.d.ts +1 -0
- package/package.json +11 -1
- package/react-native-velive-pull.podspec +10 -3
package/android/build.gradle
CHANGED
|
@@ -13,6 +13,41 @@ def isNewArchitectureEnabled() {
|
|
|
13
13
|
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
// Version configuration through environment variables or gradle properties
|
|
17
|
+
def ttsdk_ttlivepull_rtc_version
|
|
18
|
+
def envVersion = System.getenv('TTSDK_TTLIVEPULL_RTC_VERSION_FOR_LIVE_PULL')
|
|
19
|
+
if (envVersion) {
|
|
20
|
+
ttsdk_ttlivepull_rtc_version = envVersion
|
|
21
|
+
} else if (rootProject.hasProperty('TTSDK_TTLIVEPULL_RTC_VERSION_FOR_LIVE_PULL')) {
|
|
22
|
+
ttsdk_ttlivepull_rtc_version = rootProject.property('TTSDK_TTLIVEPULL_RTC_VERSION_FOR_LIVE_PULL')
|
|
23
|
+
} else {
|
|
24
|
+
// Fallback to versions from package.json
|
|
25
|
+
def packageJson = file("../package.json")
|
|
26
|
+
def slurper = new groovy.json.JsonSlurper()
|
|
27
|
+
def parsedJson = slurper.parseText(packageJson.text)
|
|
28
|
+
def isBp = parsedJson.name.startsWith("@byteplus")
|
|
29
|
+
|
|
30
|
+
if (isBp) {
|
|
31
|
+
ttsdk_ttlivepull_rtc_version = parsedJson.nativeVersion.byteplus.android
|
|
32
|
+
} else {
|
|
33
|
+
ttsdk_ttlivepull_rtc_version = parsedJson.nativeVersion.volc.android
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// VolcApiEngine version configuration
|
|
38
|
+
def volc_api_engine_version
|
|
39
|
+
def volcApiEnvVersion = System.getenv('VOLC_API_ENGINE_VERSION_FOR_LIVE_PULL')
|
|
40
|
+
if (volcApiEnvVersion) {
|
|
41
|
+
volc_api_engine_version = volcApiEnvVersion
|
|
42
|
+
} else if (rootProject.hasProperty('VOLC_API_ENGINE_VERSION_FOR_LIVE_PULL')) {
|
|
43
|
+
volc_api_engine_version = rootProject.property('VOLC_API_ENGINE_VERSION_FOR_LIVE_PULL')
|
|
44
|
+
} else {
|
|
45
|
+
volc_api_engine_version = "1.6.4" // Default version
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
println "[LIVE PULL GRADLE INFO]: Using ttsdk_ttlivepull_rtc version: $ttsdk_ttlivepull_rtc_version"
|
|
49
|
+
println "[LIVE PULL GRADLE INFO]: Using volc_api_engine version: $volc_api_engine_version"
|
|
50
|
+
|
|
16
51
|
apply plugin: "com.android.library"
|
|
17
52
|
apply from: "https://ve-vos.volccdn.com/script/vevos-repo-base.gradle"
|
|
18
53
|
|
|
@@ -88,6 +123,6 @@ dependencies {
|
|
|
88
123
|
// noinspection GradleDynamicVersion
|
|
89
124
|
implementation "com.facebook.react:react-native:+"
|
|
90
125
|
|
|
91
|
-
implementation "com.volcengine:VolcApiEngine
|
|
92
|
-
implementation
|
|
126
|
+
implementation "com.volcengine:VolcApiEngine:$volc_api_engine_version"
|
|
127
|
+
implementation "com.bytedanceapi:ttsdk-ttlivepull_rtc:$ttsdk_ttlivepull_rtc_version"
|
|
93
128
|
}
|
|
@@ -149,7 +149,7 @@ public class FloatingWindowHelper implements IFloatingWindowHelper {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
void
|
|
152
|
+
void onClickFloatingWindowCloseBtn(Context context) {
|
|
153
153
|
if (mListener != null) {
|
|
154
154
|
mListener.onClickFloatingWindowCloseBtn(context);
|
|
155
155
|
}
|
|
@@ -172,6 +172,8 @@ public class FloatingWindowService extends Service {
|
|
|
172
172
|
mSurfaceView = mSmallWindowView.findViewById(R.id.surface_view);
|
|
173
173
|
mSmallWindowView.findViewById(R.id.surface_close_btn)
|
|
174
174
|
.setOnClickListener(v -> {
|
|
175
|
+
// 触发关闭按钮点击回调
|
|
176
|
+
FloatingWindowHelper.getInstance().onClickFloatingWindowCloseBtn(FloatingWindowService.this);
|
|
175
177
|
unregisterActivityLaunchReceiver();
|
|
176
178
|
stopSelf();
|
|
177
179
|
});
|
|
@@ -193,6 +193,9 @@ public class PictureInPictureManager {
|
|
|
193
193
|
public void onClickFloatingWindowCloseBtn(Context context) {
|
|
194
194
|
Log.d(TAG, "PIP close button clicked");
|
|
195
195
|
mFloatingWindowHelper.closeFloatingWindow(context);
|
|
196
|
+
if (mPlayer != null) {
|
|
197
|
+
mPlayer.pause();
|
|
198
|
+
}
|
|
196
199
|
}
|
|
197
200
|
|
|
198
201
|
@Override
|
package/ios/VeLivePullSDK.m
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
// Created by ByteDance on 2024/4/10.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
#import <UIKit/UIKit.h>
|
|
9
8
|
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <UIKit/UIKit.h>
|
|
10
10
|
|
|
11
11
|
#import <TTSDKFramework/TTSDKFramework.h>
|
|
12
12
|
|
|
13
|
-
#import "VolcApiEngine/VolcEventObserver.h"
|
|
14
13
|
#import "VeLivePullSDK.h"
|
|
14
|
+
#import "VolcApiEngine/VolcEventObserver.h"
|
|
15
15
|
|
|
16
16
|
#define EVENT_NAME @"VolcLive:onEvent"
|
|
17
17
|
|
|
@@ -21,51 +21,48 @@
|
|
|
21
21
|
|
|
22
22
|
static RCTVolcLiveModule *instance = nil;
|
|
23
23
|
|
|
24
|
-
@implementation RCTVolcLiveModule
|
|
25
|
-
{
|
|
24
|
+
@implementation RCTVolcLiveModule {
|
|
26
25
|
bool hasListeners;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
+ (instancetype)shareInstance {
|
|
30
|
-
|
|
29
|
+
return instance;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
+ (BOOL)requiresMainQueueSetup {
|
|
34
|
-
|
|
33
|
+
return YES;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
+ (void)_unsedForKeepOnly {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
36
|
+
// + (void)_unsedForKeepOnly {
|
|
37
|
+
// Protocol *unused = @protocol(VeLivePlayerObserver);
|
|
38
|
+
// NSLog(@"Loaded Protocol: %p", unused);
|
|
39
|
+
// }
|
|
41
40
|
|
|
42
41
|
- (dispatch_queue_t)methodQueue {
|
|
43
|
-
|
|
42
|
+
return dispatch_get_main_queue();
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
- (instancetype)init {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
self = [super init];
|
|
47
|
+
if (self != nil) {
|
|
48
|
+
self.volcApiEngine = nil;
|
|
49
|
+
instance = self;
|
|
50
|
+
}
|
|
51
|
+
return instance;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
- (NSArray<NSString *> *)supportedEvents {
|
|
56
|
-
|
|
55
|
+
return @[ EVENT_NAME ];
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
- (void)onEvent:(NSString *)eventName data:(id)eventData
|
|
60
|
-
{
|
|
61
|
-
NSDictionary * dic = @{ @"event": eventName, @"data": eventData };
|
|
58
|
+
- (void)onEvent:(NSString *)eventName data:(id)eventData {
|
|
59
|
+
NSDictionary *dic = @{@"event" : eventName, @"data" : eventData};
|
|
62
60
|
[self sendEventWithName:EVENT_NAME body:dic];
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
RCT_EXPORT_MODULE();
|
|
66
64
|
|
|
67
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(newApiEngine)
|
|
68
|
-
{
|
|
65
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(newApiEngine) {
|
|
69
66
|
if (self.volcApiEngine == nil) {
|
|
70
67
|
self.volcApiEngine = [[VolcApiEngine alloc] init];
|
|
71
68
|
[self.volcApiEngine setObserver:self];
|
|
@@ -73,18 +70,19 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(newApiEngine)
|
|
|
73
70
|
return nil;
|
|
74
71
|
}
|
|
75
72
|
|
|
76
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(callApiSync
|
|
77
|
-
{
|
|
73
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(callApiSync
|
|
74
|
+
: (nonnull NSDictionary *)args) {
|
|
78
75
|
[self newApiEngine];
|
|
79
76
|
return [instance.volcApiEngine callApi:args];
|
|
80
77
|
}
|
|
81
78
|
|
|
82
|
-
RCT_EXPORT_METHOD(callApi
|
|
83
|
-
|
|
79
|
+
RCT_EXPORT_METHOD(callApi
|
|
80
|
+
: (nonnull NSDictionary *)args callback
|
|
81
|
+
: (RCTResponseSenderBlock)callback) {
|
|
84
82
|
[self newApiEngine];
|
|
85
83
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
86
84
|
id _val = [self.volcApiEngine callApi:args];
|
|
87
|
-
callback(@[_val]);
|
|
85
|
+
callback(@[ _val ]);
|
|
88
86
|
});
|
|
89
87
|
}
|
|
90
88
|
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
@property(nonatomic, strong)
|
|
25
25
|
NSMutableDictionary<NSString *, void (^)(AVPictureInPictureController *)>
|
|
26
26
|
*pipObservers;
|
|
27
|
+
// Add timer to refresh playback state
|
|
28
|
+
@property(nonatomic, strong) NSTimer *playbackStateTimer;
|
|
27
29
|
@end
|
|
28
30
|
|
|
29
31
|
NSString *const kObserverKey = @"pip-observer";
|
|
@@ -56,6 +58,7 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
56
58
|
|
|
57
59
|
- (void)dealloc {
|
|
58
60
|
[self disableVideoFrameObserver];
|
|
61
|
+
[self stopPlaybackStateTimer];
|
|
59
62
|
|
|
60
63
|
if (self.pipController) {
|
|
61
64
|
self.pipController.delegate = nil;
|
|
@@ -65,6 +68,45 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
65
68
|
[[VeLivePlayerMultiObserver sharedInstance] removeObserver:kObserverKey];
|
|
66
69
|
}
|
|
67
70
|
|
|
71
|
+
// Start playback state refresh timer
|
|
72
|
+
- (void)startPlaybackStateTimer {
|
|
73
|
+
[self stopPlaybackStateTimer];
|
|
74
|
+
|
|
75
|
+
if (self.pipController && [self.pipController pictureInPictureController]) {
|
|
76
|
+
// Use main thread timer to ensure UI updates on main thread
|
|
77
|
+
self.playbackStateTimer = [NSTimer
|
|
78
|
+
scheduledTimerWithTimeInterval:1.0
|
|
79
|
+
target:self
|
|
80
|
+
selector:@selector(invalidatePlaybackState)
|
|
81
|
+
userInfo:nil
|
|
82
|
+
repeats:YES];
|
|
83
|
+
// Add timer to main run loop
|
|
84
|
+
[[NSRunLoop mainRunLoop] addTimer:self.playbackStateTimer
|
|
85
|
+
forMode:NSRunLoopCommonModes];
|
|
86
|
+
NSLog(@"PIP: Started playback state timer");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Stop playback state refresh timer
|
|
91
|
+
- (void)stopPlaybackStateTimer {
|
|
92
|
+
if (self.playbackStateTimer) {
|
|
93
|
+
[self.playbackStateTimer invalidate];
|
|
94
|
+
self.playbackStateTimer = nil;
|
|
95
|
+
NSLog(@"PIP: Stopped playback state timer");
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Timer callback: refresh playback state
|
|
100
|
+
- (void)invalidatePlaybackState {
|
|
101
|
+
if (self.pipController && [self.pipController pictureInPictureController]) {
|
|
102
|
+
AVPictureInPictureController *controller =
|
|
103
|
+
[self.pipController pictureInPictureController];
|
|
104
|
+
if (controller.isPictureInPictureActive) {
|
|
105
|
+
[controller invalidatePlaybackState];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
68
110
|
- (void)setupPlayer:(TVLManager *)player {
|
|
69
111
|
[self ensurePipControllerReady:player completion:nil];
|
|
70
112
|
}
|
|
@@ -159,9 +201,10 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
159
201
|
|
|
160
202
|
- (void)updatePipController:(nullable void (^)(void))completion {
|
|
161
203
|
VeLivePlayerVideoStreamInfo *info = [self.player getVideoStreamInfo];
|
|
162
|
-
|
|
204
|
+
|
|
163
205
|
if (!CGSizeEqualToSize(CGSizeZero, CGSizeMake(info.width, info.height))) {
|
|
164
|
-
[self.pipController setVideoSize:CGSizeMake(info.width, info.height)
|
|
206
|
+
[self.pipController setVideoSize:CGSizeMake(info.width, info.height)
|
|
207
|
+
completion:nil];
|
|
165
208
|
}
|
|
166
209
|
|
|
167
210
|
[self.pipController setContentView:self.contentView
|
|
@@ -169,7 +212,7 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
169
212
|
if (completion) {
|
|
170
213
|
completion();
|
|
171
214
|
}
|
|
172
|
-
}];
|
|
215
|
+
}];
|
|
173
216
|
}
|
|
174
217
|
|
|
175
218
|
// Notify all observers
|
|
@@ -305,11 +348,32 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
305
348
|
_listener = listener;
|
|
306
349
|
}
|
|
307
350
|
|
|
351
|
+
#pragma mark - AVPictureInPictureSampleBufferPlaybackDelegate
|
|
352
|
+
- (BOOL)pictureInPictureControllerIsPlaybackPaused:
|
|
353
|
+
(nonnull AVPictureInPictureController *)pictureInPictureController {
|
|
354
|
+
if (self.player) {
|
|
355
|
+
return ![[self.player valueForKey:@"isPlaying"] boolValue];
|
|
356
|
+
}
|
|
357
|
+
NSLog(@"PIP: No player, returning YES (paused)");
|
|
358
|
+
return YES;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
- (void)pictureInPictureController:
|
|
362
|
+
(AVPictureInPictureController *)pictureInPictureController
|
|
363
|
+
setPlaying:(BOOL)playing {
|
|
364
|
+
if (playing) {
|
|
365
|
+
[self.player play];
|
|
366
|
+
} else {
|
|
367
|
+
[self.player pause];
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
308
371
|
// MARK: - VeLiveVideoFrameListener
|
|
309
372
|
- (void)onRenderVideoFrame:(TVLManager *_Nonnull)player
|
|
310
373
|
videoFrame:(VeLivePlayerVideoFrame *_Nonnull)videoFrame {
|
|
311
374
|
@autoreleasepool {
|
|
312
|
-
//
|
|
375
|
+
// Ensure pipController exists and is valid, avoid processing buffer during
|
|
376
|
+
// destruction
|
|
313
377
|
if (!self.pipController || !self.enableVideoObserver) {
|
|
314
378
|
return;
|
|
315
379
|
}
|
|
@@ -335,6 +399,16 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
335
399
|
NSLog(@"VeLiveQuickStartDemo: Error %ld, %@", error.code, error.errorMsg);
|
|
336
400
|
}
|
|
337
401
|
|
|
402
|
+
// MARK: - VeLivePlayerObserver
|
|
403
|
+
- (void)onPlayerStatusUpdate:(TVLManager *)player status:(NSInteger)status {
|
|
404
|
+
// Refresh picture-in-picture playback state when player status changes
|
|
405
|
+
if (self.pipController && [self.pipController pictureInPictureController]) {
|
|
406
|
+
[[self.pipController pictureInPictureController] invalidatePlaybackState];
|
|
407
|
+
}
|
|
408
|
+
NSLog(@"PIP: Player status updated to %ld, invalidated playback state",
|
|
409
|
+
(long)status);
|
|
410
|
+
}
|
|
411
|
+
|
|
338
412
|
/// MARK: - VePictureInPictureDelegate
|
|
339
413
|
- (void)pictureInPictureController:
|
|
340
414
|
(VePictureInPictureController *)pictureInPictureController
|
|
@@ -357,6 +431,8 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
357
431
|
if (self.listener) {
|
|
358
432
|
[self.listener onStartPictureInPicture];
|
|
359
433
|
}
|
|
434
|
+
// Start timer to refresh playback state
|
|
435
|
+
[self startPlaybackStateTimer];
|
|
360
436
|
break;
|
|
361
437
|
case VePictureInPictureStatusWillChange: {
|
|
362
438
|
|
|
@@ -374,6 +450,8 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
374
450
|
if (self.listener) {
|
|
375
451
|
[self.listener onStopPictureInPicture];
|
|
376
452
|
}
|
|
453
|
+
// Stop timer
|
|
454
|
+
[self stopPlaybackStateTimer];
|
|
377
455
|
if (@available(iOS 14.2, *)) {
|
|
378
456
|
if (!self.canStartPictureInPictureAutomaticallyFromInline) {
|
|
379
457
|
[self destroyPictureInPicture];
|
|
@@ -385,6 +463,8 @@ NSString *const kObserverKey = @"pip-observer";
|
|
|
385
463
|
[self.listener onError:pictureInPictureController.error.code
|
|
386
464
|
extraData:pictureInPictureController.error.userInfo];
|
|
387
465
|
}
|
|
466
|
+
// Stop timer
|
|
467
|
+
[self stopPlaybackStateTimer];
|
|
388
468
|
} break;
|
|
389
469
|
}
|
|
390
470
|
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -714,18 +714,18 @@ var Bind = function (target, context) {
|
|
|
714
714
|
return target;
|
|
715
715
|
};
|
|
716
716
|
|
|
717
|
-
|
|
717
|
+
exports.LogLevel = void 0;
|
|
718
718
|
(function (LogLevel) {
|
|
719
719
|
LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
|
|
720
720
|
LogLevel[LogLevel["INFO"] = 1] = "INFO";
|
|
721
721
|
LogLevel[LogLevel["WARN"] = 2] = "WARN";
|
|
722
722
|
LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
|
|
723
723
|
LogLevel[LogLevel["NONE"] = 999] = "NONE";
|
|
724
|
-
})(LogLevel || (LogLevel = {}));
|
|
724
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
725
725
|
|
|
726
726
|
var LoggerImpl = /** @class */ (function () {
|
|
727
727
|
function LoggerImpl() {
|
|
728
|
-
this._logLevel = LogLevel.WARN;
|
|
728
|
+
this._logLevel = exports.LogLevel.WARN;
|
|
729
729
|
this._consumers = [];
|
|
730
730
|
}
|
|
731
731
|
LoggerImpl.getInstance = function () {
|
|
@@ -808,16 +808,16 @@ var LoggerImpl = /** @class */ (function () {
|
|
|
808
808
|
}); });
|
|
809
809
|
// 控制台输出
|
|
810
810
|
switch (level) {
|
|
811
|
-
case LogLevel.ERROR:
|
|
811
|
+
case exports.LogLevel.ERROR:
|
|
812
812
|
console.error("".concat(timestamp, " ").concat(message));
|
|
813
813
|
break;
|
|
814
|
-
case LogLevel.WARN:
|
|
814
|
+
case exports.LogLevel.WARN:
|
|
815
815
|
console.warn("".concat(timestamp, " ").concat(message));
|
|
816
816
|
break;
|
|
817
|
-
case LogLevel.INFO:
|
|
817
|
+
case exports.LogLevel.INFO:
|
|
818
818
|
console.log("".concat(timestamp, " ").concat(message));
|
|
819
819
|
break;
|
|
820
|
-
case LogLevel.DEBUG:
|
|
820
|
+
case exports.LogLevel.DEBUG:
|
|
821
821
|
console.debug("".concat(timestamp, " ").concat(message));
|
|
822
822
|
break;
|
|
823
823
|
}
|
|
@@ -827,28 +827,28 @@ var LoggerImpl = /** @class */ (function () {
|
|
|
827
827
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
828
828
|
args[_i] = arguments[_i];
|
|
829
829
|
}
|
|
830
|
-
this._log(LogLevel.DEBUG, args);
|
|
830
|
+
this._log(exports.LogLevel.DEBUG, args);
|
|
831
831
|
};
|
|
832
832
|
LoggerImpl.prototype.info = function () {
|
|
833
833
|
var args = [];
|
|
834
834
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
835
835
|
args[_i] = arguments[_i];
|
|
836
836
|
}
|
|
837
|
-
this._log(LogLevel.INFO, args);
|
|
837
|
+
this._log(exports.LogLevel.INFO, args);
|
|
838
838
|
};
|
|
839
839
|
LoggerImpl.prototype.warn = function () {
|
|
840
840
|
var args = [];
|
|
841
841
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
842
842
|
args[_i] = arguments[_i];
|
|
843
843
|
}
|
|
844
|
-
this._log(LogLevel.WARN, args);
|
|
844
|
+
this._log(exports.LogLevel.WARN, args);
|
|
845
845
|
};
|
|
846
846
|
LoggerImpl.prototype.error = function () {
|
|
847
847
|
var args = [];
|
|
848
848
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
849
849
|
args[_i] = arguments[_i];
|
|
850
850
|
}
|
|
851
|
-
this._log(LogLevel.ERROR, args);
|
|
851
|
+
this._log(exports.LogLevel.ERROR, args);
|
|
852
852
|
};
|
|
853
853
|
LoggerImpl.MAX_LOG_LENGTH = 4096;
|
|
854
854
|
return LoggerImpl;
|
|
@@ -1444,12 +1444,12 @@ var NativeLoggerManager = function () {
|
|
|
1444
1444
|
return InstanceManager;
|
|
1445
1445
|
})());
|
|
1446
1446
|
|
|
1447
|
-
/** @class */ (
|
|
1447
|
+
var LoggerManager = /** @class */ (function () {
|
|
1448
1448
|
function LoggerManager() {
|
|
1449
1449
|
}
|
|
1450
1450
|
LoggerManager.setLogLevel = function (level) {
|
|
1451
1451
|
this.logger.setLogLevel(level);
|
|
1452
|
-
this.logger.debug('[logger-manager] setLogLevel', LogLevel[level]);
|
|
1452
|
+
this.logger.debug('[logger-manager] setLogLevel', exports.LogLevel[level]);
|
|
1453
1453
|
if (getOS() === 'android') {
|
|
1454
1454
|
NativeLoggerManager$1.setLogLevel(level);
|
|
1455
1455
|
}
|
|
@@ -1462,9 +1462,17 @@ var NativeLoggerManager = function () {
|
|
|
1462
1462
|
};
|
|
1463
1463
|
LoggerManager.logger = LoggerImpl.getInstance();
|
|
1464
1464
|
return LoggerManager;
|
|
1465
|
-
}
|
|
1465
|
+
}());
|
|
1466
1466
|
|
|
1467
1467
|
var logger = LoggerImpl.getInstance();
|
|
1468
|
+
function setupLogger(opt) {
|
|
1469
|
+
if (opt.level !== undefined) {
|
|
1470
|
+
LoggerManager.setLogLevel(opt.level);
|
|
1471
|
+
}
|
|
1472
|
+
if (opt.customer !== undefined) {
|
|
1473
|
+
logger.registerConsumer(opt.customer);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1468
1476
|
|
|
1469
1477
|
var ApiCallSpan = /** @class */ (function () {
|
|
1470
1478
|
function ApiCallSpan(tracer, action) {
|
|
@@ -14544,3 +14552,4 @@ exports.VeLivePlayerStreamData = VeLivePlayerStreamData;
|
|
|
14544
14552
|
exports.VeLivePlayerVideoFrame = VeLivePlayerVideoFrame;
|
|
14545
14553
|
exports.initEnv = initEnv;
|
|
14546
14554
|
exports.initPlayer = initPlayer;
|
|
14555
|
+
exports.setupLogger = setupLogger;
|
package/lib/module/index.js
CHANGED
|
@@ -1442,7 +1442,7 @@ var NativeLoggerManager = function () {
|
|
|
1442
1442
|
return InstanceManager;
|
|
1443
1443
|
})());
|
|
1444
1444
|
|
|
1445
|
-
/** @class */ (
|
|
1445
|
+
var LoggerManager = /** @class */ (function () {
|
|
1446
1446
|
function LoggerManager() {
|
|
1447
1447
|
}
|
|
1448
1448
|
LoggerManager.setLogLevel = function (level) {
|
|
@@ -1460,9 +1460,17 @@ var NativeLoggerManager = function () {
|
|
|
1460
1460
|
};
|
|
1461
1461
|
LoggerManager.logger = LoggerImpl.getInstance();
|
|
1462
1462
|
return LoggerManager;
|
|
1463
|
-
}
|
|
1463
|
+
}());
|
|
1464
1464
|
|
|
1465
1465
|
var logger = LoggerImpl.getInstance();
|
|
1466
|
+
function setupLogger(opt) {
|
|
1467
|
+
if (opt.level !== undefined) {
|
|
1468
|
+
LoggerManager.setLogLevel(opt.level);
|
|
1469
|
+
}
|
|
1470
|
+
if (opt.customer !== undefined) {
|
|
1471
|
+
logger.registerConsumer(opt.customer);
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1466
1474
|
|
|
1467
1475
|
var ApiCallSpan = /** @class */ (function () {
|
|
1468
1476
|
function ApiCallSpan(tracer, action) {
|
|
@@ -14532,4 +14540,4 @@ function initPlayer(options) {
|
|
|
14532
14540
|
setupJSBridge(new ReactNativeBridge(NativeModules.VolcLiveModule, 'VolcLive:onEvent'));
|
|
14533
14541
|
setupEnv(new ReactNativeEnv());
|
|
14534
14542
|
|
|
14535
|
-
export { NativeViewComponent, VeLivePlayer, VeLivePlayerAudioBufferType, VeLivePlayerAudioFrame, VeLivePlayerConfiguration, VeLivePlayerFillMode, VeLivePlayerFormat, VeLivePlayerLogLevel, VeLivePlayerMirror, VeLivePlayerPixelFormat, VeLivePlayerProtocol, VeLivePlayerResolution, VeLivePlayerResolutionSwitchReason, VeLivePlayerRotation, VeLivePlayerStatistics, VeLivePlayerStatus, VeLivePlayerStream, VeLivePlayerStreamData, VeLivePlayerStreamType, VeLivePlayerVideoBufferType, VeLivePlayerVideoFrame, initEnv, initPlayer };
|
|
14543
|
+
export { LogLevel, NativeViewComponent, VeLivePlayer, VeLivePlayerAudioBufferType, VeLivePlayerAudioFrame, VeLivePlayerConfiguration, VeLivePlayerFillMode, VeLivePlayerFormat, VeLivePlayerLogLevel, VeLivePlayerMirror, VeLivePlayerPixelFormat, VeLivePlayerProtocol, VeLivePlayerResolution, VeLivePlayerResolutionSwitchReason, VeLivePlayerRotation, VeLivePlayerStatistics, VeLivePlayerStatus, VeLivePlayerStream, VeLivePlayerStreamData, VeLivePlayerStreamType, VeLivePlayerVideoBufferType, VeLivePlayerVideoFrame, initEnv, initPlayer, setupLogger };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteplus/react-native-live-pull",
|
|
3
|
-
"version": "1.3.0-rc.
|
|
3
|
+
"version": "1.3.0-rc.10",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "*",
|
|
6
6
|
"react-native": "*"
|
|
@@ -30,5 +30,15 @@
|
|
|
30
30
|
"homepage": "https://www.byteplus.com/en",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"zx": "^8.1.1"
|
|
33
|
+
},
|
|
34
|
+
"nativeVersion": {
|
|
35
|
+
"volc": {
|
|
36
|
+
"android": "1.46.3.6",
|
|
37
|
+
"ios": "1.46.3.10-premium"
|
|
38
|
+
},
|
|
39
|
+
"byteplus": {
|
|
40
|
+
"android": "1.46.300.2",
|
|
41
|
+
"ios": "1.46.300.7-premium"
|
|
42
|
+
}
|
|
33
43
|
}
|
|
34
44
|
}
|
|
@@ -2,6 +2,7 @@ require "json"
|
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
4
|
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
+
is_bp = package['name'].start_with?('@byteplus')
|
|
5
6
|
|
|
6
7
|
Pod::Spec.new do |s|
|
|
7
8
|
s.name = "react-native-velive-pull"
|
|
@@ -48,7 +49,13 @@ Pod::Spec.new do |s|
|
|
|
48
49
|
end
|
|
49
50
|
end
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
# Version configuration through environment variables
|
|
53
|
+
volc_api_engine_version = ENV['VOLC_API_ENGINE_VERSION_FOR_LIVE_PULL'] || '1.6.5'
|
|
54
|
+
ttsdk_framework_version = ENV['TTSDK_FRAMEWORK_VERSION_FOR_LIVE_PULL'] || (is_bp ? package['nativeVersion']['byteplus']['ios'] : package['nativeVersion']['volc']['ios'])
|
|
55
|
+
|
|
56
|
+
s.dependency 'VolcApiEngine', volc_api_engine_version
|
|
57
|
+
s.dependency 'TTSDKFramework/Core', ttsdk_framework_version
|
|
58
|
+
s.dependency 'TTSDKFramework/LivePull-RTS', ttsdk_framework_version
|
|
59
|
+
|
|
60
|
+
puts("[LIVE PULL POD INSTALL INFO]: volc_api_engine_version: #{volc_api_engine_version} / ttsdk_framework_version: #{ttsdk_framework_version}")
|
|
54
61
|
end
|