stormcloud-video-player 0.8.51 → 0.8.53

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.
@@ -1,4 +1,4 @@
1
- import { a as Scte35Marker, S as StormcloudVideoPlayerConfig, A as AdController } from '../types-iDjS8f_7.cjs';
1
+ import { S as Scte35Marker, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-cTqIKw_D.cjs';
2
2
  import { AdTimingService } from './AdTimingService.cjs';
3
3
  import { AdConfigManager } from './AdConfigManager.cjs';
4
4
  import { Scte35CueManager } from './Scte35CueManager.cjs';
@@ -1,4 +1,4 @@
1
- import { b as AdBreak, S as StormcloudVideoPlayerConfig, A as AdController } from '../types-iDjS8f_7.cjs';
1
+ import { b as AdBreak, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-cTqIKw_D.cjs';
2
2
  import { PalNonceManager } from '../sdk/pal.cjs';
3
3
  import { VastConsentSignals } from '../utils/vastMacros.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as StormcloudVideoPlayerConfig, a as Scte35Marker, A as AdController } from '../types-iDjS8f_7.cjs';
1
+ import { a as StormcloudVideoPlayerConfig, S as Scte35Marker, A as AdController } from '../types-cTqIKw_D.cjs';
2
2
 
3
3
  interface AdTimingCallbacks {
4
4
  onAdStopTimerFired(): void;
@@ -1,5 +1,5 @@
1
1
  import Hls from 'hls.js';
2
- import { S as StormcloudVideoPlayerConfig, a as Scte35Marker } from '../types-iDjS8f_7.cjs';
2
+ import { a as StormcloudVideoPlayerConfig, S as Scte35Marker } from '../types-cTqIKw_D.cjs';
3
3
  import { Scte35CueContext } from './playerTypes.cjs';
4
4
  import { Scte35CueManager } from './Scte35CueManager.cjs';
5
5
  import { AdTimingService } from './AdTimingService.cjs';
@@ -1,4 +1,4 @@
1
- import { A as AdController } from '../types-iDjS8f_7.cjs';
1
+ import { A as AdController } from '../types-cTqIKw_D.cjs';
2
2
 
3
3
  declare function getAdAudioVolume(adPlayer: AdController): number;
4
4
  declare function toggleMute(video: HTMLVideoElement, adPlayer: AdController, debug: boolean): void;
@@ -1,4 +1,4 @@
1
- import { a as Scte35Marker } from '../types-iDjS8f_7.cjs';
1
+ import { S as Scte35Marker } from '../types-cTqIKw_D.cjs';
2
2
  import { Scte35CueSource, Scte35CueReadiness, Scte35CueContext } from './playerTypes.cjs';
3
3
 
4
4
  interface Scte35CueManagerCallbacks {
@@ -1,4 +1,4 @@
1
- import { a as Scte35Marker, I as Id3TagInfo } from '../types-iDjS8f_7.cjs';
1
+ import { S as Scte35Marker, I as Id3TagInfo } from '../types-cTqIKw_D.cjs';
2
2
 
3
3
  declare function parseCueOutDuration(value: string): number | undefined;
4
4
  declare function parseCueOutCont(value: string): {
@@ -534,6 +534,7 @@ function createHlsAdPlayer(contentVideo, options) {
534
534
  var AD_CONTAINER_PROP = "__stormcloudAdContainer";
535
535
  var AD_VIDEO_PROP = "__stormcloudAdVideo";
536
536
  var FRAME_COUNTER_RELIABLE_PROP = "__stormcloudFrameCounterReliable";
537
+ var RVFC_RELIABLE_PROP = "__stormcloudRvfcReliable";
537
538
  var adVideoElement = (_contentVideo_AD_VIDEO_PROP = contentVideo[AD_VIDEO_PROP]) !== null && _contentVideo_AD_VIDEO_PROP !== void 0 ? _contentVideo_AD_VIDEO_PROP : void 0;
538
539
  var adHls;
539
540
  var adContainerEl = (_contentVideo_AD_CONTAINER_PROP = contentVideo[AD_CONTAINER_PROP]) !== null && _contentVideo_AD_CONTAINER_PROP !== void 0 ? _contentVideo_AD_CONTAINER_PROP : void 0;
@@ -1034,7 +1035,7 @@ function createHlsAdPlayer(contentVideo, options) {
1034
1035
  }
1035
1036
  function fetchAndParsePod(vastTagUrl) {
1036
1037
  return _async_to_generator(function() {
1037
- var vastXml, parser, xmlDoc, adElements, ads, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, adElement, parsed, resolved, error, err;
1038
+ var vastXml, trimmedXml, parser, xmlDoc, adElements, ads, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, adElement, parsed, resolved, error, err;
1038
1039
  return _ts_generator(this, function(_state) {
1039
1040
  switch(_state.label){
1040
1041
  case 0:
@@ -1044,11 +1045,19 @@ function createHlsAdPlayer(contentVideo, options) {
1044
1045
  ];
1045
1046
  case 1:
1046
1047
  vastXml = _state.sent();
1047
- console.log("[HlsAdPlayer] Pod VAST XML received");
1048
+ console.log("[HlsAdPlayer] Pod VAST XML received (length=".concat(vastXml.length, ")"));
1049
+ trimmedXml = vastXml.trim();
1050
+ if (trimmedXml.length === 0) {
1051
+ console.warn("[HlsAdPlayer] Pod VAST response body is empty (no fill)");
1052
+ return [
1053
+ 2,
1054
+ []
1055
+ ];
1056
+ }
1048
1057
  parser = new DOMParser();
1049
1058
  xmlDoc = parser.parseFromString(vastXml, "text/xml");
1050
1059
  if (xmlDoc.querySelector("parsererror")) {
1051
- console.error("[HlsAdPlayer] Pod VAST XML parsing error (malformed)");
1060
+ console.error("[HlsAdPlayer] Pod VAST XML parsing error (malformed). Content (first 2000 chars):", vastXml.substring(0, 2e3));
1052
1061
  return [
1053
1062
  2,
1054
1063
  []
@@ -1056,7 +1065,7 @@ function createHlsAdPlayer(contentVideo, options) {
1056
1065
  }
1057
1066
  adElements = Array.from(xmlDoc.querySelectorAll("Ad"));
1058
1067
  if (adElements.length === 0) {
1059
- console.warn("[HlsAdPlayer] No <Ad> elements found in pod VAST response");
1068
+ console.warn("[HlsAdPlayer] No <Ad> elements found in pod VAST response (no fill). Content (first 2000 chars):", vastXml.substring(0, 2e3));
1060
1069
  return [
1061
1070
  2,
1062
1071
  []
@@ -1535,6 +1544,12 @@ function createHlsAdPlayer(contentVideo, options) {
1535
1544
  function markFrameCounterReliable() {
1536
1545
  contentVideo[FRAME_COUNTER_RELIABLE_PROP] = true;
1537
1546
  }
1547
+ function isRvfcReliable() {
1548
+ return contentVideo[RVFC_RELIABLE_PROP] === true;
1549
+ }
1550
+ function markRvfcReliable() {
1551
+ contentVideo[RVFC_RELIABLE_PROP] = true;
1552
+ }
1538
1553
  function cancelVideoFrameProbe() {
1539
1554
  if (videoFrameCallbackHandle != null && adVideoElement && typeof adVideoElement.cancelVideoFrameCallback === "function") {
1540
1555
  try {
@@ -1554,6 +1569,7 @@ function createHlsAdPlayer(contentVideo, options) {
1554
1569
  videoFrameCallbackHandle = void 0;
1555
1570
  if (!adPlaying) return;
1556
1571
  sawDecodedVideoFrame = true;
1572
+ markRvfcReliable();
1557
1573
  };
1558
1574
  try {
1559
1575
  videoFrameCallbackHandle = rvfc.call(adVideoElement, onPresentedFrame);
@@ -1578,18 +1594,19 @@ function createHlsAdPlayer(contentVideo, options) {
1578
1594
  noteAdProgress();
1579
1595
  sawDecodedVideoFrame = false;
1580
1596
  startVideoFrameProbe();
1597
+ var blackFrameDetectionEnabled = !requiresMediaPipelineResetAfterAds();
1581
1598
  stallWatchdogId = window.setInterval(function() {
1582
1599
  if (!adPlaying || !adVideoElement) {
1583
1600
  return;
1584
1601
  }
1585
- if (!sawDecodedVideoFrame && !adVideoElement.paused) {
1602
+ if (blackFrameDetectionEnabled && !sawDecodedVideoFrame && !adVideoElement.paused) {
1586
1603
  var decodedFrames = getDecodedVideoFrameCount(adVideoElement);
1587
1604
  if (decodedFrames !== void 0 && decodedFrames > 0) {
1588
1605
  sawDecodedVideoFrame = true;
1589
1606
  markFrameCounterReliable();
1590
1607
  } else if (adVideoElement.currentTime >= BLACKFRAME_MIN_PLAYBACK_S) {
1591
1608
  var timeAdvancing = adVideoElement.currentTime > lastAdProgressPosition + 0.05;
1592
- if (isRvfcSupported(adVideoElement) && timeAdvancing) {
1609
+ if (isRvfcSupported(adVideoElement) && timeAdvancing && isRvfcReliable()) {
1593
1610
  handleVideoDecodeFailure();
1594
1611
  return;
1595
1612
  }
@@ -1990,7 +2007,7 @@ function createHlsAdPlayer(contentVideo, options) {
1990
2007
  }
1991
2008
  },
1992
2009
  hidePlaceholder: function hidePlaceholder() {
1993
- if (adContainerEl) {
2010
+ if (adContainerEl && !adPlaying) {
1994
2011
  adContainerEl.style.display = "none";
1995
2012
  adContainerEl.style.pointerEvents = "none";
1996
2013
  }