stormcloud-video-player 0.8.30 → 0.8.32

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,5 +1,5 @@
1
1
  import { Component } from 'react';
2
- import { a as StormcloudVideoPlayerConfig } from '../types-CSHvCbhZ.cjs';
2
+ import { S as StormcloudVideoPlayerConfig } from '../types-e6QV7SBp.cjs';
3
3
 
4
4
  interface HlsPlayerProps extends StormcloudVideoPlayerConfig {
5
5
  onMount?: (player: any) => void;
@@ -812,24 +812,65 @@ function createHlsAdPlayer(contentVideo, options) {
812
812
  }
813
813
  }
814
814
  function fetchVastXml(vastTagUrl) {
815
+ var credentials = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "include";
815
816
  return _async_to_generator(function() {
816
- var response;
817
+ var requestVast, response, error;
817
818
  return _ts_generator(this, function(_state) {
818
819
  switch(_state.label){
819
820
  case 0:
820
- return [
821
- 4,
822
- fetch(vastTagUrl, {
821
+ requestVast = function requestVast(creds) {
822
+ return fetch(vastTagUrl, {
823
823
  mode: "cors",
824
- credentials: "include",
824
+ credentials: creds,
825
825
  headers: {
826
826
  "Accept": "application/xml, text/xml, */*"
827
827
  },
828
828
  referrerPolicy: "no-referrer-when-downgrade"
829
- })
830
- ];
829
+ });
830
+ };
831
+ _state.label = 1;
831
832
  case 1:
833
+ _state.trys.push([
834
+ 1,
835
+ 3,
836
+ ,
837
+ 7
838
+ ]);
839
+ return [
840
+ 4,
841
+ requestVast(credentials)
842
+ ];
843
+ case 2:
844
+ response = _state.sent();
845
+ return [
846
+ 3,
847
+ 7
848
+ ];
849
+ case 3:
850
+ error = _state.sent();
851
+ if (!(credentials !== "omit")) return [
852
+ 3,
853
+ 5
854
+ ];
855
+ console.warn('[HlsAdPlayer] VAST fetch failed with credentials="'.concat(credentials, '", retrying without credentials:'), error);
856
+ return [
857
+ 4,
858
+ requestVast("omit")
859
+ ];
860
+ case 4:
832
861
  response = _state.sent();
862
+ return [
863
+ 3,
864
+ 6
865
+ ];
866
+ case 5:
867
+ throw error;
868
+ case 6:
869
+ return [
870
+ 3,
871
+ 7
872
+ ];
873
+ case 7:
833
874
  if (!response.ok) {
834
875
  throw new Error("Failed to fetch VAST: ".concat(response.statusText));
835
876
  }
@@ -851,7 +892,7 @@ function createHlsAdPlayer(contentVideo, options) {
851
892
  depth = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : 0, accumulatedTracking = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : createEmptyTrackingUrls();
852
893
  return [
853
894
  4,
854
- fetchVastXml(vastTagUrl)
895
+ fetchVastXml(vastTagUrl, depth === 0 ? "include" : "omit")
855
896
  ];
856
897
  case 1:
857
898
  vastXml = _state.sent();
@@ -1704,6 +1745,22 @@ function createPalNonceManager() {
1704
1745
  request.videoHeight = options.videoHeight || 480;
1705
1746
  if (options.ppid) request.ppid = options.ppid;
1706
1747
  if (options.sessionId) request.sessionId = options.sessionId;
1748
+ console.log("[PAL] NonceRequest before generateNonce:", {
1749
+ adWillAutoPlay: request.adWillAutoPlay,
1750
+ adWillPlayMuted: request.adWillPlayMuted,
1751
+ playerVolume: request.playerVolume,
1752
+ continuousPlayback: request.continuousPlayback,
1753
+ descriptionUrl: request.descriptionUrl,
1754
+ iconsSupported: request.iconsSupported,
1755
+ playerType: request.playerType,
1756
+ playerVersion: request.playerVersion,
1757
+ supportedApiFrameworks: request.supportedApiFrameworks,
1758
+ url: request.url,
1759
+ videoWidth: request.videoWidth,
1760
+ videoHeight: request.videoHeight,
1761
+ ppid: request.ppid,
1762
+ sessionId: request.sessionId
1763
+ });
1707
1764
  return [
1708
1765
  4,
1709
1766
  loader.loadNonceManager(request)