@volcengine/react-native-live-pull 1.3.0-rc.5 → 1.3.2-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/build.gradle +1 -1
- 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/pictureInpicture/PictureInPictureManager.m +84 -4
- package/package.json +11 -1
- package/react-native-velive-pull.podspec +11 -4
- package/lib/commonjs/index.js +0 -14546
- package/lib/module/index.js +0 -14535
- package/lib/typescript/codegen/android/api.d.ts +0 -319
- package/lib/typescript/codegen/android/callback.d.ts +0 -206
- package/lib/typescript/codegen/android/errorcode.d.ts +0 -177
- package/lib/typescript/codegen/android/external.d.ts +0 -1
- package/lib/typescript/codegen/android/index.d.ts +0 -6
- package/lib/typescript/codegen/android/keytype.d.ts +0 -753
- package/lib/typescript/codegen/android/types.d.ts +0 -31
- package/lib/typescript/codegen/ios/api.d.ts +0 -293
- package/lib/typescript/codegen/ios/callback.d.ts +0 -176
- package/lib/typescript/codegen/ios/errorcode.d.ts +0 -160
- package/lib/typescript/codegen/ios/external.d.ts +0 -1
- package/lib/typescript/codegen/ios/index.d.ts +0 -6
- package/lib/typescript/codegen/ios/keytype.d.ts +0 -697
- package/lib/typescript/codegen/ios/types.d.ts +0 -46
- package/lib/typescript/codegen/pack/api.d.ts +0 -371
- package/lib/typescript/codegen/pack/callback.d.ts +0 -258
- package/lib/typescript/codegen/pack/errorcode.d.ts +0 -195
- package/lib/typescript/codegen/pack/external.d.ts +0 -1
- package/lib/typescript/codegen/pack/index.d.ts +0 -6
- package/lib/typescript/codegen/pack/keytype.d.ts +0 -980
- package/lib/typescript/codegen/pack/types.d.ts +0 -68
- package/lib/typescript/component.d.ts +0 -15
- package/lib/typescript/core/api.d.ts +0 -114
- package/lib/typescript/core/appState.d.ts +0 -3
- package/lib/typescript/core/callback.d.ts +0 -53
- package/lib/typescript/core/env.d.ts +0 -36
- package/lib/typescript/core/errorcode.d.ts +0 -1
- package/lib/typescript/core/index.d.ts +0 -6
- package/lib/typescript/core/keytype.d.ts +0 -33
- package/lib/typescript/core/player.d.ts +0 -14
- package/lib/typescript/index.d.ts +0 -2
- package/lib/typescript/platforms/android/extends.d.ts +0 -39
- package/lib/typescript/platforms/android/pictureInpicture.d.ts +0 -26
- package/lib/typescript/platforms/ios/extends.d.ts +0 -43
- package/lib/typescript/platforms/ios/pictureInpicture.d.ts +0 -32
- package/lib/typescript/runtime/index.d.ts +0 -1
package/android/build.gradle
CHANGED
|
@@ -42,7 +42,7 @@ if (volcApiEnvVersion) {
|
|
|
42
42
|
} else if (rootProject.hasProperty('VOLC_API_ENGINE_VERSION_FOR_LIVE_PULL')) {
|
|
43
43
|
volc_api_engine_version = rootProject.property('VOLC_API_ENGINE_VERSION_FOR_LIVE_PULL')
|
|
44
44
|
} else {
|
|
45
|
-
volc_api_engine_version = "1.6.
|
|
45
|
+
volc_api_engine_version = "1.6.6" // Default version
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
println "[LIVE PULL GRADLE INFO]: Using ttsdk_ttlivepull_rtc version: $ttsdk_ttlivepull_rtc_version"
|
|
@@ -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
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volcengine/react-native-live-pull",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2-rc.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "*",
|
|
6
6
|
"react-native": "*"
|
|
@@ -30,5 +30,15 @@
|
|
|
30
30
|
"homepage": "https://www.volcengine.com",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"zx": "^8.1.1"
|
|
33
|
+
},
|
|
34
|
+
"nativeVersion": {
|
|
35
|
+
"volc": {
|
|
36
|
+
"android": "1.47.3.6",
|
|
37
|
+
"ios": "1.46.3.10-premium"
|
|
38
|
+
},
|
|
39
|
+
"byteplus": {
|
|
40
|
+
"android": "1.47.300.2",
|
|
41
|
+
"ios": "1.46.300.7-premium"
|
|
42
|
+
}
|
|
33
43
|
}
|
|
34
44
|
}
|
|
@@ -50,12 +50,19 @@ Pod::Spec.new do |s|
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
# Version configuration through environment variables
|
|
53
|
-
volc_api_engine_version = ENV['VOLC_API_ENGINE_VERSION_FOR_LIVE_PULL'] || '1.6.
|
|
53
|
+
volc_api_engine_version = ENV['VOLC_API_ENGINE_VERSION_FOR_LIVE_PULL'] || '1.6.5'
|
|
54
54
|
ttsdk_framework_version = ENV['TTSDK_FRAMEWORK_VERSION_FOR_LIVE_PULL'] || (is_bp ? package['nativeVersion']['byteplus']['ios'] : package['nativeVersion']['volc']['ios'])
|
|
55
|
+
|
|
56
|
+
use_rtc = ENV['USE_RTC_FOR_LIVE_PULL'] || 'true'
|
|
55
57
|
|
|
56
58
|
s.dependency 'VolcApiEngine', volc_api_engine_version
|
|
57
59
|
s.dependency 'TTSDKFramework/Core', ttsdk_framework_version
|
|
58
|
-
|
|
60
|
+
|
|
61
|
+
if use_rtc == 'true'
|
|
62
|
+
s.dependency 'TTSDKFramework/LivePull-RTS', ttsdk_framework_version
|
|
63
|
+
else
|
|
64
|
+
s.dependency 'TTSDKFramework/LivePull', ttsdk_framework_version
|
|
65
|
+
end
|
|
59
66
|
|
|
60
|
-
puts("[LIVE PULL POD INSTALL INFO]: volc_api_engine_version: #{volc_api_engine_version} / ttsdk_framework_version: #{ttsdk_framework_version}")
|
|
61
|
-
end
|
|
67
|
+
puts("[LIVE PULL POD INSTALL INFO]: volc_api_engine_version: #{volc_api_engine_version} / ttsdk_framework_version: #{ttsdk_framework_version} / use_rtc: #{use_rtc}")
|
|
68
|
+
end
|