@volcengine/react-native-live-pull 1.0.3-rc.0 → 1.1.1-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.
Files changed (25) hide show
  1. package/android/src/main/AndroidManifest.xml +7 -1
  2. package/android/src/main/AndroidManifestNew.xml +15 -1
  3. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModule.java +28 -20
  4. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcView.java +7 -8
  5. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowHelper.java +224 -0
  6. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/FloatingWindowService.java +171 -0
  7. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/IFloatingWindowHelper.java +80 -0
  8. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/PictureInPictureManager.java +280 -0
  9. package/android/src/main/java/com/volcengine/velive/rn/pull/pictureInpicture/VeLiveRefManager.java +119 -0
  10. package/android/src/main/res/drawable/button_close.xml +14 -0
  11. package/android/src/main/res/layout/floating_window_layout.xml +19 -0
  12. package/ios/VeLivePlayerMultiObserver.h +54 -0
  13. package/ios/VeLivePlayerMultiObserver.m +324 -0
  14. package/ios/pictureInpicture/PictureInPictureManager.h +29 -0
  15. package/ios/pictureInpicture/PictureInPictureManager.m +274 -0
  16. package/ios/pictureInpicture/VeLivePictureInPictureController.h +207 -0
  17. package/ios/pictureInpicture/VeLivePictureInPictureController.m +3393 -0
  18. package/lib/commonjs/index.js +524 -8
  19. package/lib/module/index.js +524 -8
  20. package/lib/typescript/core/api.d.ts +88 -1
  21. package/lib/typescript/core/callback.d.ts +52 -0
  22. package/lib/typescript/platforms/android/extends.d.ts +1 -1
  23. package/lib/typescript/platforms/android/pictureInpicture.d.ts +26 -0
  24. package/lib/typescript/platforms/ios/pictureInpicture.d.ts +32 -0
  25. package/package.json +1 -1
@@ -468,6 +468,17 @@ function findProto(ctor, name) {
468
468
  }
469
469
  return undefined;
470
470
  }
471
+ function extendsClassMethod(ctor, methodName, overrideFn) {
472
+ var proto = ctor.prototype;
473
+ var originalFn = ctor.prototype[methodName];
474
+ proto[methodName] = function () {
475
+ var args = [];
476
+ for (var _i = 0; _i < arguments.length; _i++) {
477
+ args[_i] = arguments[_i];
478
+ }
479
+ return overrideFn(originalFn === null || originalFn === void 0 ? void 0 : originalFn.bind(this)).apply(this, args);
480
+ };
481
+ }
471
482
  function extendsClassMember(ctor, memberName) {
472
483
  return function (handler) {
473
484
  var _a, _b;
@@ -14469,6 +14480,505 @@ var VeLivePlayer = function () {
14469
14480
  return _classThis;
14470
14481
  }();
14471
14482
 
14483
+ var PictureInPictureManagerListener = function () {
14484
+ var _classDecorators = [NativeObserverClass('com.volcengine.velive.rn.pull.pictureInpicture.PictureInPictureManager$Listener')];
14485
+ var _classDescriptor;
14486
+ var _classExtraInitializers = [];
14487
+ var _classThis;
14488
+ _classThis = /** @class */ (function () {
14489
+ function PictureInPictureManagerListener_1() {
14490
+ }
14491
+ return PictureInPictureManagerListener_1;
14492
+ }());
14493
+ __setFunctionName(_classThis, "PictureInPictureManagerListener");
14494
+ (function () {
14495
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14496
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14497
+ _classThis = _classDescriptor.value;
14498
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14499
+ __runInitializers(_classThis, _classExtraInitializers);
14500
+ })();
14501
+ return _classThis;
14502
+ }();
14503
+ var android_PictureInPictureListener = /** @class */ (function (_super) {
14504
+ __extends(android_PictureInPictureListener, _super);
14505
+ function android_PictureInPictureListener(_instance) {
14506
+ var _this = _super.call(this) || this;
14507
+ _this._instance = _instance;
14508
+ return _this;
14509
+ }
14510
+ android_PictureInPictureListener.prototype.onStartPictureInPicture = function () {
14511
+ if (!this._instance.onStartPictureInPicture) {
14512
+ return;
14513
+ }
14514
+ return this._instance.onStartPictureInPicture();
14515
+ };
14516
+ android_PictureInPictureListener.prototype.onStopPictureInPicture = function () {
14517
+ if (!this._instance.onStopPictureInPicture) {
14518
+ return;
14519
+ }
14520
+ return this._instance.onStopPictureInPicture();
14521
+ };
14522
+ android_PictureInPictureListener.prototype.onClickPictureInPicture = function () {
14523
+ if (!this._instance.onClickPictureInPicture) {
14524
+ return;
14525
+ }
14526
+ return this._instance.onClickPictureInPicture();
14527
+ };
14528
+ android_PictureInPictureListener.prototype.onError = function (code, extraData) {
14529
+ if (!this._instance.onError) {
14530
+ return;
14531
+ }
14532
+ return this._instance.onError(code, extraData);
14533
+ };
14534
+ return android_PictureInPictureListener;
14535
+ }(PictureInPictureManagerListener));
14536
+ var PictureInPictureManager = function () {
14537
+ var _classDecorators = [NativeClass('com.volcengine.velive.rn.pull.pictureInpicture.PictureInPictureManager')];
14538
+ var _classDescriptor;
14539
+ var _classExtraInitializers = [];
14540
+ var _classThis;
14541
+ var _classSuper = NativeProxyService;
14542
+ var _staticExtraInitializers = [];
14543
+ var _instanceExtraInitializers = [];
14544
+ var _static_getInstance_decorators;
14545
+ var _isPictureInPictureSupported_decorators;
14546
+ var _setupConfig_decorators;
14547
+ var _setListener_decorators;
14548
+ var _startPictureInPicture_decorators;
14549
+ var _stopPictureInPicture_decorators;
14550
+ var _setupPlayer_decorators;
14551
+ var PictureInPictureManager = _classThis = /** @class */ (function (_super) {
14552
+ __extends(PictureInPictureManager_1, _super);
14553
+ function PictureInPictureManager_1() {
14554
+ var _this = _super !== null && _super.apply(this, arguments) || this;
14555
+ __runInitializers(_this, _instanceExtraInitializers);
14556
+ return _this;
14557
+ }
14558
+ PictureInPictureManager_1.getInstance = function () {
14559
+ throw new Error('');
14560
+ };
14561
+ PictureInPictureManager_1.prototype.isPictureInPictureSupported = function () {
14562
+ throw new Error('');
14563
+ };
14564
+ PictureInPictureManager_1.prototype.setupConfig = function (aspectRatio, x, y) {
14565
+ throw new Error('');
14566
+ };
14567
+ PictureInPictureManager_1.prototype.setListener = function (listener) {
14568
+ throw new Error('');
14569
+ };
14570
+ PictureInPictureManager_1.prototype.startPictureInPicture = function (aspectRatio, x, y) {
14571
+ throw new Error('');
14572
+ };
14573
+ PictureInPictureManager_1.prototype.stopPictureInPicture = function () {
14574
+ throw new Error('');
14575
+ };
14576
+ PictureInPictureManager_1.prototype.setupPlayer = function (player, context, surfaceView) {
14577
+ throw new Error('');
14578
+ };
14579
+ return PictureInPictureManager_1;
14580
+ }(_classSuper));
14581
+ __setFunctionName(_classThis, "PictureInPictureManager");
14582
+ (function () {
14583
+ var _a;
14584
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
14585
+ _static_getInstance_decorators = [ReturnClass(function () { return PictureInPictureManager; }), NativeStaticMethodSync()];
14586
+ _isPictureInPictureSupported_decorators = [NativeMethodSync()];
14587
+ _setupConfig_decorators = [NativeMethodSync()];
14588
+ _setListener_decorators = [NativeMethodSync()];
14589
+ _startPictureInPicture_decorators = [NativeMethod()];
14590
+ _stopPictureInPicture_decorators = [NativeMethod()];
14591
+ _setupPlayer_decorators = [NativeMethod()];
14592
+ __esDecorate(_classThis, null, _static_getInstance_decorators, { kind: "method", name: "getInstance", static: true, private: false, access: { has: function (obj) { return "getInstance" in obj; }, get: function (obj) { return obj.getInstance; } }, metadata: _metadata }, null, _staticExtraInitializers);
14593
+ __esDecorate(_classThis, null, _isPictureInPictureSupported_decorators, { kind: "method", name: "isPictureInPictureSupported", static: false, private: false, access: { has: function (obj) { return "isPictureInPictureSupported" in obj; }, get: function (obj) { return obj.isPictureInPictureSupported; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14594
+ __esDecorate(_classThis, null, _setupConfig_decorators, { kind: "method", name: "setupConfig", static: false, private: false, access: { has: function (obj) { return "setupConfig" in obj; }, get: function (obj) { return obj.setupConfig; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14595
+ __esDecorate(_classThis, null, _setListener_decorators, { kind: "method", name: "setListener", static: false, private: false, access: { has: function (obj) { return "setListener" in obj; }, get: function (obj) { return obj.setListener; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14596
+ __esDecorate(_classThis, null, _startPictureInPicture_decorators, { kind: "method", name: "startPictureInPicture", static: false, private: false, access: { has: function (obj) { return "startPictureInPicture" in obj; }, get: function (obj) { return obj.startPictureInPicture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14597
+ __esDecorate(_classThis, null, _stopPictureInPicture_decorators, { kind: "method", name: "stopPictureInPicture", static: false, private: false, access: { has: function (obj) { return "stopPictureInPicture" in obj; }, get: function (obj) { return obj.stopPictureInPicture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14598
+ __esDecorate(_classThis, null, _setupPlayer_decorators, { kind: "method", name: "setupPlayer", static: false, private: false, access: { has: function (obj) { return "setupPlayer" in obj; }, get: function (obj) { return obj.setupPlayer; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14599
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14600
+ PictureInPictureManager = _classThis = _classDescriptor.value;
14601
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14602
+ __runInitializers(_classThis, _staticExtraInitializers);
14603
+ __runInitializers(_classThis, _classExtraInitializers);
14604
+ })();
14605
+ return PictureInPictureManager = _classThis;
14606
+ }();
14607
+
14608
+ var VeLivePictureInPictureManager = function () {
14609
+ var _classDecorators = [NativeClass('VeLivePictureInPictureManager')];
14610
+ var _classDescriptor;
14611
+ var _classExtraInitializers = [];
14612
+ var _classThis;
14613
+ var _staticExtraInitializers = [];
14614
+ var _instanceExtraInitializers = [];
14615
+ var _static_getInstance_decorators;
14616
+ var _isPictureInPictureSupported_decorators;
14617
+ var _setupPlayer_decorators;
14618
+ var _startPictureInPicture_decorators;
14619
+ var _stopPictureInPicture_decorators;
14620
+ var _enablePictureInPicture_decorators;
14621
+ var _disablePictureInPicture_decorators;
14622
+ var _destroyPictureInPicture_decorators;
14623
+ var _setListener_decorators;
14624
+ var VeLivePictureInPictureManager = _classThis = /** @class */ (function () {
14625
+ function VeLivePictureInPictureManager_1() {
14626
+ __runInitializers(this, _instanceExtraInitializers);
14627
+ }
14628
+ VeLivePictureInPictureManager_1.getInstance = function () {
14629
+ throw new Error('');
14630
+ };
14631
+ VeLivePictureInPictureManager_1.prototype.isPictureInPictureSupported = function () {
14632
+ throw new Error('');
14633
+ };
14634
+ VeLivePictureInPictureManager_1.prototype.setupPlayer = function (player) {
14635
+ return __awaiter(this, void 0, void 0, function () {
14636
+ return __generator(this, function (_a) {
14637
+ throw new Error('');
14638
+ });
14639
+ });
14640
+ };
14641
+ VeLivePictureInPictureManager_1.prototype.startPictureInPicture = function () {
14642
+ return __awaiter(this, void 0, void 0, function () {
14643
+ return __generator(this, function (_a) {
14644
+ throw new Error('');
14645
+ });
14646
+ });
14647
+ };
14648
+ VeLivePictureInPictureManager_1.prototype.stopPictureInPicture = function () {
14649
+ return __awaiter(this, void 0, void 0, function () {
14650
+ return __generator(this, function (_a) {
14651
+ throw new Error('');
14652
+ });
14653
+ });
14654
+ };
14655
+ VeLivePictureInPictureManager_1.prototype.enablePictureInPicture = function () {
14656
+ return __awaiter(this, void 0, void 0, function () {
14657
+ return __generator(this, function (_a) {
14658
+ throw new Error('');
14659
+ });
14660
+ });
14661
+ };
14662
+ VeLivePictureInPictureManager_1.prototype.disablePictureInPicture = function () {
14663
+ return __awaiter(this, void 0, void 0, function () {
14664
+ return __generator(this, function (_a) {
14665
+ throw new Error('');
14666
+ });
14667
+ });
14668
+ };
14669
+ VeLivePictureInPictureManager_1.prototype.destroyPictureInPicture = function () {
14670
+ return __awaiter(this, void 0, void 0, function () {
14671
+ return __generator(this, function (_a) {
14672
+ throw new Error('');
14673
+ });
14674
+ });
14675
+ };
14676
+ VeLivePictureInPictureManager_1.prototype.setListener = function (listener) {
14677
+ return __awaiter(this, void 0, void 0, function () {
14678
+ return __generator(this, function (_a) {
14679
+ throw new Error('');
14680
+ });
14681
+ });
14682
+ };
14683
+ return VeLivePictureInPictureManager_1;
14684
+ }());
14685
+ __setFunctionName(_classThis, "VeLivePictureInPictureManager");
14686
+ (function () {
14687
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14688
+ _static_getInstance_decorators = [ReturnClass(function () { return VeLivePictureInPictureManager; }), NativeStaticMethodSync('getInstance')];
14689
+ _isPictureInPictureSupported_decorators = [NativeMethodSync('isPictureInPictureSupported')];
14690
+ _setupPlayer_decorators = [NativeMethod('setupPlayer:')];
14691
+ _startPictureInPicture_decorators = [NativeMethod('startPictureInPicture')];
14692
+ _stopPictureInPicture_decorators = [NativeMethod('stopPictureInPicture')];
14693
+ _enablePictureInPicture_decorators = [NativeMethodSync('enablePictureInPicture')];
14694
+ _disablePictureInPicture_decorators = [NativeMethodSync('disablePictureInPicture')];
14695
+ _destroyPictureInPicture_decorators = [NativeMethodSync('destroyPictureInPicture')];
14696
+ _setListener_decorators = [NativeMethodSync('setListener:')];
14697
+ __esDecorate(_classThis, null, _static_getInstance_decorators, { kind: "method", name: "getInstance", static: true, private: false, access: { has: function (obj) { return "getInstance" in obj; }, get: function (obj) { return obj.getInstance; } }, metadata: _metadata }, null, _staticExtraInitializers);
14698
+ __esDecorate(_classThis, null, _isPictureInPictureSupported_decorators, { kind: "method", name: "isPictureInPictureSupported", static: false, private: false, access: { has: function (obj) { return "isPictureInPictureSupported" in obj; }, get: function (obj) { return obj.isPictureInPictureSupported; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14699
+ __esDecorate(_classThis, null, _setupPlayer_decorators, { kind: "method", name: "setupPlayer", static: false, private: false, access: { has: function (obj) { return "setupPlayer" in obj; }, get: function (obj) { return obj.setupPlayer; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14700
+ __esDecorate(_classThis, null, _startPictureInPicture_decorators, { kind: "method", name: "startPictureInPicture", static: false, private: false, access: { has: function (obj) { return "startPictureInPicture" in obj; }, get: function (obj) { return obj.startPictureInPicture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14701
+ __esDecorate(_classThis, null, _stopPictureInPicture_decorators, { kind: "method", name: "stopPictureInPicture", static: false, private: false, access: { has: function (obj) { return "stopPictureInPicture" in obj; }, get: function (obj) { return obj.stopPictureInPicture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14702
+ __esDecorate(_classThis, null, _enablePictureInPicture_decorators, { kind: "method", name: "enablePictureInPicture", static: false, private: false, access: { has: function (obj) { return "enablePictureInPicture" in obj; }, get: function (obj) { return obj.enablePictureInPicture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14703
+ __esDecorate(_classThis, null, _disablePictureInPicture_decorators, { kind: "method", name: "disablePictureInPicture", static: false, private: false, access: { has: function (obj) { return "disablePictureInPicture" in obj; }, get: function (obj) { return obj.disablePictureInPicture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14704
+ __esDecorate(_classThis, null, _destroyPictureInPicture_decorators, { kind: "method", name: "destroyPictureInPicture", static: false, private: false, access: { has: function (obj) { return "destroyPictureInPicture" in obj; }, get: function (obj) { return obj.destroyPictureInPicture; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14705
+ __esDecorate(_classThis, null, _setListener_decorators, { kind: "method", name: "setListener", static: false, private: false, access: { has: function (obj) { return "setListener" in obj; }, get: function (obj) { return obj.setListener; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14706
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14707
+ VeLivePictureInPictureManager = _classThis = _classDescriptor.value;
14708
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14709
+ __runInitializers(_classThis, _staticExtraInitializers);
14710
+ __runInitializers(_classThis, _classExtraInitializers);
14711
+ })();
14712
+ return VeLivePictureInPictureManager = _classThis;
14713
+ }();
14714
+ var VeLivePlayerMultiObserver = function () {
14715
+ var _classDecorators = [NativeClass('VeLivePlayerMultiObserver')];
14716
+ var _classDescriptor;
14717
+ var _classExtraInitializers = [];
14718
+ var _classThis;
14719
+ var _staticExtraInitializers = [];
14720
+ var _instanceExtraInitializers = [];
14721
+ var _static_getInstance_decorators;
14722
+ var _setupPlayer_decorators;
14723
+ var _addObserver_decorators;
14724
+ var _removeObserver_decorators;
14725
+ var VeLivePlayerMultiObserver = _classThis = /** @class */ (function () {
14726
+ function VeLivePlayerMultiObserver_1() {
14727
+ __runInitializers(this, _instanceExtraInitializers);
14728
+ }
14729
+ VeLivePlayerMultiObserver_1.getInstance = function () {
14730
+ throw new Error('');
14731
+ };
14732
+ VeLivePlayerMultiObserver_1.prototype.setupPlayer = function (player) {
14733
+ return __awaiter(this, void 0, void 0, function () {
14734
+ return __generator(this, function (_a) {
14735
+ throw new Error('');
14736
+ });
14737
+ });
14738
+ };
14739
+ VeLivePlayerMultiObserver_1.prototype.addObserver = function (observerId, observer) {
14740
+ return __awaiter(this, void 0, void 0, function () {
14741
+ return __generator(this, function (_a) {
14742
+ throw new Error('');
14743
+ });
14744
+ });
14745
+ };
14746
+ VeLivePlayerMultiObserver_1.prototype.removeObserver = function (observerId) {
14747
+ return __awaiter(this, void 0, void 0, function () {
14748
+ return __generator(this, function (_a) {
14749
+ throw new Error('');
14750
+ });
14751
+ });
14752
+ };
14753
+ return VeLivePlayerMultiObserver_1;
14754
+ }());
14755
+ __setFunctionName(_classThis, "VeLivePlayerMultiObserver");
14756
+ (function () {
14757
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14758
+ _static_getInstance_decorators = [ReturnClass(function () { return VeLivePlayerMultiObserver; }), NativeStaticMethodSync('getInstance')];
14759
+ _setupPlayer_decorators = [NativeMethod('setupPlayer:')];
14760
+ _addObserver_decorators = [NativeMethod('addObserver:observer:')];
14761
+ _removeObserver_decorators = [NativeMethod('removeObserver:')];
14762
+ __esDecorate(_classThis, null, _static_getInstance_decorators, { kind: "method", name: "getInstance", static: true, private: false, access: { has: function (obj) { return "getInstance" in obj; }, get: function (obj) { return obj.getInstance; } }, metadata: _metadata }, null, _staticExtraInitializers);
14763
+ __esDecorate(_classThis, null, _setupPlayer_decorators, { kind: "method", name: "setupPlayer", static: false, private: false, access: { has: function (obj) { return "setupPlayer" in obj; }, get: function (obj) { return obj.setupPlayer; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14764
+ __esDecorate(_classThis, null, _addObserver_decorators, { kind: "method", name: "addObserver", static: false, private: false, access: { has: function (obj) { return "addObserver" in obj; }, get: function (obj) { return obj.addObserver; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14765
+ __esDecorate(_classThis, null, _removeObserver_decorators, { kind: "method", name: "removeObserver", static: false, private: false, access: { has: function (obj) { return "removeObserver" in obj; }, get: function (obj) { return obj.removeObserver; } }, metadata: _metadata }, null, _instanceExtraInitializers);
14766
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14767
+ VeLivePlayerMultiObserver = _classThis = _classDescriptor.value;
14768
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14769
+ __runInitializers(_classThis, _staticExtraInitializers);
14770
+ __runInitializers(_classThis, _classExtraInitializers);
14771
+ })();
14772
+ return VeLivePlayerMultiObserver = _classThis;
14773
+ }();
14774
+ var VeLivePictureInPictureManagerListener = function () {
14775
+ var _classDecorators = [NativeObserverClass('VeLivePictureInPictureManagerListener', {
14776
+ onStartPictureInPicture: 'onStartPictureInPicture',
14777
+ onStopPictureInPicture: 'onStopPictureInPicture',
14778
+ onClickPictureInPicture: 'onClickPictureInPicture',
14779
+ onError$code$extraData: 'onError:code:extraData:',
14780
+ })];
14781
+ var _classDescriptor;
14782
+ var _classExtraInitializers = [];
14783
+ var _classThis;
14784
+ _classThis = /** @class */ (function () {
14785
+ function VeLivePictureInPictureManagerListener_1() {
14786
+ }
14787
+ return VeLivePictureInPictureManagerListener_1;
14788
+ }());
14789
+ __setFunctionName(_classThis, "VeLivePictureInPictureManagerListener");
14790
+ (function () {
14791
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14792
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14793
+ _classThis = _classDescriptor.value;
14794
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14795
+ __runInitializers(_classThis, _classExtraInitializers);
14796
+ })();
14797
+ return _classThis;
14798
+ }();
14799
+ var ios_PictureInPictureManagerListener = /** @class */ (function (_super) {
14800
+ __extends(ios_PictureInPictureManagerListener, _super);
14801
+ function ios_PictureInPictureManagerListener(_instance) {
14802
+ var _this = _super.call(this) || this;
14803
+ _this._instance = _instance;
14804
+ return _this;
14805
+ }
14806
+ ios_PictureInPictureManagerListener.prototype.onStartPictureInPicture = function () {
14807
+ if (!this._instance.onStartPictureInPicture) {
14808
+ return;
14809
+ }
14810
+ return this._instance.onStartPictureInPicture();
14811
+ };
14812
+ ios_PictureInPictureManagerListener.prototype.onStopPictureInPicture = function () {
14813
+ if (!this._instance.onStopPictureInPicture) {
14814
+ return;
14815
+ }
14816
+ return this._instance.onStopPictureInPicture();
14817
+ };
14818
+ ios_PictureInPictureManagerListener.prototype.onClickPictureInPicture = function () {
14819
+ if (!this._instance.onClickPictureInPicture) {
14820
+ return;
14821
+ }
14822
+ return this._instance.onClickPictureInPicture();
14823
+ };
14824
+ ios_PictureInPictureManagerListener.prototype.onError$code$extraData = function (code, extraData) {
14825
+ if (!this._instance.onError$code$extraData) {
14826
+ return;
14827
+ }
14828
+ return this._instance.onError$code$extraData(code, extraData);
14829
+ };
14830
+ return ios_PictureInPictureManagerListener;
14831
+ }(VeLivePictureInPictureManagerListener));
14832
+
14833
+ function runImpl(context, androidImpl, iosImpl) {
14834
+ if (env.getOS() === 'android') {
14835
+ var androidEngine = unpackObject(context);
14836
+ return androidImpl(androidEngine);
14837
+ }
14838
+ else if (env.getOS() === 'ios') {
14839
+ var iosEngine = unpackObject(context);
14840
+ return iosImpl(iosEngine);
14841
+ }
14842
+ else {
14843
+ throw new Error("not support: ".concat(env.getOS()));
14844
+ }
14845
+ }
14846
+ extendsClassMethod(VeLivePlayer, 'startPictureInPicture', function () {
14847
+ return function startPictureInPicture() {
14848
+ var args = [];
14849
+ for (var _i = 0; _i < arguments.length; _i++) {
14850
+ args[_i] = arguments[_i];
14851
+ }
14852
+ return __awaiter(this, void 0, void 0, function () {
14853
+ var _this = this;
14854
+ return __generator(this, function (_a) {
14855
+ return [2 /*return*/, runImpl(this, function () { return __awaiter(_this, void 0, void 0, function () {
14856
+ var manager;
14857
+ return __generator(this, function (_a) {
14858
+ manager = PictureInPictureManager.getInstance();
14859
+ return [2 /*return*/, manager.startPictureInPicture.apply(manager, args)];
14860
+ });
14861
+ }); }, function () { return __awaiter(_this, void 0, void 0, function () {
14862
+ var manager;
14863
+ return __generator(this, function (_a) {
14864
+ manager = VeLivePictureInPictureManager.getInstance();
14865
+ return [2 /*return*/, manager.startPictureInPicture()];
14866
+ });
14867
+ }); })];
14868
+ });
14869
+ });
14870
+ };
14871
+ });
14872
+ extendsClassMethod(VeLivePlayer, 'stopPictureInPicture', function () {
14873
+ return function stopPictureInPicture() {
14874
+ var _this = this;
14875
+ return runImpl(this, function () { return __awaiter(_this, void 0, void 0, function () {
14876
+ var manager;
14877
+ return __generator(this, function (_a) {
14878
+ manager = PictureInPictureManager.getInstance();
14879
+ return [2 /*return*/, manager.stopPictureInPicture()];
14880
+ });
14881
+ }); }, function () { return __awaiter(_this, void 0, void 0, function () {
14882
+ var manager;
14883
+ return __generator(this, function (_a) {
14884
+ manager = VeLivePictureInPictureManager.getInstance();
14885
+ return [2 /*return*/, manager.stopPictureInPicture()];
14886
+ });
14887
+ }); });
14888
+ };
14889
+ });
14890
+ extendsClassMethod(VeLivePlayer, 'setObserver', function (origin) {
14891
+ return function setObserver(observer) {
14892
+ return runImpl(this, function () {
14893
+ return origin(observer);
14894
+ }, function () {
14895
+ var _observer = packObject(observer, ios_VeLivePlayerObserver);
14896
+ var multiObserver = VeLivePlayerMultiObserver.getInstance();
14897
+ // Here we need to add a unique key for the observer, and don't modify prefix "rn-"
14898
+ multiObserver.addObserver('rn-observer', _observer);
14899
+ });
14900
+ };
14901
+ });
14902
+ extendsClassMethod(VeLivePlayer, 'setPictureInPictureListener', function () {
14903
+ return function setPictureInPictureListener(listener) {
14904
+ return runImpl(this, function () {
14905
+ var PictureInPictureManager$1 = PictureInPictureManager.getInstance();
14906
+ PictureInPictureManager$1.setListener(packObject(listener, android_PictureInPictureListener));
14907
+ }, function () {
14908
+ var manager = VeLivePictureInPictureManager.getInstance();
14909
+ manager.setListener(packObject(listener, ios_PictureInPictureManagerListener));
14910
+ });
14911
+ };
14912
+ });
14913
+ extendsClassMethod(VeLivePlayer, 'isPictureInPictureSupported', function () {
14914
+ return function isPictureInPictureSupported() {
14915
+ return runImpl(this, function () {
14916
+ var manager = PictureInPictureManager.getInstance();
14917
+ return manager.isPictureInPictureSupported();
14918
+ }, function () {
14919
+ var manager = VeLivePictureInPictureManager.getInstance();
14920
+ return manager.isPictureInPictureSupported();
14921
+ });
14922
+ };
14923
+ });
14924
+ extendsClassMethod(VeLivePlayer, 'enablePictureInPicture', function () {
14925
+ return function enablePictureInPicture() {
14926
+ return __awaiter(this, void 0, void 0, function () {
14927
+ return __generator(this, function (_a) {
14928
+ return [2 /*return*/, runImpl(this, function () { }, function () {
14929
+ var manager = VeLivePictureInPictureManager.getInstance();
14930
+ return manager.enablePictureInPicture();
14931
+ })];
14932
+ });
14933
+ });
14934
+ };
14935
+ });
14936
+ extendsClassMethod(VeLivePlayer, 'disablePictureInPicture', function () {
14937
+ return function disablePictureInPicture() {
14938
+ return __awaiter(this, void 0, void 0, function () {
14939
+ return __generator(this, function (_a) {
14940
+ return [2 /*return*/, runImpl(this, function () { }, function () {
14941
+ var manager = VeLivePictureInPictureManager.getInstance();
14942
+ return manager.disablePictureInPicture();
14943
+ })];
14944
+ });
14945
+ });
14946
+ };
14947
+ });
14948
+ extendsClassMethod(VeLivePlayer, 'destroy', function (origin) {
14949
+ return function destroy() {
14950
+ var _this = this;
14951
+ return runImpl(this, function () { return __awaiter(_this, void 0, void 0, function () {
14952
+ return __generator(this, function (_a) {
14953
+ origin();
14954
+ return [2 /*return*/];
14955
+ });
14956
+ }); }, function () { return __awaiter(_this, void 0, void 0, function () {
14957
+ var manager;
14958
+ return __generator(this, function (_a) {
14959
+ origin();
14960
+ manager = VeLivePictureInPictureManager.getInstance();
14961
+ return [2 /*return*/, manager.destroyPictureInPicture()];
14962
+ });
14963
+ }); });
14964
+ };
14965
+ });
14966
+
14967
+ extendsClassMethod(android_VeLivePlayerObserver, 'onVideoSizeChanged', function (original) {
14968
+ return function onVideoSizeChanged(player, width, height) {
14969
+ original(player, width, height);
14970
+ if (reactNative.Platform.OS === 'android') {
14971
+ var androidPictureInPictureManager = PictureInPictureManager.getInstance();
14972
+ if (androidPictureInPictureManager) {
14973
+ androidPictureInPictureManager.setupConfig(width / height, 0, 0);
14974
+ }
14975
+ }
14976
+ else if (reactNative.Platform.OS === 'ios') {
14977
+ VeLivePictureInPictureManager.getInstance();
14978
+ }
14979
+ };
14980
+ });
14981
+
14472
14982
  extendsClassMember(VeLivePlayerStatistics, 'format')(function () {
14473
14983
  return {
14474
14984
  getter: function () {
@@ -14684,23 +15194,25 @@ var defaultConfig = {
14684
15194
  };
14685
15195
  function initAndroidPlayer(options) {
14686
15196
  return __awaiter(this, void 0, void 0, function () {
14687
- var viewId, option, player, _a, view, _b, _c, config;
14688
- return __generator(this, function (_d) {
14689
- switch (_d.label) {
15197
+ var viewId, option, context, player, view, _a, _b, config, manager;
15198
+ return __generator(this, function (_c) {
15199
+ switch (_c.label) {
14690
15200
  case 0:
14691
15201
  viewId = options.viewId, option = __rest(options, ["viewId"]);
14692
- _a = VeLivePlayer.bind;
14693
15202
  return [4 /*yield*/, NativeVariables.getApplicationContext()];
14694
15203
  case 1:
14695
- player = new (_a.apply(VeLivePlayer, [void 0, _d.sent()]))();
15204
+ context = _c.sent();
15205
+ player = new VeLivePlayer(context);
14696
15206
  view = NativeView.getView(viewId, NativeSurfaceView);
14697
- _c = (_b = player).android_setSurfaceHolder;
15207
+ _b = (_a = player).android_setSurfaceHolder;
14698
15208
  return [4 /*yield*/, view.getHolder()];
14699
15209
  case 2:
14700
- _c.apply(_b, [(_d.sent())]);
15210
+ _b.apply(_a, [(_c.sent())]);
14701
15211
  config = new VeLivePlayerConfiguration();
14702
15212
  Object.assign(config, defaultConfig, option);
14703
15213
  player.setConfig(config);
15214
+ manager = PictureInPictureManager.getInstance();
15215
+ manager.setupPlayer(unpackObject(player), context, view);
14704
15216
  return [2 /*return*/, player];
14705
15217
  }
14706
15218
  });
@@ -14708,7 +15220,7 @@ function initAndroidPlayer(options) {
14708
15220
  }
14709
15221
  function initIOSPlayer(options) {
14710
15222
  return __awaiter(this, void 0, void 0, function () {
14711
- var viewId, option, player, config, uiView;
15223
+ var viewId, option, player, config, uiView, multiObserver, manager;
14712
15224
  return __generator(this, function (_a) {
14713
15225
  switch (_a.label) {
14714
15226
  case 0:
@@ -14721,6 +15233,10 @@ function initIOSPlayer(options) {
14721
15233
  return [4 /*yield*/, uiView.insertSubview(player.ios_playerView, 0)];
14722
15234
  case 1:
14723
15235
  _a.sent();
15236
+ multiObserver = VeLivePlayerMultiObserver.getInstance();
15237
+ multiObserver.setupPlayer(unpackObject(player));
15238
+ manager = VeLivePictureInPictureManager.getInstance();
15239
+ manager.setupPlayer(unpackObject(player));
14724
15240
  return [2 /*return*/, player];
14725
15241
  }
14726
15242
  });