stormcloud-video-player 0.4.0 → 0.4.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.
package/lib/index.d.cts CHANGED
@@ -50,6 +50,7 @@ interface AdController {
50
50
  getAdVolume: () => number;
51
51
  showPlaceholder: () => void;
52
52
  hidePlaceholder: () => void;
53
+ setAllowNativeHls: (allowNativeHls: boolean) => void;
53
54
  }
54
55
  interface AdControllerOptions {
55
56
  maxRetries?: number;
package/lib/index.d.ts CHANGED
@@ -50,6 +50,7 @@ interface AdController {
50
50
  getAdVolume: () => number;
51
51
  showPlaceholder: () => void;
52
52
  hidePlaceholder: () => void;
53
+ setAllowNativeHls: (allowNativeHls: boolean) => void;
53
54
  }
54
55
  interface AdControllerOptions {
55
56
  maxRetries?: number;
package/lib/index.js CHANGED
@@ -403,6 +403,7 @@ function createAdStormPlayer(contentVideo, options) {
403
403
  var adContainerEl;
404
404
  var currentAd;
405
405
  var destroyed = false;
406
+ var allowNativeHls = false;
406
407
  var trackingFired = {
407
408
  impression: false,
408
409
  start: false,
@@ -860,7 +861,9 @@ function createAdStormPlayer(contentVideo, options) {
860
861
  }, 300);
861
862
  contentVideo.muted = true;
862
863
  contentVideo.volume = 0;
863
- contentVideo.pause();
864
+ if (allowNativeHls) {
865
+ contentVideo.pause();
866
+ }
864
867
  adPlaying = true;
865
868
  setAdPlayingFlag(true);
866
869
  if (adVideoElement) {
@@ -1036,6 +1039,10 @@ function createAdStormPlayer(contentVideo, options) {
1036
1039
  }
1037
1040
  }, 300);
1038
1041
  }
1042
+ },
1043
+ setAllowNativeHls: function setAllowNativeHls(value) {
1044
+ allowNativeHls = value;
1045
+ log("allowNativeHls set to: ".concat(value));
1039
1046
  }
1040
1047
  };
1041
1048
  }
@@ -1494,6 +1501,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
1494
1501
  });
1495
1502
  }
1496
1503
  this.adPlayer.initialize();
1504
+ this.adPlayer.setAllowNativeHls(!!this.config.allowNativeHls);
1497
1505
  if (!this.config.autoplay) return [
1498
1506
  3,
1499
1507
  2
@@ -1548,6 +1556,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
1548
1556
  });
1549
1557
  }
1550
1558
  this.adPlayer.initialize();
1559
+ this.adPlayer.setAllowNativeHls(!!this.config.allowNativeHls);
1551
1560
  this.bufferedSegmentsCount = 0;
1552
1561
  this.hasInitialBufferCompleted = false;
1553
1562
  this.shouldAutoplayAfterBuffering = !!this.config.autoplay;
@@ -5372,6 +5381,7 @@ function createHlsAdPlayer(contentVideo, options) {
5372
5381
  var adPlaying = false;
5373
5382
  var originalMutedState = false;
5374
5383
  var originalVolume = Math.max(0, Math.min(1, contentVideo.volume || 1));
5384
+ var allowNativeHls = false;
5375
5385
  var listeners = /* @__PURE__ */ new Map();
5376
5386
  var licenseKey = options === null || options === void 0 ? void 0 : options.licenseKey;
5377
5387
  var mainHlsInstance = options === null || options === void 0 ? void 0 : options.mainHlsInstance;
@@ -6139,6 +6149,9 @@ function createHlsAdPlayer(contentVideo, options) {
6139
6149
  adContainerEl.style.display = "none";
6140
6150
  adContainerEl.style.pointerEvents = "none";
6141
6151
  }
6152
+ },
6153
+ setAllowNativeHls: function setAllowNativeHls(value) {
6154
+ allowNativeHls = value;
6142
6155
  }
6143
6156
  };
6144
6157
  }