@byteplus/react-native-live-pull 1.5.2-rc.3 → 1.5.2-rc.4
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/ios/VeLivePullImpl.m
CHANGED
|
@@ -32,17 +32,8 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
- (NSDictionary *)callApiSync:(NSDictionary *)args {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
[self newApiEngine];
|
|
38
|
-
result = [self.volcApiEngine callApi:args];
|
|
39
|
-
};
|
|
40
|
-
if ([NSThread isMainThread]) {
|
|
41
|
-
work();
|
|
42
|
-
} else {
|
|
43
|
-
dispatch_sync(dispatch_get_main_queue(), work);
|
|
44
|
-
}
|
|
45
|
-
return result;
|
|
35
|
+
[self newApiEngine];
|
|
36
|
+
return [self.volcApiEngine callApi:args];
|
|
46
37
|
}
|
|
47
38
|
|
|
48
39
|
//callback 是OC的回调函数,外层需要进一步封装,接收一个NSDictionary类型的参数
|
package/ios/VeLivePullView.m
CHANGED
|
@@ -46,13 +46,18 @@
|
|
|
46
46
|
- (void) insertSubview:(UIView *)view atIndex:(NSInteger)index {
|
|
47
47
|
// NSLog(@"insert playview, self bounds=%f x %f", self.bounds.size.width, self.bounds.size.height);
|
|
48
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(), ^{
|
|
49
51
|
[super insertSubview:view atIndex:index];
|
|
50
52
|
[self setSubViewLayout:view];
|
|
53
|
+
});
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
- (void) addSubview:(UIView *)view {
|
|
57
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
54
58
|
[super addSubview:view];
|
|
55
59
|
[self setSubViewLayout:view];
|
|
60
|
+
});
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
// 设置 Auto Layout,确保 subView 始终匹配 view 尺寸
|
|
@@ -26,23 +26,9 @@
|
|
|
26
26
|
*pipObservers;
|
|
27
27
|
// Add timer to refresh playback state
|
|
28
28
|
@property(nonatomic, strong) NSTimer *playbackStateTimer;
|
|
29
|
-
@property(nonatomic, assign) NSTimeInterval lastStateSwitchTime;
|
|
30
|
-
@property(nonatomic, assign) UIApplicationState lastAppState;
|
|
31
|
-
@property(nonatomic, assign) NSTimeInterval lastRebindTime;
|
|
32
|
-
@property(nonatomic, copy) NSString *pipTraceId;
|
|
33
|
-
@property(nonatomic, assign) NSTimeInterval lastDropLogTime;
|
|
34
|
-
@property(nonatomic, assign) NSUInteger enqueueCount;
|
|
35
|
-
@property(nonatomic, assign) NSUInteger dropInactiveCount;
|
|
36
|
-
@property(nonatomic, assign) NSUInteger dropCooldownCount;
|
|
37
|
-
@property(nonatomic, assign) NSUInteger dropNotReadyCount;
|
|
38
|
-
@property(nonatomic, assign) NSUInteger dropNoControllerCount;
|
|
39
29
|
@end
|
|
40
30
|
|
|
41
31
|
NSString *const kObserverKey = @"pip-observer";
|
|
42
|
-
static const NSTimeInterval kStateSwitchCooldownSeconds = 0.3;
|
|
43
|
-
static const NSTimeInterval kRebindCooldownSeconds = 1.0;
|
|
44
|
-
static const NSTimeInterval kDropLogIntervalSeconds = 1.0;
|
|
45
|
-
static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
46
32
|
|
|
47
33
|
@implementation VeLivePictureInPictureManager
|
|
48
34
|
|
|
@@ -66,40 +52,11 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
66
52
|
if (@available(iOS 14.2, *)) {
|
|
67
53
|
_canStartPictureInPictureAutomaticallyFromInline = NO;
|
|
68
54
|
}
|
|
69
|
-
_lastStateSwitchTime = 0;
|
|
70
|
-
_lastAppState = UIApplicationStateActive;
|
|
71
|
-
_lastRebindTime = 0;
|
|
72
|
-
_lastDropLogTime = 0;
|
|
73
|
-
_enqueueCount = 0;
|
|
74
|
-
_dropInactiveCount = 0;
|
|
75
|
-
_dropCooldownCount = 0;
|
|
76
|
-
_dropNotReadyCount = 0;
|
|
77
|
-
_dropNoControllerCount = 0;
|
|
78
|
-
_pipTraceId = [[NSUUID UUID] UUIDString];
|
|
79
|
-
// 监听从通知中心/后台返回活跃状态
|
|
80
|
-
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
81
|
-
selector:@selector(handleAppDidBecomeActive)
|
|
82
|
-
name:UIApplicationDidBecomeActiveNotification
|
|
83
|
-
object:nil];
|
|
84
55
|
}
|
|
85
56
|
return self;
|
|
86
57
|
}
|
|
87
58
|
|
|
88
|
-
- (UIApplicationState)currentApplicationStateSafe {
|
|
89
|
-
__block UIApplicationState state = UIApplicationStateInactive;
|
|
90
|
-
void (^readState)(void) = ^{
|
|
91
|
-
state = [UIApplication sharedApplication].applicationState;
|
|
92
|
-
};
|
|
93
|
-
if ([NSThread isMainThread]) {
|
|
94
|
-
readState();
|
|
95
|
-
} else {
|
|
96
|
-
dispatch_sync(dispatch_get_main_queue(), readState);
|
|
97
|
-
}
|
|
98
|
-
return state;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
59
|
- (void)dealloc {
|
|
102
|
-
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
103
60
|
[self disableVideoFrameObserver];
|
|
104
61
|
[self stopPlaybackStateTimer];
|
|
105
62
|
|
|
@@ -111,56 +68,6 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
111
68
|
[[VeLivePlayerMultiObserver sharedInstance] removeObserver:kObserverKey];
|
|
112
69
|
}
|
|
113
70
|
|
|
114
|
-
- (void)logDropIfNeeded:(NSString *)reason state:(UIApplicationState)state {
|
|
115
|
-
NSTimeInterval now = CFAbsoluteTimeGetCurrent();
|
|
116
|
-
if (self.lastDropLogTime > 0 &&
|
|
117
|
-
now - self.lastDropLogTime < kDropLogIntervalSeconds) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
self.lastDropLogTime = now;
|
|
121
|
-
NSLog(@"PIP[%@] drop frame reason=%@ state=%ld elapsedSinceSwitch=%.3f",
|
|
122
|
-
self.pipTraceId, reason, (long)state,
|
|
123
|
-
(self.lastStateSwitchTime > 0 ? now - self.lastStateSwitchTime : -1.0));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
- (void)handleAppDidBecomeActive {
|
|
127
|
-
if (!self.pipController || !self.contentView) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
AVPictureInPictureController *controller =
|
|
131
|
-
[self.pipController pictureInPictureController];
|
|
132
|
-
if (!controller || !controller.isPictureInPictureActive) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Keep a short guard window after state switch.
|
|
137
|
-
NSTimeInterval now = CFAbsoluteTimeGetCurrent();
|
|
138
|
-
if (self.lastStateSwitchTime > 0 &&
|
|
139
|
-
now - self.lastStateSwitchTime < kStateSwitchCooldownSeconds) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
// Avoid repeated rebind storms when app repeatedly toggles active/inactive.
|
|
143
|
-
if (self.lastRebindTime > 0 &&
|
|
144
|
-
now - self.lastRebindTime < kRebindCooldownSeconds) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
self.lastRebindTime = now;
|
|
148
|
-
|
|
149
|
-
__weak typeof(self) weakSelf = self;
|
|
150
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
151
|
-
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
152
|
-
if (!strongSelf) return;
|
|
153
|
-
[strongSelf.pipController setContentView:strongSelf.contentView
|
|
154
|
-
completion:^{
|
|
155
|
-
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
156
|
-
if (!strongSelf) return;
|
|
157
|
-
[[strongSelf.pipController pictureInPictureController]
|
|
158
|
-
invalidatePlaybackState];
|
|
159
|
-
NSLog(@"PIP: App active, re-bound content view.");
|
|
160
|
-
}];
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
71
|
// Start playback state refresh timer
|
|
165
72
|
- (void)startPlaybackStateTimer {
|
|
166
73
|
[self stopPlaybackStateTimer];
|
|
@@ -168,15 +75,15 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
168
75
|
if (self.pipController && [self.pipController pictureInPictureController]) {
|
|
169
76
|
// Use main thread timer to ensure UI updates on main thread
|
|
170
77
|
self.playbackStateTimer = [NSTimer
|
|
171
|
-
scheduledTimerWithTimeInterval:
|
|
78
|
+
scheduledTimerWithTimeInterval:1.0
|
|
172
79
|
target:self
|
|
173
|
-
selector:@selector(
|
|
80
|
+
selector:@selector(invalidatePlaybackState)
|
|
174
81
|
userInfo:nil
|
|
175
82
|
repeats:YES];
|
|
176
83
|
// Add timer to main run loop
|
|
177
84
|
[[NSRunLoop mainRunLoop] addTimer:self.playbackStateTimer
|
|
178
85
|
forMode:NSRunLoopCommonModes];
|
|
179
|
-
NSLog(@"PIP
|
|
86
|
+
NSLog(@"PIP: Started playback state timer");
|
|
180
87
|
}
|
|
181
88
|
}
|
|
182
89
|
|
|
@@ -185,7 +92,7 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
185
92
|
if (self.playbackStateTimer) {
|
|
186
93
|
[self.playbackStateTimer invalidate];
|
|
187
94
|
self.playbackStateTimer = nil;
|
|
188
|
-
NSLog(@"PIP
|
|
95
|
+
NSLog(@"PIP: Stopped playback state timer");
|
|
189
96
|
}
|
|
190
97
|
}
|
|
191
98
|
|
|
@@ -200,15 +107,6 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
200
107
|
}
|
|
201
108
|
}
|
|
202
109
|
|
|
203
|
-
- (void)logFrameStats {
|
|
204
|
-
NSLog(@"PIP[%@] frame stats enqueue=%lu dropInactive=%lu dropCooldown=%lu dropNotReady=%lu dropNoController=%lu",
|
|
205
|
-
self.pipTraceId, (unsigned long)self.enqueueCount,
|
|
206
|
-
(unsigned long)self.dropInactiveCount,
|
|
207
|
-
(unsigned long)self.dropCooldownCount,
|
|
208
|
-
(unsigned long)self.dropNotReadyCount,
|
|
209
|
-
(unsigned long)self.dropNoControllerCount);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
110
|
- (void)setupPlayer:(TVLManager *)player {
|
|
213
111
|
[self ensurePipControllerReady:player completion:nil];
|
|
214
112
|
}
|
|
@@ -283,14 +181,6 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
283
181
|
self.pipController = [[VePictureInPictureController alloc]
|
|
284
182
|
initWithType:VePictureInPictureTypeContentSource
|
|
285
183
|
contentView:self.player.playerView];
|
|
286
|
-
self.pipTraceId = [[NSUUID UUID] UUIDString];
|
|
287
|
-
self.enqueueCount = 0;
|
|
288
|
-
self.dropInactiveCount = 0;
|
|
289
|
-
self.dropCooldownCount = 0;
|
|
290
|
-
self.dropNotReadyCount = 0;
|
|
291
|
-
self.dropNoControllerCount = 0;
|
|
292
|
-
NSLog(@"PIP[%@] init controller contentView=%p playerView=%p", self.pipTraceId,
|
|
293
|
-
self.contentView, self.player.playerView);
|
|
294
184
|
[self.pipController setRenderMode:1];
|
|
295
185
|
self.pipController.delegate = self;
|
|
296
186
|
self.pipController.autoConfigAudioSession = YES;
|
|
@@ -355,7 +245,7 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
355
245
|
self.enableVideoObserver = YES;
|
|
356
246
|
[self.player
|
|
357
247
|
enableVideoFrameObserver:YES
|
|
358
|
-
pixelFormat:
|
|
248
|
+
pixelFormat:VeLivePlayerPixelFormatBGRA32
|
|
359
249
|
bufferType:VeLivePlayerVideoBufferTypeSampleBuffer];
|
|
360
250
|
[[VeLivePlayerMultiObserver sharedInstance] removeObserver:kObserverKey];
|
|
361
251
|
[[VeLivePlayerMultiObserver sharedInstance] addObserver:kObserverKey
|
|
@@ -482,105 +372,24 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
482
372
|
- (void)onRenderVideoFrame:(TVLManager *_Nonnull)player
|
|
483
373
|
videoFrame:(VeLivePlayerVideoFrame *_Nonnull)videoFrame {
|
|
484
374
|
@autoreleasepool {
|
|
485
|
-
UIApplicationState currentState = [self currentApplicationStateSafe];
|
|
486
|
-
|
|
487
|
-
// 1) Detect foreground/background switches and start cooldown.
|
|
488
|
-
if (currentState != self.lastAppState) {
|
|
489
|
-
self.lastAppState = currentState;
|
|
490
|
-
self.lastStateSwitchTime = CFAbsoluteTimeGetCurrent();
|
|
491
|
-
NSLog(@"PIP[%@] app state changed -> %ld", self.pipTraceId,
|
|
492
|
-
(long)currentState);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
// 2) Block enqueue for 300ms after state switch.
|
|
496
|
-
if (self.lastStateSwitchTime > 0) {
|
|
497
|
-
NSTimeInterval elapsed =
|
|
498
|
-
CFAbsoluteTimeGetCurrent() - self.lastStateSwitchTime;
|
|
499
|
-
if (elapsed < kStateSwitchCooldownSeconds) {
|
|
500
|
-
self.dropCooldownCount += 1;
|
|
501
|
-
[self logDropIfNeeded:@"cooldown" state:currentState];
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
// 3) Block Inactive while Control Center/Notification shade is presented.
|
|
507
|
-
NSLog(@"PIP: Application state is %ld", (long)currentState);
|
|
508
|
-
if (currentState == UIApplicationStateInactive) {
|
|
509
|
-
self.dropInactiveCount += 1;
|
|
510
|
-
[self logDropIfNeeded:@"inactive" state:currentState];
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
375
|
// Ensure pipController exists and is valid, avoid processing buffer during
|
|
515
376
|
// destruction
|
|
516
377
|
if (!self.pipController || !self.enableVideoObserver) {
|
|
517
|
-
self.dropNoControllerCount += 1;
|
|
518
|
-
[self logDropIfNeeded:@"no_controller_or_observer" state:currentState];
|
|
519
378
|
return;
|
|
520
379
|
}
|
|
521
380
|
|
|
522
381
|
if (@available(iOS 15.0, *)) {
|
|
523
|
-
// 4) Enqueue on main queue to let UI/lifecycle transitions settle first.
|
|
524
|
-
CVPixelBufferRef pixelBuffer = NULL;
|
|
525
|
-
CMSampleBufferRef sampleBuffer = NULL;
|
|
526
382
|
if (videoFrame.bufferType == VeLivePlayerVideoBufferTypePixelBuffer) {
|
|
527
|
-
pixelBuffer = videoFrame.pixelBuffer;
|
|
528
|
-
if (pixelBuffer) {
|
|
529
|
-
|
|
383
|
+
CVPixelBufferRef pixelBuffer = videoFrame.pixelBuffer;
|
|
384
|
+
if (pixelBuffer != NULL) {
|
|
385
|
+
[self.pipController enqueuePixelBuffer:pixelBuffer];
|
|
530
386
|
}
|
|
531
387
|
} else if (videoFrame.bufferType ==
|
|
532
388
|
VeLivePlayerVideoBufferTypeSampleBuffer) {
|
|
533
|
-
sampleBuffer = videoFrame.sampleBuffer;
|
|
534
|
-
if (sampleBuffer) {
|
|
535
|
-
CFRetain(sampleBuffer);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
if (!pixelBuffer && !sampleBuffer) {
|
|
540
|
-
self.dropNotReadyCount += 1;
|
|
541
|
-
[self logDropIfNeeded:@"no_buffer" state:currentState];
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
546
|
-
if ([self currentApplicationStateSafe] == UIApplicationStateInactive) {
|
|
547
|
-
if (pixelBuffer) {
|
|
548
|
-
CVBufferRelease(pixelBuffer);
|
|
549
|
-
}
|
|
550
|
-
if (sampleBuffer) {
|
|
551
|
-
CFRelease(sampleBuffer);
|
|
552
|
-
}
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
if (!self.pipController || !self.enableVideoObserver) {
|
|
556
|
-
if (pixelBuffer) {
|
|
557
|
-
CVBufferRelease(pixelBuffer);
|
|
558
|
-
}
|
|
559
|
-
if (sampleBuffer) {
|
|
560
|
-
CFRelease(sampleBuffer);
|
|
561
|
-
}
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
if (pixelBuffer) {
|
|
565
|
-
[self.pipController enqueuePixelBuffer:pixelBuffer];
|
|
566
|
-
CVBufferRelease(pixelBuffer);
|
|
567
|
-
self.enqueueCount += 1;
|
|
568
|
-
} else if (sampleBuffer) {
|
|
569
|
-
[self.pipController enqueueSampleBuffer:sampleBuffer];
|
|
570
|
-
CFRelease(sampleBuffer);
|
|
571
|
-
self.enqueueCount += 1;
|
|
572
|
-
}
|
|
573
|
-
});
|
|
574
|
-
} else {
|
|
575
|
-
// iOS < 15 fallback: keep existing direct path.
|
|
576
|
-
if (videoFrame.bufferType == VeLivePlayerVideoBufferTypeSampleBuffer) {
|
|
577
389
|
CMSampleBufferRef sampleBuffer = videoFrame.sampleBuffer;
|
|
578
390
|
if (sampleBuffer != NULL) {
|
|
579
391
|
[self.pipController enqueueSampleBuffer:sampleBuffer];
|
|
580
|
-
self.enqueueCount += 1;
|
|
581
392
|
}
|
|
582
|
-
} else {
|
|
583
|
-
self.dropNotReadyCount += 1;
|
|
584
393
|
}
|
|
585
394
|
}
|
|
586
395
|
}
|
|
@@ -605,8 +414,6 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
605
414
|
(VePictureInPictureController *)pictureInPictureController
|
|
606
415
|
statusChanged:(VePictureInPictureStatus)fromStatus
|
|
607
416
|
to:(VePictureInPictureStatus)toStatus {
|
|
608
|
-
NSLog(@"PIP[%@] status changed from=%ld to=%ld", self.pipTraceId,
|
|
609
|
-
(long)fromStatus, (long)toStatus);
|
|
610
417
|
switch (toStatus) {
|
|
611
418
|
case VePictureInPictureStatusIde: {
|
|
612
419
|
|
|
@@ -663,4 +470,4 @@ static const NSTimeInterval kFrameStatsLogIntervalSeconds = 5.0;
|
|
|
663
470
|
}
|
|
664
471
|
}
|
|
665
472
|
|
|
666
|
-
@end
|
|
473
|
+
@end
|
package/lib/commonjs/index.js
CHANGED
|
@@ -6183,6 +6183,7 @@ var TVLManager = function () {
|
|
|
6183
6183
|
var _setEnableIgnoreAudioInterruption_decorators;
|
|
6184
6184
|
var _setAllowsVideoRendering_decorators;
|
|
6185
6185
|
var _addExtraHttpRequestHeadersByUser_decorators;
|
|
6186
|
+
var _setOptionValue_decorators;
|
|
6186
6187
|
_classThis = /** @class */ (function () {
|
|
6187
6188
|
function TVLManager_1() {
|
|
6188
6189
|
/** {zh}
|
|
@@ -6730,6 +6731,21 @@ var TVLManager = function () {
|
|
|
6730
6731
|
TVLManager_1.prototype.addExtraHttpRequestHeadersByUser = function (headers) {
|
|
6731
6732
|
throw new Error('not implement');
|
|
6732
6733
|
};
|
|
6734
|
+
/** {zh}
|
|
6735
|
+
* @detail api
|
|
6736
|
+
* @brief 设置播放器选项值
|
|
6737
|
+
* @param value 选项值
|
|
6738
|
+
* @param identifier 选项标识符
|
|
6739
|
+
*/
|
|
6740
|
+
/** {en}
|
|
6741
|
+
* @detail api
|
|
6742
|
+
* @brief Sets player option value
|
|
6743
|
+
* @param value Option value
|
|
6744
|
+
* @param identifier Option identifier
|
|
6745
|
+
*/
|
|
6746
|
+
TVLManager_1.prototype.setOptionValue = function (value, identifier) {
|
|
6747
|
+
throw new Error('not implement');
|
|
6748
|
+
};
|
|
6733
6749
|
return TVLManager_1;
|
|
6734
6750
|
}());
|
|
6735
6751
|
__setFunctionName(_classThis, "TVLManager");
|
|
@@ -6768,6 +6784,7 @@ var TVLManager = function () {
|
|
|
6768
6784
|
_setEnableIgnoreAudioInterruption_decorators = [NativeMethodSync('setEnableIgnoreAudioInterruption:')];
|
|
6769
6785
|
_setAllowsVideoRendering_decorators = [NativeMethodSync('setAllowsVideoRendering:')];
|
|
6770
6786
|
_addExtraHttpRequestHeadersByUser_decorators = [NativeMethodSync('addExtraHttpRequestHeadersByUser:')];
|
|
6787
|
+
_setOptionValue_decorators = [NativeMethodSync('setOptionValue:forIdentifier:')];
|
|
6771
6788
|
__esDecorate(_classThis, null, _static_setLogLevel_decorators, { kind: "method", name: "setLogLevel", static: true, private: false, access: { has: function (obj) { return "setLogLevel" in obj; }, get: function (obj) { return obj.setLogLevel; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
6772
6789
|
__esDecorate(_classThis, null, _static_getVersion_decorators, { kind: "method", name: "getVersion", static: true, private: false, access: { has: function (obj) { return "getVersion" in obj; }, get: function (obj) { return obj.getVersion; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
6773
6790
|
__esDecorate(_classThis, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: function (obj) { return "init" in obj; }, get: function (obj) { return obj.init; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -6797,6 +6814,7 @@ var TVLManager = function () {
|
|
|
6797
6814
|
__esDecorate(_classThis, null, _setEnableIgnoreAudioInterruption_decorators, { kind: "method", name: "setEnableIgnoreAudioInterruption", static: false, private: false, access: { has: function (obj) { return "setEnableIgnoreAudioInterruption" in obj; }, get: function (obj) { return obj.setEnableIgnoreAudioInterruption; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6798
6815
|
__esDecorate(_classThis, null, _setAllowsVideoRendering_decorators, { kind: "method", name: "setAllowsVideoRendering", static: false, private: false, access: { has: function (obj) { return "setAllowsVideoRendering" in obj; }, get: function (obj) { return obj.setAllowsVideoRendering; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6799
6816
|
__esDecorate(_classThis, null, _addExtraHttpRequestHeadersByUser_decorators, { kind: "method", name: "addExtraHttpRequestHeadersByUser", static: false, private: false, access: { has: function (obj) { return "addExtraHttpRequestHeadersByUser" in obj; }, get: function (obj) { return obj.addExtraHttpRequestHeadersByUser; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6817
|
+
__esDecorate(_classThis, null, _setOptionValue_decorators, { kind: "method", name: "setOptionValue", static: false, private: false, access: { has: function (obj) { return "setOptionValue" in obj; }, get: function (obj) { return obj.setOptionValue; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6800
6818
|
__esDecorate(null, null, _observer_decorators, { kind: "field", name: "observer", static: false, private: false, access: { has: function (obj) { return "observer" in obj; }, get: function (obj) { return obj.observer; }, set: function (obj, value) { obj.observer = value; } }, metadata: _metadata }, _observer_initializers, _observer_extraInitializers);
|
|
6801
6819
|
__esDecorate(null, null, _playerView_decorators, { kind: "field", name: "playerView", static: false, private: false, access: { has: function (obj) { return "playerView" in obj; }, get: function (obj) { return obj.playerView; }, set: function (obj, value) { obj.playerView = value; } }, metadata: _metadata }, _playerView_initializers, _playerView_extraInitializers);
|
|
6802
6820
|
__esDecorate(null, null, _volume_decorators, { kind: "field", name: "volume", static: false, private: false, access: { has: function (obj) { return "volume" in obj; }, get: function (obj) { return obj.volume; }, set: function (obj, value) { obj.volume = value; } }, metadata: _metadata }, _volume_initializers, _volume_extraInitializers);
|
|
@@ -14646,6 +14664,8 @@ function initIOSPlayer(options) {
|
|
|
14646
14664
|
case 0:
|
|
14647
14665
|
viewId = options.viewId, option = __rest(options, ["viewId"]);
|
|
14648
14666
|
iosPlayer = new TVLManager();
|
|
14667
|
+
// 设置选项值
|
|
14668
|
+
iosPlayer.setOptionValue(1, 42866);
|
|
14649
14669
|
player = packObject(iosPlayer, VeLivePlayer);
|
|
14650
14670
|
config = new VeLivePlayerConfiguration();
|
|
14651
14671
|
Object.assign(config, defaultConfig, option);
|
package/lib/module/index.js
CHANGED
|
@@ -6181,6 +6181,7 @@ var TVLManager = function () {
|
|
|
6181
6181
|
var _setEnableIgnoreAudioInterruption_decorators;
|
|
6182
6182
|
var _setAllowsVideoRendering_decorators;
|
|
6183
6183
|
var _addExtraHttpRequestHeadersByUser_decorators;
|
|
6184
|
+
var _setOptionValue_decorators;
|
|
6184
6185
|
_classThis = /** @class */ (function () {
|
|
6185
6186
|
function TVLManager_1() {
|
|
6186
6187
|
/** {zh}
|
|
@@ -6728,6 +6729,21 @@ var TVLManager = function () {
|
|
|
6728
6729
|
TVLManager_1.prototype.addExtraHttpRequestHeadersByUser = function (headers) {
|
|
6729
6730
|
throw new Error('not implement');
|
|
6730
6731
|
};
|
|
6732
|
+
/** {zh}
|
|
6733
|
+
* @detail api
|
|
6734
|
+
* @brief 设置播放器选项值
|
|
6735
|
+
* @param value 选项值
|
|
6736
|
+
* @param identifier 选项标识符
|
|
6737
|
+
*/
|
|
6738
|
+
/** {en}
|
|
6739
|
+
* @detail api
|
|
6740
|
+
* @brief Sets player option value
|
|
6741
|
+
* @param value Option value
|
|
6742
|
+
* @param identifier Option identifier
|
|
6743
|
+
*/
|
|
6744
|
+
TVLManager_1.prototype.setOptionValue = function (value, identifier) {
|
|
6745
|
+
throw new Error('not implement');
|
|
6746
|
+
};
|
|
6731
6747
|
return TVLManager_1;
|
|
6732
6748
|
}());
|
|
6733
6749
|
__setFunctionName(_classThis, "TVLManager");
|
|
@@ -6766,6 +6782,7 @@ var TVLManager = function () {
|
|
|
6766
6782
|
_setEnableIgnoreAudioInterruption_decorators = [NativeMethodSync('setEnableIgnoreAudioInterruption:')];
|
|
6767
6783
|
_setAllowsVideoRendering_decorators = [NativeMethodSync('setAllowsVideoRendering:')];
|
|
6768
6784
|
_addExtraHttpRequestHeadersByUser_decorators = [NativeMethodSync('addExtraHttpRequestHeadersByUser:')];
|
|
6785
|
+
_setOptionValue_decorators = [NativeMethodSync('setOptionValue:forIdentifier:')];
|
|
6769
6786
|
__esDecorate(_classThis, null, _static_setLogLevel_decorators, { kind: "method", name: "setLogLevel", static: true, private: false, access: { has: function (obj) { return "setLogLevel" in obj; }, get: function (obj) { return obj.setLogLevel; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
6770
6787
|
__esDecorate(_classThis, null, _static_getVersion_decorators, { kind: "method", name: "getVersion", static: true, private: false, access: { has: function (obj) { return "getVersion" in obj; }, get: function (obj) { return obj.getVersion; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
6771
6788
|
__esDecorate(_classThis, null, _init_decorators, { kind: "method", name: "init", static: false, private: false, access: { has: function (obj) { return "init" in obj; }, get: function (obj) { return obj.init; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -6795,6 +6812,7 @@ var TVLManager = function () {
|
|
|
6795
6812
|
__esDecorate(_classThis, null, _setEnableIgnoreAudioInterruption_decorators, { kind: "method", name: "setEnableIgnoreAudioInterruption", static: false, private: false, access: { has: function (obj) { return "setEnableIgnoreAudioInterruption" in obj; }, get: function (obj) { return obj.setEnableIgnoreAudioInterruption; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6796
6813
|
__esDecorate(_classThis, null, _setAllowsVideoRendering_decorators, { kind: "method", name: "setAllowsVideoRendering", static: false, private: false, access: { has: function (obj) { return "setAllowsVideoRendering" in obj; }, get: function (obj) { return obj.setAllowsVideoRendering; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6797
6814
|
__esDecorate(_classThis, null, _addExtraHttpRequestHeadersByUser_decorators, { kind: "method", name: "addExtraHttpRequestHeadersByUser", static: false, private: false, access: { has: function (obj) { return "addExtraHttpRequestHeadersByUser" in obj; }, get: function (obj) { return obj.addExtraHttpRequestHeadersByUser; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6815
|
+
__esDecorate(_classThis, null, _setOptionValue_decorators, { kind: "method", name: "setOptionValue", static: false, private: false, access: { has: function (obj) { return "setOptionValue" in obj; }, get: function (obj) { return obj.setOptionValue; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
6798
6816
|
__esDecorate(null, null, _observer_decorators, { kind: "field", name: "observer", static: false, private: false, access: { has: function (obj) { return "observer" in obj; }, get: function (obj) { return obj.observer; }, set: function (obj, value) { obj.observer = value; } }, metadata: _metadata }, _observer_initializers, _observer_extraInitializers);
|
|
6799
6817
|
__esDecorate(null, null, _playerView_decorators, { kind: "field", name: "playerView", static: false, private: false, access: { has: function (obj) { return "playerView" in obj; }, get: function (obj) { return obj.playerView; }, set: function (obj, value) { obj.playerView = value; } }, metadata: _metadata }, _playerView_initializers, _playerView_extraInitializers);
|
|
6800
6818
|
__esDecorate(null, null, _volume_decorators, { kind: "field", name: "volume", static: false, private: false, access: { has: function (obj) { return "volume" in obj; }, get: function (obj) { return obj.volume; }, set: function (obj, value) { obj.volume = value; } }, metadata: _metadata }, _volume_initializers, _volume_extraInitializers);
|
|
@@ -14644,6 +14662,8 @@ function initIOSPlayer(options) {
|
|
|
14644
14662
|
case 0:
|
|
14645
14663
|
viewId = options.viewId, option = __rest(options, ["viewId"]);
|
|
14646
14664
|
iosPlayer = new TVLManager();
|
|
14665
|
+
// 设置选项值
|
|
14666
|
+
iosPlayer.setOptionValue(1, 42866);
|
|
14647
14667
|
player = packObject(iosPlayer, VeLivePlayer);
|
|
14648
14668
|
config = new VeLivePlayerConfiguration();
|
|
14649
14669
|
Object.assign(config, defaultConfig, option);
|
|
@@ -292,4 +292,12 @@ export declare class TVLManager {
|
|
|
292
292
|
setEnableIgnoreAudioInterruption(enable: BOOL): void;
|
|
293
293
|
setAllowsVideoRendering(enable: BOOL): void;
|
|
294
294
|
addExtraHttpRequestHeadersByUser(headers: NSDictionary): void;
|
|
295
|
+
|
|
296
|
+
/** {en}
|
|
297
|
+
* @detail api
|
|
298
|
+
* @brief Sets player option value
|
|
299
|
+
* @param value Option value
|
|
300
|
+
* @param identifier Option identifier
|
|
301
|
+
*/
|
|
302
|
+
setOptionValue(value: id, identifier: int): void;
|
|
295
303
|
}
|