@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
@@ -466,6 +466,17 @@ function findProto(ctor, name) {
466
466
  }
467
467
  return undefined;
468
468
  }
469
+ function extendsClassMethod(ctor, methodName, overrideFn) {
470
+ var proto = ctor.prototype;
471
+ var originalFn = ctor.prototype[methodName];
472
+ proto[methodName] = function () {
473
+ var args = [];
474
+ for (var _i = 0; _i < arguments.length; _i++) {
475
+ args[_i] = arguments[_i];
476
+ }
477
+ return overrideFn(originalFn === null || originalFn === void 0 ? void 0 : originalFn.bind(this)).apply(this, args);
478
+ };
479
+ }
469
480
  function extendsClassMember(ctor, memberName) {
470
481
  return function (handler) {
471
482
  var _a, _b;
@@ -14467,6 +14478,505 @@ var VeLivePlayer = function () {
14467
14478
  return _classThis;
14468
14479
  }();
14469
14480
 
14481
+ var PictureInPictureManagerListener = function () {
14482
+ var _classDecorators = [NativeObserverClass('com.volcengine.velive.rn.pull.pictureInpicture.PictureInPictureManager$Listener')];
14483
+ var _classDescriptor;
14484
+ var _classExtraInitializers = [];
14485
+ var _classThis;
14486
+ _classThis = /** @class */ (function () {
14487
+ function PictureInPictureManagerListener_1() {
14488
+ }
14489
+ return PictureInPictureManagerListener_1;
14490
+ }());
14491
+ __setFunctionName(_classThis, "PictureInPictureManagerListener");
14492
+ (function () {
14493
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14494
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14495
+ _classThis = _classDescriptor.value;
14496
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14497
+ __runInitializers(_classThis, _classExtraInitializers);
14498
+ })();
14499
+ return _classThis;
14500
+ }();
14501
+ var android_PictureInPictureListener = /** @class */ (function (_super) {
14502
+ __extends(android_PictureInPictureListener, _super);
14503
+ function android_PictureInPictureListener(_instance) {
14504
+ var _this = _super.call(this) || this;
14505
+ _this._instance = _instance;
14506
+ return _this;
14507
+ }
14508
+ android_PictureInPictureListener.prototype.onStartPictureInPicture = function () {
14509
+ if (!this._instance.onStartPictureInPicture) {
14510
+ return;
14511
+ }
14512
+ return this._instance.onStartPictureInPicture();
14513
+ };
14514
+ android_PictureInPictureListener.prototype.onStopPictureInPicture = function () {
14515
+ if (!this._instance.onStopPictureInPicture) {
14516
+ return;
14517
+ }
14518
+ return this._instance.onStopPictureInPicture();
14519
+ };
14520
+ android_PictureInPictureListener.prototype.onClickPictureInPicture = function () {
14521
+ if (!this._instance.onClickPictureInPicture) {
14522
+ return;
14523
+ }
14524
+ return this._instance.onClickPictureInPicture();
14525
+ };
14526
+ android_PictureInPictureListener.prototype.onError = function (code, extraData) {
14527
+ if (!this._instance.onError) {
14528
+ return;
14529
+ }
14530
+ return this._instance.onError(code, extraData);
14531
+ };
14532
+ return android_PictureInPictureListener;
14533
+ }(PictureInPictureManagerListener));
14534
+ var PictureInPictureManager = function () {
14535
+ var _classDecorators = [NativeClass('com.volcengine.velive.rn.pull.pictureInpicture.PictureInPictureManager')];
14536
+ var _classDescriptor;
14537
+ var _classExtraInitializers = [];
14538
+ var _classThis;
14539
+ var _classSuper = NativeProxyService;
14540
+ var _staticExtraInitializers = [];
14541
+ var _instanceExtraInitializers = [];
14542
+ var _static_getInstance_decorators;
14543
+ var _isPictureInPictureSupported_decorators;
14544
+ var _setupConfig_decorators;
14545
+ var _setListener_decorators;
14546
+ var _startPictureInPicture_decorators;
14547
+ var _stopPictureInPicture_decorators;
14548
+ var _setupPlayer_decorators;
14549
+ var PictureInPictureManager = _classThis = /** @class */ (function (_super) {
14550
+ __extends(PictureInPictureManager_1, _super);
14551
+ function PictureInPictureManager_1() {
14552
+ var _this = _super !== null && _super.apply(this, arguments) || this;
14553
+ __runInitializers(_this, _instanceExtraInitializers);
14554
+ return _this;
14555
+ }
14556
+ PictureInPictureManager_1.getInstance = function () {
14557
+ throw new Error('');
14558
+ };
14559
+ PictureInPictureManager_1.prototype.isPictureInPictureSupported = function () {
14560
+ throw new Error('');
14561
+ };
14562
+ PictureInPictureManager_1.prototype.setupConfig = function (aspectRatio, x, y) {
14563
+ throw new Error('');
14564
+ };
14565
+ PictureInPictureManager_1.prototype.setListener = function (listener) {
14566
+ throw new Error('');
14567
+ };
14568
+ PictureInPictureManager_1.prototype.startPictureInPicture = function (aspectRatio, x, y) {
14569
+ throw new Error('');
14570
+ };
14571
+ PictureInPictureManager_1.prototype.stopPictureInPicture = function () {
14572
+ throw new Error('');
14573
+ };
14574
+ PictureInPictureManager_1.prototype.setupPlayer = function (player, context, surfaceView) {
14575
+ throw new Error('');
14576
+ };
14577
+ return PictureInPictureManager_1;
14578
+ }(_classSuper));
14579
+ __setFunctionName(_classThis, "PictureInPictureManager");
14580
+ (function () {
14581
+ var _a;
14582
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
14583
+ _static_getInstance_decorators = [ReturnClass(function () { return PictureInPictureManager; }), NativeStaticMethodSync()];
14584
+ _isPictureInPictureSupported_decorators = [NativeMethodSync()];
14585
+ _setupConfig_decorators = [NativeMethodSync()];
14586
+ _setListener_decorators = [NativeMethodSync()];
14587
+ _startPictureInPicture_decorators = [NativeMethod()];
14588
+ _stopPictureInPicture_decorators = [NativeMethod()];
14589
+ _setupPlayer_decorators = [NativeMethod()];
14590
+ __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);
14591
+ __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);
14592
+ __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);
14593
+ __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);
14594
+ __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);
14595
+ __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);
14596
+ __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);
14597
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14598
+ PictureInPictureManager = _classThis = _classDescriptor.value;
14599
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14600
+ __runInitializers(_classThis, _staticExtraInitializers);
14601
+ __runInitializers(_classThis, _classExtraInitializers);
14602
+ })();
14603
+ return PictureInPictureManager = _classThis;
14604
+ }();
14605
+
14606
+ var VeLivePictureInPictureManager = function () {
14607
+ var _classDecorators = [NativeClass('VeLivePictureInPictureManager')];
14608
+ var _classDescriptor;
14609
+ var _classExtraInitializers = [];
14610
+ var _classThis;
14611
+ var _staticExtraInitializers = [];
14612
+ var _instanceExtraInitializers = [];
14613
+ var _static_getInstance_decorators;
14614
+ var _isPictureInPictureSupported_decorators;
14615
+ var _setupPlayer_decorators;
14616
+ var _startPictureInPicture_decorators;
14617
+ var _stopPictureInPicture_decorators;
14618
+ var _enablePictureInPicture_decorators;
14619
+ var _disablePictureInPicture_decorators;
14620
+ var _destroyPictureInPicture_decorators;
14621
+ var _setListener_decorators;
14622
+ var VeLivePictureInPictureManager = _classThis = /** @class */ (function () {
14623
+ function VeLivePictureInPictureManager_1() {
14624
+ __runInitializers(this, _instanceExtraInitializers);
14625
+ }
14626
+ VeLivePictureInPictureManager_1.getInstance = function () {
14627
+ throw new Error('');
14628
+ };
14629
+ VeLivePictureInPictureManager_1.prototype.isPictureInPictureSupported = function () {
14630
+ throw new Error('');
14631
+ };
14632
+ VeLivePictureInPictureManager_1.prototype.setupPlayer = function (player) {
14633
+ return __awaiter(this, void 0, void 0, function () {
14634
+ return __generator(this, function (_a) {
14635
+ throw new Error('');
14636
+ });
14637
+ });
14638
+ };
14639
+ VeLivePictureInPictureManager_1.prototype.startPictureInPicture = function () {
14640
+ return __awaiter(this, void 0, void 0, function () {
14641
+ return __generator(this, function (_a) {
14642
+ throw new Error('');
14643
+ });
14644
+ });
14645
+ };
14646
+ VeLivePictureInPictureManager_1.prototype.stopPictureInPicture = function () {
14647
+ return __awaiter(this, void 0, void 0, function () {
14648
+ return __generator(this, function (_a) {
14649
+ throw new Error('');
14650
+ });
14651
+ });
14652
+ };
14653
+ VeLivePictureInPictureManager_1.prototype.enablePictureInPicture = function () {
14654
+ return __awaiter(this, void 0, void 0, function () {
14655
+ return __generator(this, function (_a) {
14656
+ throw new Error('');
14657
+ });
14658
+ });
14659
+ };
14660
+ VeLivePictureInPictureManager_1.prototype.disablePictureInPicture = function () {
14661
+ return __awaiter(this, void 0, void 0, function () {
14662
+ return __generator(this, function (_a) {
14663
+ throw new Error('');
14664
+ });
14665
+ });
14666
+ };
14667
+ VeLivePictureInPictureManager_1.prototype.destroyPictureInPicture = function () {
14668
+ return __awaiter(this, void 0, void 0, function () {
14669
+ return __generator(this, function (_a) {
14670
+ throw new Error('');
14671
+ });
14672
+ });
14673
+ };
14674
+ VeLivePictureInPictureManager_1.prototype.setListener = function (listener) {
14675
+ return __awaiter(this, void 0, void 0, function () {
14676
+ return __generator(this, function (_a) {
14677
+ throw new Error('');
14678
+ });
14679
+ });
14680
+ };
14681
+ return VeLivePictureInPictureManager_1;
14682
+ }());
14683
+ __setFunctionName(_classThis, "VeLivePictureInPictureManager");
14684
+ (function () {
14685
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14686
+ _static_getInstance_decorators = [ReturnClass(function () { return VeLivePictureInPictureManager; }), NativeStaticMethodSync('getInstance')];
14687
+ _isPictureInPictureSupported_decorators = [NativeMethodSync('isPictureInPictureSupported')];
14688
+ _setupPlayer_decorators = [NativeMethod('setupPlayer:')];
14689
+ _startPictureInPicture_decorators = [NativeMethod('startPictureInPicture')];
14690
+ _stopPictureInPicture_decorators = [NativeMethod('stopPictureInPicture')];
14691
+ _enablePictureInPicture_decorators = [NativeMethodSync('enablePictureInPicture')];
14692
+ _disablePictureInPicture_decorators = [NativeMethodSync('disablePictureInPicture')];
14693
+ _destroyPictureInPicture_decorators = [NativeMethodSync('destroyPictureInPicture')];
14694
+ _setListener_decorators = [NativeMethodSync('setListener:')];
14695
+ __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);
14696
+ __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);
14697
+ __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);
14698
+ __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);
14699
+ __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);
14700
+ __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);
14701
+ __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);
14702
+ __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);
14703
+ __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);
14704
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14705
+ VeLivePictureInPictureManager = _classThis = _classDescriptor.value;
14706
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14707
+ __runInitializers(_classThis, _staticExtraInitializers);
14708
+ __runInitializers(_classThis, _classExtraInitializers);
14709
+ })();
14710
+ return VeLivePictureInPictureManager = _classThis;
14711
+ }();
14712
+ var VeLivePlayerMultiObserver = function () {
14713
+ var _classDecorators = [NativeClass('VeLivePlayerMultiObserver')];
14714
+ var _classDescriptor;
14715
+ var _classExtraInitializers = [];
14716
+ var _classThis;
14717
+ var _staticExtraInitializers = [];
14718
+ var _instanceExtraInitializers = [];
14719
+ var _static_getInstance_decorators;
14720
+ var _setupPlayer_decorators;
14721
+ var _addObserver_decorators;
14722
+ var _removeObserver_decorators;
14723
+ var VeLivePlayerMultiObserver = _classThis = /** @class */ (function () {
14724
+ function VeLivePlayerMultiObserver_1() {
14725
+ __runInitializers(this, _instanceExtraInitializers);
14726
+ }
14727
+ VeLivePlayerMultiObserver_1.getInstance = function () {
14728
+ throw new Error('');
14729
+ };
14730
+ VeLivePlayerMultiObserver_1.prototype.setupPlayer = function (player) {
14731
+ return __awaiter(this, void 0, void 0, function () {
14732
+ return __generator(this, function (_a) {
14733
+ throw new Error('');
14734
+ });
14735
+ });
14736
+ };
14737
+ VeLivePlayerMultiObserver_1.prototype.addObserver = function (observerId, observer) {
14738
+ return __awaiter(this, void 0, void 0, function () {
14739
+ return __generator(this, function (_a) {
14740
+ throw new Error('');
14741
+ });
14742
+ });
14743
+ };
14744
+ VeLivePlayerMultiObserver_1.prototype.removeObserver = function (observerId) {
14745
+ return __awaiter(this, void 0, void 0, function () {
14746
+ return __generator(this, function (_a) {
14747
+ throw new Error('');
14748
+ });
14749
+ });
14750
+ };
14751
+ return VeLivePlayerMultiObserver_1;
14752
+ }());
14753
+ __setFunctionName(_classThis, "VeLivePlayerMultiObserver");
14754
+ (function () {
14755
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14756
+ _static_getInstance_decorators = [ReturnClass(function () { return VeLivePlayerMultiObserver; }), NativeStaticMethodSync('getInstance')];
14757
+ _setupPlayer_decorators = [NativeMethod('setupPlayer:')];
14758
+ _addObserver_decorators = [NativeMethod('addObserver:observer:')];
14759
+ _removeObserver_decorators = [NativeMethod('removeObserver:')];
14760
+ __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);
14761
+ __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);
14762
+ __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);
14763
+ __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);
14764
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14765
+ VeLivePlayerMultiObserver = _classThis = _classDescriptor.value;
14766
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14767
+ __runInitializers(_classThis, _staticExtraInitializers);
14768
+ __runInitializers(_classThis, _classExtraInitializers);
14769
+ })();
14770
+ return VeLivePlayerMultiObserver = _classThis;
14771
+ }();
14772
+ var VeLivePictureInPictureManagerListener = function () {
14773
+ var _classDecorators = [NativeObserverClass('VeLivePictureInPictureManagerListener', {
14774
+ onStartPictureInPicture: 'onStartPictureInPicture',
14775
+ onStopPictureInPicture: 'onStopPictureInPicture',
14776
+ onClickPictureInPicture: 'onClickPictureInPicture',
14777
+ onError$code$extraData: 'onError:code:extraData:',
14778
+ })];
14779
+ var _classDescriptor;
14780
+ var _classExtraInitializers = [];
14781
+ var _classThis;
14782
+ _classThis = /** @class */ (function () {
14783
+ function VeLivePictureInPictureManagerListener_1() {
14784
+ }
14785
+ return VeLivePictureInPictureManagerListener_1;
14786
+ }());
14787
+ __setFunctionName(_classThis, "VeLivePictureInPictureManagerListener");
14788
+ (function () {
14789
+ var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
14790
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
14791
+ _classThis = _classDescriptor.value;
14792
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
14793
+ __runInitializers(_classThis, _classExtraInitializers);
14794
+ })();
14795
+ return _classThis;
14796
+ }();
14797
+ var ios_PictureInPictureManagerListener = /** @class */ (function (_super) {
14798
+ __extends(ios_PictureInPictureManagerListener, _super);
14799
+ function ios_PictureInPictureManagerListener(_instance) {
14800
+ var _this = _super.call(this) || this;
14801
+ _this._instance = _instance;
14802
+ return _this;
14803
+ }
14804
+ ios_PictureInPictureManagerListener.prototype.onStartPictureInPicture = function () {
14805
+ if (!this._instance.onStartPictureInPicture) {
14806
+ return;
14807
+ }
14808
+ return this._instance.onStartPictureInPicture();
14809
+ };
14810
+ ios_PictureInPictureManagerListener.prototype.onStopPictureInPicture = function () {
14811
+ if (!this._instance.onStopPictureInPicture) {
14812
+ return;
14813
+ }
14814
+ return this._instance.onStopPictureInPicture();
14815
+ };
14816
+ ios_PictureInPictureManagerListener.prototype.onClickPictureInPicture = function () {
14817
+ if (!this._instance.onClickPictureInPicture) {
14818
+ return;
14819
+ }
14820
+ return this._instance.onClickPictureInPicture();
14821
+ };
14822
+ ios_PictureInPictureManagerListener.prototype.onError$code$extraData = function (code, extraData) {
14823
+ if (!this._instance.onError$code$extraData) {
14824
+ return;
14825
+ }
14826
+ return this._instance.onError$code$extraData(code, extraData);
14827
+ };
14828
+ return ios_PictureInPictureManagerListener;
14829
+ }(VeLivePictureInPictureManagerListener));
14830
+
14831
+ function runImpl(context, androidImpl, iosImpl) {
14832
+ if (env.getOS() === 'android') {
14833
+ var androidEngine = unpackObject(context);
14834
+ return androidImpl(androidEngine);
14835
+ }
14836
+ else if (env.getOS() === 'ios') {
14837
+ var iosEngine = unpackObject(context);
14838
+ return iosImpl(iosEngine);
14839
+ }
14840
+ else {
14841
+ throw new Error("not support: ".concat(env.getOS()));
14842
+ }
14843
+ }
14844
+ extendsClassMethod(VeLivePlayer, 'startPictureInPicture', function () {
14845
+ return function startPictureInPicture() {
14846
+ var args = [];
14847
+ for (var _i = 0; _i < arguments.length; _i++) {
14848
+ args[_i] = arguments[_i];
14849
+ }
14850
+ return __awaiter(this, void 0, void 0, function () {
14851
+ var _this = this;
14852
+ return __generator(this, function (_a) {
14853
+ return [2 /*return*/, runImpl(this, function () { return __awaiter(_this, void 0, void 0, function () {
14854
+ var manager;
14855
+ return __generator(this, function (_a) {
14856
+ manager = PictureInPictureManager.getInstance();
14857
+ return [2 /*return*/, manager.startPictureInPicture.apply(manager, args)];
14858
+ });
14859
+ }); }, function () { return __awaiter(_this, void 0, void 0, function () {
14860
+ var manager;
14861
+ return __generator(this, function (_a) {
14862
+ manager = VeLivePictureInPictureManager.getInstance();
14863
+ return [2 /*return*/, manager.startPictureInPicture()];
14864
+ });
14865
+ }); })];
14866
+ });
14867
+ });
14868
+ };
14869
+ });
14870
+ extendsClassMethod(VeLivePlayer, 'stopPictureInPicture', function () {
14871
+ return function stopPictureInPicture() {
14872
+ var _this = this;
14873
+ return runImpl(this, function () { return __awaiter(_this, void 0, void 0, function () {
14874
+ var manager;
14875
+ return __generator(this, function (_a) {
14876
+ manager = PictureInPictureManager.getInstance();
14877
+ return [2 /*return*/, manager.stopPictureInPicture()];
14878
+ });
14879
+ }); }, function () { return __awaiter(_this, void 0, void 0, function () {
14880
+ var manager;
14881
+ return __generator(this, function (_a) {
14882
+ manager = VeLivePictureInPictureManager.getInstance();
14883
+ return [2 /*return*/, manager.stopPictureInPicture()];
14884
+ });
14885
+ }); });
14886
+ };
14887
+ });
14888
+ extendsClassMethod(VeLivePlayer, 'setObserver', function (origin) {
14889
+ return function setObserver(observer) {
14890
+ return runImpl(this, function () {
14891
+ return origin(observer);
14892
+ }, function () {
14893
+ var _observer = packObject(observer, ios_VeLivePlayerObserver);
14894
+ var multiObserver = VeLivePlayerMultiObserver.getInstance();
14895
+ // Here we need to add a unique key for the observer, and don't modify prefix "rn-"
14896
+ multiObserver.addObserver('rn-observer', _observer);
14897
+ });
14898
+ };
14899
+ });
14900
+ extendsClassMethod(VeLivePlayer, 'setPictureInPictureListener', function () {
14901
+ return function setPictureInPictureListener(listener) {
14902
+ return runImpl(this, function () {
14903
+ var PictureInPictureManager$1 = PictureInPictureManager.getInstance();
14904
+ PictureInPictureManager$1.setListener(packObject(listener, android_PictureInPictureListener));
14905
+ }, function () {
14906
+ var manager = VeLivePictureInPictureManager.getInstance();
14907
+ manager.setListener(packObject(listener, ios_PictureInPictureManagerListener));
14908
+ });
14909
+ };
14910
+ });
14911
+ extendsClassMethod(VeLivePlayer, 'isPictureInPictureSupported', function () {
14912
+ return function isPictureInPictureSupported() {
14913
+ return runImpl(this, function () {
14914
+ var manager = PictureInPictureManager.getInstance();
14915
+ return manager.isPictureInPictureSupported();
14916
+ }, function () {
14917
+ var manager = VeLivePictureInPictureManager.getInstance();
14918
+ return manager.isPictureInPictureSupported();
14919
+ });
14920
+ };
14921
+ });
14922
+ extendsClassMethod(VeLivePlayer, 'enablePictureInPicture', function () {
14923
+ return function enablePictureInPicture() {
14924
+ return __awaiter(this, void 0, void 0, function () {
14925
+ return __generator(this, function (_a) {
14926
+ return [2 /*return*/, runImpl(this, function () { }, function () {
14927
+ var manager = VeLivePictureInPictureManager.getInstance();
14928
+ return manager.enablePictureInPicture();
14929
+ })];
14930
+ });
14931
+ });
14932
+ };
14933
+ });
14934
+ extendsClassMethod(VeLivePlayer, 'disablePictureInPicture', function () {
14935
+ return function disablePictureInPicture() {
14936
+ return __awaiter(this, void 0, void 0, function () {
14937
+ return __generator(this, function (_a) {
14938
+ return [2 /*return*/, runImpl(this, function () { }, function () {
14939
+ var manager = VeLivePictureInPictureManager.getInstance();
14940
+ return manager.disablePictureInPicture();
14941
+ })];
14942
+ });
14943
+ });
14944
+ };
14945
+ });
14946
+ extendsClassMethod(VeLivePlayer, 'destroy', function (origin) {
14947
+ return function destroy() {
14948
+ var _this = this;
14949
+ return runImpl(this, function () { return __awaiter(_this, void 0, void 0, function () {
14950
+ return __generator(this, function (_a) {
14951
+ origin();
14952
+ return [2 /*return*/];
14953
+ });
14954
+ }); }, function () { return __awaiter(_this, void 0, void 0, function () {
14955
+ var manager;
14956
+ return __generator(this, function (_a) {
14957
+ origin();
14958
+ manager = VeLivePictureInPictureManager.getInstance();
14959
+ return [2 /*return*/, manager.destroyPictureInPicture()];
14960
+ });
14961
+ }); });
14962
+ };
14963
+ });
14964
+
14965
+ extendsClassMethod(android_VeLivePlayerObserver, 'onVideoSizeChanged', function (original) {
14966
+ return function onVideoSizeChanged(player, width, height) {
14967
+ original(player, width, height);
14968
+ if (Platform.OS === 'android') {
14969
+ var androidPictureInPictureManager = PictureInPictureManager.getInstance();
14970
+ if (androidPictureInPictureManager) {
14971
+ androidPictureInPictureManager.setupConfig(width / height, 0, 0);
14972
+ }
14973
+ }
14974
+ else if (Platform.OS === 'ios') {
14975
+ VeLivePictureInPictureManager.getInstance();
14976
+ }
14977
+ };
14978
+ });
14979
+
14470
14980
  extendsClassMember(VeLivePlayerStatistics, 'format')(function () {
14471
14981
  return {
14472
14982
  getter: function () {
@@ -14682,23 +15192,25 @@ var defaultConfig = {
14682
15192
  };
14683
15193
  function initAndroidPlayer(options) {
14684
15194
  return __awaiter(this, void 0, void 0, function () {
14685
- var viewId, option, player, _a, view, _b, _c, config;
14686
- return __generator(this, function (_d) {
14687
- switch (_d.label) {
15195
+ var viewId, option, context, player, view, _a, _b, config, manager;
15196
+ return __generator(this, function (_c) {
15197
+ switch (_c.label) {
14688
15198
  case 0:
14689
15199
  viewId = options.viewId, option = __rest(options, ["viewId"]);
14690
- _a = VeLivePlayer.bind;
14691
15200
  return [4 /*yield*/, NativeVariables.getApplicationContext()];
14692
15201
  case 1:
14693
- player = new (_a.apply(VeLivePlayer, [void 0, _d.sent()]))();
15202
+ context = _c.sent();
15203
+ player = new VeLivePlayer(context);
14694
15204
  view = NativeView.getView(viewId, NativeSurfaceView);
14695
- _c = (_b = player).android_setSurfaceHolder;
15205
+ _b = (_a = player).android_setSurfaceHolder;
14696
15206
  return [4 /*yield*/, view.getHolder()];
14697
15207
  case 2:
14698
- _c.apply(_b, [(_d.sent())]);
15208
+ _b.apply(_a, [(_c.sent())]);
14699
15209
  config = new VeLivePlayerConfiguration();
14700
15210
  Object.assign(config, defaultConfig, option);
14701
15211
  player.setConfig(config);
15212
+ manager = PictureInPictureManager.getInstance();
15213
+ manager.setupPlayer(unpackObject(player), context, view);
14702
15214
  return [2 /*return*/, player];
14703
15215
  }
14704
15216
  });
@@ -14706,7 +15218,7 @@ function initAndroidPlayer(options) {
14706
15218
  }
14707
15219
  function initIOSPlayer(options) {
14708
15220
  return __awaiter(this, void 0, void 0, function () {
14709
- var viewId, option, player, config, uiView;
15221
+ var viewId, option, player, config, uiView, multiObserver, manager;
14710
15222
  return __generator(this, function (_a) {
14711
15223
  switch (_a.label) {
14712
15224
  case 0:
@@ -14719,6 +15231,10 @@ function initIOSPlayer(options) {
14719
15231
  return [4 /*yield*/, uiView.insertSubview(player.ios_playerView, 0)];
14720
15232
  case 1:
14721
15233
  _a.sent();
15234
+ multiObserver = VeLivePlayerMultiObserver.getInstance();
15235
+ multiObserver.setupPlayer(unpackObject(player));
15236
+ manager = VeLivePictureInPictureManager.getInstance();
15237
+ manager.setupPlayer(unpackObject(player));
14722
15238
  return [2 /*return*/, player];
14723
15239
  }
14724
15240
  });
@@ -1 +1,88 @@
1
- export { VeLivePlayer } from '../codegen/pack/api';
1
+ import { VeLivePlayer } from '../codegen/pack/api';
2
+ import type { VeLivePlayerObserver, PictureInPictureManagerListener } from './callback';
3
+ export { VeLivePlayerObserver };
4
+ declare module '../codegen/pack/api' {
5
+ interface VeLivePlayer {
6
+ /**
7
+ * {zh}
8
+ * @brief 开始悬浮窗
9
+ * @param aspectRatio 悬浮窗宽高比
10
+ * @param x 悬浮窗x坐标
11
+ * @param y 悬浮窗y坐标
12
+ * @order 1
13
+ */
14
+ /**
15
+ * {en}
16
+ * @brief Start picture in picture
17
+ * @param aspectRatio floating window aspect ratio
18
+ * @param x floating window x coordinate
19
+ * @param y floating window y coordinate
20
+ * @order 1
21
+ */
22
+ startPictureInPicture(aspectRatio?: number, x?: number, y?: number): Promise<void>;
23
+ /**
24
+ * {zh}
25
+ * @brief 结束悬浮窗
26
+ * @order 2
27
+ */
28
+ /**
29
+ * {en}
30
+ * @brief Stop picture in picture
31
+ * @order 2
32
+ */
33
+ stopPictureInPicture(): Promise<void>;
34
+ /**
35
+ * {zh}
36
+ * @brief 判断是否支持画中画
37
+ * @return 是否支持画中画
38
+ * @order 3
39
+ */
40
+ /**
41
+ * {en}
42
+ * @brief Check if picture in picture is supported
43
+ * @return Whether picture in picture is supported
44
+ * @order 3
45
+ */
46
+ isPictureInPictureSupported(): boolean;
47
+ /**
48
+ * {zh}
49
+ * @brief 设置画中画监听器
50
+ * @param listener 画中画监听器
51
+ * @order 4
52
+ */
53
+ /**
54
+ * {en}
55
+ * @brief Set picture in picture listener
56
+ * @param listener picture in picture listener
57
+ * @order 4
58
+ */
59
+ setPictureInPictureListener(listener: PictureInPictureManagerListener): void;
60
+ /**
61
+ * {zh}
62
+ * @brief 启用画中画,当切出app后,会自动启动画中画
63
+ * @platform ios only
64
+ * @order 5
65
+ */
66
+ /**
67
+ * {en}
68
+ * @brief Enable picture in picture, when the app is switched out, the picture in picture will be automatically started
69
+ * @platform ios only
70
+ * @order 5
71
+ */
72
+ enablePictureInPicture(): Promise<void>;
73
+ /**
74
+ * {zh}
75
+ * @brief 禁用画中画
76
+ * @platform ios only
77
+ * @order 6
78
+ */
79
+ /**
80
+ * {en}
81
+ * @brief Disable picture in picture, when the app is switched out, the picture in picture does not automatically start
82
+ * @platform ios only
83
+ * @order 6
84
+ */
85
+ disablePictureInPicture(): Promise<void>;
86
+ }
87
+ }
88
+ export { VeLivePlayer };