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

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
@@ -1148,7 +1148,7 @@ html[dir=rtl] .shaka-overflow-menu .shaka-overflow-button .material-svg-icon:fir
1148
1148
  `);
1149
1149
 
1150
1150
  // src/Player.tsx
1151
- import { forwardRef, useEffect as useEffect5, useRef as useRef8, useImperativeHandle, useCallback as useCallback8, useState as useState4 } from "react";
1151
+ import { forwardRef, useEffect as useEffect5, useRef as useRef9, useImperativeHandle, useCallback as useCallback9, useState as useState4 } from "react";
1152
1152
  import shaka3 from "shaka-player/dist/shaka-player.ui";
1153
1153
 
1154
1154
  // src/hooks/useShakaPlayer.ts
@@ -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.70";
1207
+ var version = "1.0.1-rc.72";
1208
1208
 
1209
1209
  // src/utils/licenseCache.ts
1210
1210
  var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
@@ -1367,7 +1367,8 @@ var useShakaPlayer = ({
1367
1367
  onMuxReady,
1368
1368
  onMuxDataUpdate,
1369
1369
  publicKey,
1370
- mottoToken
1370
+ mottoToken,
1371
+ hasAds = false
1371
1372
  }) => {
1372
1373
  const playerRef = useRef(null);
1373
1374
  const [isRetrying, setIsRetrying] = useState(false);
@@ -1672,7 +1673,9 @@ var useShakaPlayer = ({
1672
1673
  if (playerRef.current === player) playerRef.current = null;
1673
1674
  return;
1674
1675
  }
1675
- await player.load(manifestUrl);
1676
+ if (!hasAds) {
1677
+ await player.load(manifestUrl);
1678
+ }
1676
1679
  onPlayerReady?.(player);
1677
1680
  return player;
1678
1681
  } catch (error) {
@@ -1687,6 +1690,24 @@ var useShakaPlayer = ({
1687
1690
  const initializePlayer = useCallback(async (video) => {
1688
1691
  return initializePlayerInternal(video);
1689
1692
  }, [initializePlayerInternal]);
1693
+ const loadManifest = useCallback(async () => {
1694
+ const player = playerRef.current;
1695
+ if (!player) {
1696
+ console.warn("Cannot load manifest: player not initialized");
1697
+ return;
1698
+ }
1699
+ try {
1700
+ const manifestUrl = getManifestUrl();
1701
+ await player.load(manifestUrl);
1702
+ } catch (error) {
1703
+ if (error?.code === 7e3) {
1704
+ return;
1705
+ }
1706
+ console.error("Error loading manifest:", error);
1707
+ onError?.(error);
1708
+ throw error;
1709
+ }
1710
+ }, [getManifestUrl, onError]);
1690
1711
  const destroyPlayer = useCallback(async () => {
1691
1712
  const playerInstance = playerRef.current;
1692
1713
  if (playerInstance) {
@@ -1750,6 +1771,7 @@ var useShakaPlayer = ({
1750
1771
  return {
1751
1772
  playerRef,
1752
1773
  initializePlayer,
1774
+ loadManifest,
1753
1775
  destroyPlayer,
1754
1776
  isRetrying
1755
1777
  };
@@ -2568,6 +2590,149 @@ var useKeyboardControls = (videoRef, options = {}) => {
2568
2590
  };
2569
2591
  };
2570
2592
 
2593
+ // src/hooks/useAdEvents.ts
2594
+ import { useCallback as useCallback8, useRef as useRef8 } from "react";
2595
+ var useAdEvents = (playerRef, handlers) => {
2596
+ const listenersRef = useRef8([]);
2597
+ const setupAdEventListeners = useCallback8(() => {
2598
+ const player = playerRef.current;
2599
+ if (!player) return;
2600
+ const adManager = player.getAdManager();
2601
+ if (!adManager) return;
2602
+ const onAdsManagerLoaded = (event) => {
2603
+ const adsManager = event.getAdsManager();
2604
+ const onAdStarted = () => {
2605
+ console.log("Ad started");
2606
+ handlers.onAdStart?.();
2607
+ };
2608
+ const onAdComplete = () => {
2609
+ console.log("Ad completed");
2610
+ handlers.onAdComplete?.();
2611
+ };
2612
+ const onAdError = (adErrorEvent) => {
2613
+ console.error("Ad error:", adErrorEvent.getError());
2614
+ handlers.onAdError?.(adErrorEvent.getError());
2615
+ };
2616
+ const onAdSkipped = () => {
2617
+ console.log("Ad skipped");
2618
+ handlers.onAdSkipped?.();
2619
+ };
2620
+ const onAdPaused = () => {
2621
+ console.log("Ad paused");
2622
+ handlers.onAdPaused?.();
2623
+ };
2624
+ const onAdResumed = () => {
2625
+ console.log("Ad resumed");
2626
+ handlers.onAdResumed?.();
2627
+ };
2628
+ const onAdProgress = (adProgressData) => {
2629
+ handlers.onAdProgress?.(adProgressData);
2630
+ };
2631
+ const onAllAdsCompleted = () => {
2632
+ console.log("All ads completed");
2633
+ handlers.onAllAdsCompleted?.();
2634
+ };
2635
+ const adEventListeners = [];
2636
+ if (window.google?.ima) {
2637
+ const AdEvent = window.google.ima.AdEvent.Type;
2638
+ const AdErrorEvent = window.google.ima.AdErrorEvent.Type;
2639
+ if (handlers.onAdStart) {
2640
+ adsManager.addEventListener(AdEvent.STARTED, onAdStarted);
2641
+ adEventListeners.push({ event: AdEvent.STARTED, listener: onAdStarted });
2642
+ }
2643
+ if (handlers.onAdComplete) {
2644
+ adsManager.addEventListener(AdEvent.COMPLETE, onAdComplete);
2645
+ adEventListeners.push({ event: AdEvent.COMPLETE, listener: onAdComplete });
2646
+ }
2647
+ if (handlers.onAdError) {
2648
+ adsManager.addEventListener(AdErrorEvent.AD_ERROR, onAdError);
2649
+ adEventListeners.push({ event: AdErrorEvent.AD_ERROR, listener: onAdError });
2650
+ }
2651
+ if (handlers.onAdSkipped) {
2652
+ adsManager.addEventListener(AdEvent.SKIPPED, onAdSkipped);
2653
+ adEventListeners.push({ event: AdEvent.SKIPPED, listener: onAdSkipped });
2654
+ }
2655
+ if (handlers.onAdPaused) {
2656
+ adsManager.addEventListener(AdEvent.PAUSED, onAdPaused);
2657
+ adEventListeners.push({ event: AdEvent.PAUSED, listener: onAdPaused });
2658
+ }
2659
+ if (handlers.onAdResumed) {
2660
+ adsManager.addEventListener(AdEvent.RESUMED, onAdResumed);
2661
+ adEventListeners.push({ event: AdEvent.RESUMED, listener: onAdResumed });
2662
+ }
2663
+ if (handlers.onAdProgress) {
2664
+ adsManager.addEventListener(AdEvent.AD_PROGRESS, onAdProgress);
2665
+ adEventListeners.push({ event: AdEvent.AD_PROGRESS, listener: onAdProgress });
2666
+ }
2667
+ if (handlers.onAllAdsCompleted) {
2668
+ adsManager.addEventListener(AdEvent.ALL_ADS_COMPLETED, onAllAdsCompleted);
2669
+ adEventListeners.push({ event: AdEvent.ALL_ADS_COMPLETED, listener: onAllAdsCompleted });
2670
+ }
2671
+ listenersRef.current.push({
2672
+ adsManager,
2673
+ listeners: adEventListeners
2674
+ });
2675
+ }
2676
+ };
2677
+ try {
2678
+ player.addEventListener("ad-started", () => {
2679
+ console.log("Shaka ad-started event");
2680
+ handlers.onAdStart?.();
2681
+ });
2682
+ player.addEventListener("ad-complete", () => {
2683
+ console.log("Shaka ad-complete event");
2684
+ handlers.onAdComplete?.();
2685
+ });
2686
+ player.addEventListener("ad-skipped", () => {
2687
+ console.log("Shaka ad-skipped event");
2688
+ handlers.onAdSkipped?.();
2689
+ });
2690
+ player.addEventListener("ad-error", (event) => {
2691
+ console.error("Shaka ad-error event:", event);
2692
+ handlers.onAdError?.(event);
2693
+ });
2694
+ listenersRef.current.push({
2695
+ type: "shaka",
2696
+ player,
2697
+ events: ["ad-started", "ad-complete", "ad-skipped", "ad-error"]
2698
+ });
2699
+ } catch (error) {
2700
+ console.warn("Error setting up ad event listeners:", error);
2701
+ }
2702
+ }, [playerRef, handlers]);
2703
+ const cleanupAdEventListeners = useCallback8(() => {
2704
+ try {
2705
+ listenersRef.current.forEach((listenerGroup) => {
2706
+ if (listenerGroup.type === "shaka" && listenerGroup.player) {
2707
+ listenerGroup.events.forEach((eventName) => {
2708
+ try {
2709
+ listenerGroup.player.removeEventListener(eventName, () => {
2710
+ });
2711
+ } catch (e) {
2712
+ console.warn(`Error removing ${eventName} listener:`, e);
2713
+ }
2714
+ });
2715
+ } else if (listenerGroup.adsManager && listenerGroup.listeners) {
2716
+ listenerGroup.listeners.forEach(({ event, listener }) => {
2717
+ try {
2718
+ listenerGroup.adsManager.removeEventListener(event, listener);
2719
+ } catch (e) {
2720
+ console.warn("Error removing ad listener:", e);
2721
+ }
2722
+ });
2723
+ }
2724
+ });
2725
+ listenersRef.current = [];
2726
+ } catch (error) {
2727
+ console.warn("Error cleaning up ad event listeners:", error);
2728
+ }
2729
+ }, []);
2730
+ return {
2731
+ setupAdEventListeners,
2732
+ cleanupAdEventListeners
2733
+ };
2734
+ };
2735
+
2571
2736
  // src/components/Loading.tsx
2572
2737
  import { twMerge } from "tailwind-merge";
2573
2738
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
@@ -3885,6 +4050,7 @@ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
3885
4050
  var Player = forwardRef(
3886
4051
  ({
3887
4052
  src,
4053
+ managedMode = false,
3888
4054
  autoPlay = false,
3889
4055
  loop = false,
3890
4056
  muted = false,
@@ -3909,13 +4075,14 @@ var Player = forwardRef(
3909
4075
  auth,
3910
4076
  ...videoProps
3911
4077
  }, ref) => {
3912
- const videoRef = useRef8(null);
3913
- const containerRef = useRef8(null);
4078
+ const videoRef = useRef9(null);
4079
+ const containerRef = useRef9(null);
3914
4080
  const [isScriptsLoaded, setIsScriptsLoaded] = useState4(false);
3915
4081
  const [isInitialLoading, setIsInitialLoading] = useState4(true);
3916
4082
  const [bfResetKey, setBfResetKey] = useState4(0);
4083
+ const hasPlaylist = !!src && !!(src.url || src.drm?.widevine?.playlistUrl || src.drm?.playready?.playlistUrl || src.drm?.fairplay?.playlistUrl);
3917
4084
  useImperativeHandle(ref, () => videoRef.current, []);
3918
- const { playerRef, initializePlayer, destroyPlayer, isRetrying } = useShakaPlayer({
4085
+ const { playerRef, initializePlayer, loadManifest, destroyPlayer, isRetrying } = useShakaPlayer({
3919
4086
  src,
3920
4087
  shakaConfig,
3921
4088
  drmConfig,
@@ -3925,7 +4092,8 @@ var Player = forwardRef(
3925
4092
  onMuxReady: events?.onMuxReady,
3926
4093
  onMuxDataUpdate: events?.onMuxDataUpdate,
3927
4094
  publicKey,
3928
- mottoToken: auth?.mottoToken
4095
+ mottoToken: auth?.mottoToken,
4096
+ hasAds: !!imaConfig?.adTagUrl
3929
4097
  });
3930
4098
  const {
3931
4099
  initializeMux,
@@ -3983,7 +4151,17 @@ var Player = forwardRef(
3983
4151
  showPulseAnimation: true,
3984
4152
  liveThresholdSeconds: 15
3985
4153
  });
3986
- const initializeSystem73 = useCallback8((playerConfig) => {
4154
+ const { setupAdEventListeners, cleanupAdEventListeners } = useAdEvents(playerRef, {
4155
+ onAdStart: events?.onAdStart,
4156
+ onAdComplete: events?.onAdComplete,
4157
+ onAdError: events?.onAdError,
4158
+ onAdSkipped: events?.onAdSkipped,
4159
+ onAdPaused: events?.onAdPaused,
4160
+ onAdResumed: events?.onAdResumed,
4161
+ onAdProgress: events?.onAdProgress,
4162
+ onAllAdsCompleted: events?.onAllAdsCompleted
4163
+ });
4164
+ const initializeSystem73 = useCallback9((playerConfig) => {
3987
4165
  if (!system73Config?.apiKey || !window.S73ShakaPlayerWrapper) {
3988
4166
  return null;
3989
4167
  }
@@ -4003,7 +4181,7 @@ var Player = forwardRef(
4003
4181
  return null;
4004
4182
  }
4005
4183
  }, [system73Config]);
4006
- const initializeAds = useCallback8(() => {
4184
+ const initializeAds = useCallback9(async () => {
4007
4185
  if (!imaConfig?.adTagUrl || !playerRef.current || !videoRef.current || !uiRef.current) {
4008
4186
  return;
4009
4187
  }
@@ -4011,7 +4189,6 @@ var Player = forwardRef(
4011
4189
  console.error("Google IMA SDK not available when trying to initialize ads");
4012
4190
  return;
4013
4191
  }
4014
- console.log("Initializing ads with autoplay:", autoPlay);
4015
4192
  try {
4016
4193
  const player = playerRef.current;
4017
4194
  const video = videoRef.current;
@@ -4035,11 +4212,13 @@ var Player = forwardRef(
4035
4212
  const adsRequest = new google.ima.AdsRequest();
4036
4213
  adsRequest.adTagUrl = imaConfig.adTagUrl;
4037
4214
  adManager.requestClientSideAds(adsRequest);
4038
- console.log("Ads requested successfully with tag:", imaConfig.adTagUrl, "autoplay:", autoPlay);
4215
+ setupAdEventListeners();
4216
+ await new Promise((resolve) => setTimeout(resolve, 1e4));
4217
+ await loadManifest();
4039
4218
  } catch (error) {
4040
4219
  console.error("Error initializing ads:", error);
4041
4220
  }
4042
- }, [imaConfig, autoPlay]);
4221
+ }, [imaConfig, autoPlay, setupAdEventListeners, loadManifest]);
4043
4222
  useEffect5(() => {
4044
4223
  const loadRequiredScripts = async () => {
4045
4224
  try {
@@ -4096,8 +4275,7 @@ var Player = forwardRef(
4096
4275
  configureQuality();
4097
4276
  await initializeUI();
4098
4277
  if (imaConfig?.adTagUrl && window.google?.ima) {
4099
- console.log("Initializing ads immediately after UI setup");
4100
- initializeAds();
4278
+ await initializeAds();
4101
4279
  }
4102
4280
  } catch (error) {
4103
4281
  console.error("Error during player initialization:", error);
@@ -4107,11 +4285,12 @@ var Player = forwardRef(
4107
4285
  initialize();
4108
4286
  return () => {
4109
4287
  cleanupEventListeners();
4288
+ cleanupAdEventListeners();
4110
4289
  destroyUI();
4111
4290
  destroyMux();
4112
4291
  destroyPlayer();
4113
4292
  };
4114
- }, [src, isScriptsLoaded, bfResetKey]);
4293
+ }, [managedMode ? hasPlaylist : src, isScriptsLoaded, bfResetKey, managedMode]);
4115
4294
  useEffect5(() => {
4116
4295
  const video = videoRef.current;
4117
4296
  if (!video) return;
@@ -4223,11 +4402,11 @@ import { twMerge as twMerge3 } from "tailwind-merge";
4223
4402
  import { useQuery } from "@tanstack/react-query";
4224
4403
 
4225
4404
  // src/api/video.ts
4226
- var fetchVideoData = async (videoId, publicKey, mottoToken) => {
4405
+ var fetchVideoData = async (videoId, publicKey, mottoToken, adsEnabled = false, locale = "en") => {
4227
4406
  const endpoint = "https://cda.mottostreaming.com/motto.cda.streaming.video.v1.VideoService/GetVideo";
4228
4407
  const url = new URL(endpoint);
4229
4408
  url.searchParams.set("encoding", "json");
4230
- url.searchParams.set("message", JSON.stringify({ videoId }));
4409
+ url.searchParams.set("message", JSON.stringify({ videoId, enable_ads: adsEnabled, locale }));
4231
4410
  const response = await fetch(url, {
4232
4411
  method: "GET",
4233
4412
  headers: {
@@ -4241,14 +4420,14 @@ var fetchVideoData = async (videoId, publicKey, mottoToken) => {
4241
4420
  const data = await response.json();
4242
4421
  return data.video;
4243
4422
  };
4244
- async function fetchVideosList(publicKey, videoIds, mottoToken, skip = 0, limit = 0) {
4423
+ async function fetchVideosList(publicKey, videoIds, mottoToken, skip = 0, limit = 0, adsEnabled = true, locale = "en") {
4245
4424
  if (!videoIds || videoIds.length === 0) {
4246
4425
  return [];
4247
4426
  }
4248
4427
  const endpoint = "https://cda.mottostreaming.com/motto.cda.streaming.video.v1.VideoService/BatchGetVideos";
4249
4428
  const url = new URL(endpoint);
4250
4429
  url.searchParams.set("encoding", "json");
4251
- url.searchParams.set("message", JSON.stringify({ videoIds }));
4430
+ url.searchParams.set("message", JSON.stringify({ videoIds, enable_ads: adsEnabled, locale }));
4252
4431
  const response = await fetch(url.toString(), {
4253
4432
  method: "GET",
4254
4433
  headers: {
@@ -4703,6 +4882,7 @@ var Video = ({
4703
4882
  auth,
4704
4883
  settings,
4705
4884
  queryOptions = {},
4885
+ adsEnabled = false,
4706
4886
  ...props
4707
4887
  }) => {
4708
4888
  const {
@@ -4711,8 +4891,8 @@ var Video = ({
4711
4891
  error,
4712
4892
  refetch
4713
4893
  } = useQuery({
4714
- queryKey: ["video", videoId, publicKey, auth?.mottoToken],
4715
- queryFn: () => fetchVideoData(videoId, publicKey, auth?.mottoToken),
4894
+ queryKey: ["video", videoId, publicKey, auth?.mottoToken, adsEnabled, locale],
4895
+ queryFn: () => fetchVideoData(videoId, publicKey, auth?.mottoToken, adsEnabled, locale),
4716
4896
  enabled: !!videoId && !!publicKey && !providedVideoData,
4717
4897
  refetchInterval: refetchInterval > 0 ? refetchInterval : false,
4718
4898
  staleTime: queryOptions.staleTime ?? 5 * 60 * 1e3,
@@ -4768,19 +4948,21 @@ var Video = ({
4768
4948
  {
4769
4949
  ...props,
4770
4950
  src: activePlaylist,
4951
+ managedMode: true,
4771
4952
  className: twMerge3("video-player-container", className),
4772
4953
  events,
4773
4954
  locale,
4774
4955
  containerClassName: "w-full h-full",
4775
4956
  publicKey,
4776
4957
  auth,
4958
+ ...adsEnabled && video?.ad?.adTagUrl ? { imaConfig: { adTagUrl: video?.ad?.adTagUrl } } : {},
4777
4959
  children
4778
4960
  }
4779
4961
  ) }) });
4780
4962
  };
4781
4963
 
4782
4964
  // src/Event.tsx
4783
- import { useCallback as useCallback9, useEffect as useEffect8, useState as useState6 } from "react";
4965
+ import { useCallback as useCallback10, useEffect as useEffect8, useState as useState6 } from "react";
4784
4966
  import { twMerge as twMerge4 } from "tailwind-merge";
4785
4967
  import { useQuery as useQuery2 } from "@tanstack/react-query";
4786
4968
  import { Fragment, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
@@ -4796,6 +4978,7 @@ var Event = ({
4796
4978
  settings,
4797
4979
  auth,
4798
4980
  queryOptions = {},
4981
+ adsEnabled = false,
4799
4982
  ...props
4800
4983
  }) => {
4801
4984
  const {
@@ -4821,8 +5004,8 @@ var Event = ({
4821
5004
  isLoading: videosIsLoading,
4822
5005
  error: videosError
4823
5006
  } = useQuery2({
4824
- queryKey: ["videos-list", publicKey, videoIds, auth?.mottoToken],
4825
- queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0),
5007
+ queryKey: ["videos-list", publicKey, videoIds, auth?.mottoToken, adsEnabled, locale],
5008
+ queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0, adsEnabled, locale),
4826
5009
  enabled: !!publicKey && videoIds.length > 0,
4827
5010
  refetchInterval: activePlaylist === null ? 3e4 : false,
4828
5011
  staleTime: queryOptions.staleTime ?? 5 * 60 * 1e3,
@@ -4939,12 +5122,14 @@ var Event = ({
4939
5122
  {
4940
5123
  ...props,
4941
5124
  src: activePlaylist,
5125
+ managedMode: true,
4942
5126
  className: twMerge4(className, "peer aspect-video"),
4943
5127
  events,
4944
5128
  locale,
4945
5129
  containerClassName: "w-full h-full",
4946
5130
  publicKey,
4947
- auth
5131
+ auth,
5132
+ ...adsEnabled && activeVideo?.ad?.adTagUrl ? { imaConfig: { adTagUrl: activeVideo?.ad?.adTagUrl } } : {}
4948
5133
  }
4949
5134
  ) }),
4950
5135
  !hideTitle && eventData && /* @__PURE__ */ jsx10(
@@ -4996,7 +5181,7 @@ function PreEvent({
4996
5181
  }, 1e3);
4997
5182
  return () => clearInterval(interval);
4998
5183
  }, [date, remainingTime]);
4999
- const renderCountdown = useCallback9(() => {
5184
+ const renderCountdown = useCallback10(() => {
5000
5185
  if (shouldBeStarted) {
5001
5186
  return /* @__PURE__ */ jsx10("span", { className: "text-base-content text-xl", children: t("EVENT_NOT_STARTED") });
5002
5187
  }
@@ -5141,6 +5326,7 @@ var CreativeWork = ({
5141
5326
  settings,
5142
5327
  auth,
5143
5328
  queryOptions = {},
5329
+ adsEnabled = false,
5144
5330
  ...props
5145
5331
  }) => {
5146
5332
  const {
@@ -5167,8 +5353,8 @@ var CreativeWork = ({
5167
5353
  isLoading: videosIsLoading,
5168
5354
  error: videosError
5169
5355
  } = useQuery3({
5170
- queryKey: ["videos-list", publicKey, videoIds, auth?.mottoToken],
5171
- queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0),
5356
+ queryKey: ["videos-list", publicKey, videoIds, auth?.mottoToken, adsEnabled, locale],
5357
+ queryFn: () => fetchVideosList(publicKey, videoIds, auth?.mottoToken, 0, 0, adsEnabled, locale),
5172
5358
  enabled: !!publicKey && videoIds.length > 0,
5173
5359
  refetchInterval: activePlaylist === null ? 3e4 : false,
5174
5360
  staleTime: queryOptions.staleTime ?? 5 * 60 * 1e3,
@@ -5295,6 +5481,7 @@ var CreativeWork = ({
5295
5481
  {
5296
5482
  ...props,
5297
5483
  className: twMerge5(className, "peer aspect-video"),
5484
+ managedMode: true,
5298
5485
  events: {
5299
5486
  ...events
5300
5487
  },
@@ -5302,7 +5489,8 @@ var CreativeWork = ({
5302
5489
  locale,
5303
5490
  containerClassName: "w-full h-full",
5304
5491
  publicKey,
5305
- auth
5492
+ auth,
5493
+ ...adsEnabled && activeVideo?.ad?.adTagUrl ? { imaConfig: { adTagUrl: activeVideo?.ad?.adTagUrl } } : {}
5306
5494
  }
5307
5495
  ),
5308
5496
  !hideTitle && /* @__PURE__ */ jsx11(