@byteplus/veplayer-plugin 2.8.2 → 2.9.0-rc.1

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.
@@ -5640,6 +5640,12 @@ var ImaAdManager = /* @__PURE__ */ function(_BaseAdManager) {
5640
5640
  break;
5641
5641
  }
5642
5642
  case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED: {
5643
+ if (_this._resumeCallback) {
5644
+ var _this$_resumeCallback = _this._resumeCallback(), canResume = _this$_resumeCallback.canResume;
5645
+ if (!canResume) {
5646
+ break;
5647
+ }
5648
+ }
5643
5649
  _this._resumeContent();
5644
5650
  _this.emit(IMA_CONTENT_RESUME_REQUESTED, {
5645
5651
  ad
@@ -5741,6 +5747,7 @@ var ImaAdManager = /* @__PURE__ */ function(_BaseAdManager) {
5741
5747
  _this.displayContainer = null;
5742
5748
  _this.adsLoader = null;
5743
5749
  _this.adsManager = null;
5750
+ _this._resumeCallback = null;
5744
5751
  return _this;
5745
5752
  }
5746
5753
  _createClass$2(ImaAdManager2, [{
@@ -5789,9 +5796,15 @@ var ImaAdManager = /* @__PURE__ */ function(_BaseAdManager) {
5789
5796
  value: function destroy() {
5790
5797
  _get$1(_getPrototypeOf$1(ImaAdManager2.prototype), "destroy", this).call(this);
5791
5798
  this.reset();
5799
+ this.displayContainer.destroy();
5792
5800
  this._removeMediaEvents();
5793
5801
  this._destroyLoader();
5794
5802
  }
5803
+ }, {
5804
+ key: "resumeCallback",
5805
+ set: function set(resumeCallbackFunc) {
5806
+ this._resumeCallback = resumeCallbackFunc;
5807
+ }
5795
5808
  }, {
5796
5809
  key: "_initConfig",
5797
5810
  value: function _initConfig() {
@@ -6499,7 +6512,7 @@ var AdsPlugin$1 = /* @__PURE__ */ function(_Plugin) {
6499
6512
  _createClass$2(AdsPlugin2, [{
6500
6513
  key: "version",
6501
6514
  get: function get() {
6502
- return "3.0.23-rc.1";
6515
+ return "3.0.23-rc.5";
6503
6516
  }
6504
6517
  }, {
6505
6518
  key: "paused",
@@ -6561,37 +6574,55 @@ var AdsPlugin$1 = /* @__PURE__ */ function(_Plugin) {
6561
6574
  }
6562
6575
  }, {
6563
6576
  key: "_initImaAd",
6564
- value: function _initImaAd() {
6565
- var _this = this;
6566
- this.csManager = new ImaAdManager({
6567
- plugin: this,
6568
- config: this.config.ima,
6569
- displayContainer: this.root
6570
- });
6571
- this.csManager.once(IMA_SDK_LOAD_START, function() {
6572
- _this.uiManager.showAdContainer();
6573
- });
6574
- this.csManager.on(IMA_SDK_LOAD_ERROR, function() {
6575
- _this.uiManager.hideAdContainer();
6576
- });
6577
- this.csManager.once(IMA_AD_LOADED, function(_ref) {
6578
- var isPreroll = _ref.isPreroll;
6579
- if (!isPreroll) {
6580
- _this.uiManager.hideAdContainer();
6581
- }
6582
- });
6583
- this.csManager.once(IMA_READY_TO_PLAY, function() {
6584
- var _this$initPromise;
6585
- (_this$initPromise = _this.initPromise) === null || _this$initPromise === void 0 ? void 0 : _this$initPromise.resolve();
6586
- });
6587
- this.csManager.on(IMA_CONTENT_PAUSE_REQUESTED, function() {
6588
- _this.uiManager.showAdUI();
6589
- });
6590
- this.csManager.on(IMA_CONTENT_RESUME_REQUESTED, function() {
6591
- _this.uiManager.hideAdUI();
6592
- });
6593
- this.csManager.init();
6594
- }
6577
+ value: function() {
6578
+ var _initImaAd2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee() {
6579
+ var _this = this;
6580
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
6581
+ while (1)
6582
+ switch (_context.prev = _context.next) {
6583
+ case 0:
6584
+ this.csManager = new ImaAdManager({
6585
+ plugin: this,
6586
+ config: this.config.ima,
6587
+ displayContainer: this.root
6588
+ });
6589
+ this.csManager.once(IMA_SDK_LOAD_START, function() {
6590
+ _this.uiManager.showAdContainer();
6591
+ });
6592
+ this.csManager.on(IMA_SDK_LOAD_ERROR, function() {
6593
+ _this.uiManager.hideAdContainer();
6594
+ });
6595
+ this.csManager.once(IMA_AD_LOADED, function(_ref) {
6596
+ var isPreroll = _ref.isPreroll;
6597
+ if (!isPreroll) {
6598
+ _this.uiManager.hideAdContainer();
6599
+ }
6600
+ });
6601
+ this.csManager.once(IMA_READY_TO_PLAY, function() {
6602
+ var _this$initPromise;
6603
+ (_this$initPromise = _this.initPromise) === null || _this$initPromise === void 0 ? void 0 : _this$initPromise.resolve();
6604
+ });
6605
+ this.csManager.on(IMA_CONTENT_PAUSE_REQUESTED, function() {
6606
+ _this.uiManager.showAdUI();
6607
+ });
6608
+ this.csManager.on(IMA_CONTENT_RESUME_REQUESTED, function() {
6609
+ _this.uiManager.hideAdUI();
6610
+ });
6611
+ _context.next = 9;
6612
+ return this.csManager.init();
6613
+ case 9:
6614
+ return _context.abrupt("return", this.csManager);
6615
+ case 10:
6616
+ case "end":
6617
+ return _context.stop();
6618
+ }
6619
+ }, _callee, this);
6620
+ }));
6621
+ function _initImaAd() {
6622
+ return _initImaAd2.apply(this, arguments);
6623
+ }
6624
+ return _initImaAd;
6625
+ }()
6595
6626
  }, {
6596
6627
  key: "requestAds",
6597
6628
  value: function requestAds() {