stormcloud-video-player 0.8.51 → 0.8.52

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;
@@ -1535,6 +1536,12 @@ function createHlsAdPlayer(contentVideo, options) {
1535
1536
  function markFrameCounterReliable() {
1536
1537
  contentVideo[FRAME_COUNTER_RELIABLE_PROP] = true;
1537
1538
  }
1539
+ function isRvfcReliable() {
1540
+ return contentVideo[RVFC_RELIABLE_PROP] === true;
1541
+ }
1542
+ function markRvfcReliable() {
1543
+ contentVideo[RVFC_RELIABLE_PROP] = true;
1544
+ }
1538
1545
  function cancelVideoFrameProbe() {
1539
1546
  if (videoFrameCallbackHandle != null && adVideoElement && typeof adVideoElement.cancelVideoFrameCallback === "function") {
1540
1547
  try {
@@ -1554,6 +1561,7 @@ function createHlsAdPlayer(contentVideo, options) {
1554
1561
  videoFrameCallbackHandle = void 0;
1555
1562
  if (!adPlaying) return;
1556
1563
  sawDecodedVideoFrame = true;
1564
+ markRvfcReliable();
1557
1565
  };
1558
1566
  try {
1559
1567
  videoFrameCallbackHandle = rvfc.call(adVideoElement, onPresentedFrame);
@@ -1578,18 +1586,19 @@ function createHlsAdPlayer(contentVideo, options) {
1578
1586
  noteAdProgress();
1579
1587
  sawDecodedVideoFrame = false;
1580
1588
  startVideoFrameProbe();
1589
+ var blackFrameDetectionEnabled = !requiresMediaPipelineResetAfterAds();
1581
1590
  stallWatchdogId = window.setInterval(function() {
1582
1591
  if (!adPlaying || !adVideoElement) {
1583
1592
  return;
1584
1593
  }
1585
- if (!sawDecodedVideoFrame && !adVideoElement.paused) {
1594
+ if (blackFrameDetectionEnabled && !sawDecodedVideoFrame && !adVideoElement.paused) {
1586
1595
  var decodedFrames = getDecodedVideoFrameCount(adVideoElement);
1587
1596
  if (decodedFrames !== void 0 && decodedFrames > 0) {
1588
1597
  sawDecodedVideoFrame = true;
1589
1598
  markFrameCounterReliable();
1590
1599
  } else if (adVideoElement.currentTime >= BLACKFRAME_MIN_PLAYBACK_S) {
1591
1600
  var timeAdvancing = adVideoElement.currentTime > lastAdProgressPosition + 0.05;
1592
- if (isRvfcSupported(adVideoElement) && timeAdvancing) {
1601
+ if (isRvfcSupported(adVideoElement) && timeAdvancing && isRvfcReliable()) {
1593
1602
  handleVideoDecodeFailure();
1594
1603
  return;
1595
1604
  }
@@ -1990,7 +1999,7 @@ function createHlsAdPlayer(contentVideo, options) {
1990
1999
  }
1991
2000
  },
1992
2001
  hidePlaceholder: function hidePlaceholder() {
1993
- if (adContainerEl) {
2002
+ if (adContainerEl && !adPlaying) {
1994
2003
  adContainerEl.style.display = "none";
1995
2004
  adContainerEl.style.pointerEvents = "none";
1996
2005
  }