@mottosports/motto-video-player 1.0.1-rc.72 → 1.0.1-rc.74

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/dist/index.mjs CHANGED
@@ -1204,7 +1204,7 @@ var supportsWidevinePersistentLicenses = () => {
1204
1204
  import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
1205
1205
 
1206
1206
  // package.json
1207
- var version = "1.0.1-rc.72";
1207
+ var version = "1.0.1-rc.74";
1208
1208
 
1209
1209
  // src/utils/licenseCache.ts
1210
1210
  var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
@@ -1368,7 +1368,8 @@ var useShakaPlayer = ({
1368
1368
  onMuxDataUpdate,
1369
1369
  publicKey,
1370
1370
  mottoToken,
1371
- hasAds = false
1371
+ hasAds = false,
1372
+ hasSystem73 = false
1372
1373
  }) => {
1373
1374
  const playerRef = useRef(null);
1374
1375
  const [isRetrying, setIsRetrying] = useState(false);
@@ -1673,7 +1674,7 @@ var useShakaPlayer = ({
1673
1674
  if (playerRef.current === player) playerRef.current = null;
1674
1675
  return;
1675
1676
  }
1676
- if (!hasAds) {
1677
+ if (!hasAds && !hasSystem73) {
1677
1678
  await player.load(manifestUrl);
1678
1679
  }
1679
1680
  onPlayerReady?.(player);
@@ -4093,7 +4094,8 @@ var Player = forwardRef(
4093
4094
  onMuxDataUpdate: events?.onMuxDataUpdate,
4094
4095
  publicKey,
4095
4096
  mottoToken: auth?.mottoToken,
4096
- hasAds: !!imaConfig?.adTagUrl
4097
+ hasAds: !!imaConfig?.adTagUrl,
4098
+ hasSystem73: !!system73Config?.apiKey
4097
4099
  });
4098
4100
  const {
4099
4101
  initializeMux,
@@ -4165,7 +4167,6 @@ var Player = forwardRef(
4165
4167
  if (!system73Config?.apiKey || !window.S73ShakaPlayerWrapper) {
4166
4168
  return null;
4167
4169
  }
4168
- console.log("Initializing System73 SDK...");
4169
4170
  try {
4170
4171
  const s73Config = {
4171
4172
  apiKey: system73Config.apiKey,
@@ -4174,7 +4175,6 @@ var Player = forwardRef(
4174
4175
  };
4175
4176
  const wrapper = window.S73ShakaPlayerWrapper(s73Config, { shaka: shaka3 });
4176
4177
  wrapper.wrapPlayerConfig(playerConfig);
4177
- console.log("System73 SDK initialized with config:", s73Config);
4178
4178
  return wrapper;
4179
4179
  } catch (error) {
4180
4180
  console.error("Error initializing System73 SDK:", error);
@@ -4213,7 +4213,7 @@ var Player = forwardRef(
4213
4213
  adsRequest.adTagUrl = imaConfig.adTagUrl;
4214
4214
  adManager.requestClientSideAds(adsRequest);
4215
4215
  setupAdEventListeners();
4216
- await new Promise((resolve) => setTimeout(resolve, 1e4));
4216
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
4217
4217
  await loadManifest();
4218
4218
  } catch (error) {
4219
4219
  console.error("Error initializing ads:", error);
@@ -4268,7 +4268,9 @@ var Player = forwardRef(
4268
4268
  await initializePlayer(video);
4269
4269
  if (system73Wrapper && playerRef.current) {
4270
4270
  system73Wrapper.wrapPlayer(playerRef.current);
4271
- console.log("System73 player wrapper applied");
4271
+ if (!imaConfig?.adTagUrl) {
4272
+ await loadManifest();
4273
+ }
4272
4274
  }
4273
4275
  setupEventListeners();
4274
4276
  const cleanupQuality = setupQualityTracking();
@@ -5116,6 +5118,7 @@ var Event = ({
5116
5118
  }
5117
5119
  if (activePlaylist && activeVideoId && videosData) {
5118
5120
  const activeVideo = videosData.find((video) => video.id === activeVideoId);
5121
+ console.log("activeVideo?.ad?.adTagUrl", activeVideo?.ad?.adTagUrl);
5119
5122
  return /* @__PURE__ */ jsxs8("div", { className: twMerge4("", className), children: [
5120
5123
  /* @__PURE__ */ jsx10("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx10(
5121
5124
  Player,
@@ -5129,7 +5132,7 @@ var Event = ({
5129
5132
  containerClassName: "w-full h-full",
5130
5133
  publicKey,
5131
5134
  auth,
5132
- ...adsEnabled && activeVideo?.ad?.adTagUrl ? { imaConfig: { adTagUrl: activeVideo?.ad?.adTagUrl } } : {}
5135
+ ...adsEnabled && activeVideo ? { imaConfig: { adTagUrl: activeVideo?.ad?.adTagUrl } } : {}
5133
5136
  }
5134
5137
  ) }),
5135
5138
  !hideTitle && eventData && /* @__PURE__ */ jsx10(