@mottosports/motto-video-player 1.0.1-rc.53 → 1.0.1-rc.54

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.d.mts CHANGED
@@ -308,6 +308,11 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
308
308
  * Event callbacks
309
309
  */
310
310
  events?: PlayerEvents;
311
+ /**
312
+ * Locale for Shaka Player UI localization (e.g., 'en', 'ar', 'es')
313
+ * Defaults to 'en' if not provided
314
+ */
315
+ locale?: string;
311
316
  containerClassName?: string;
312
317
  }
313
318
  /**
package/dist/index.d.ts CHANGED
@@ -308,6 +308,11 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
308
308
  * Event callbacks
309
309
  */
310
310
  events?: PlayerEvents;
311
+ /**
312
+ * Locale for Shaka Player UI localization (e.g., 'en', 'ar', 'es')
313
+ * Defaults to 'en' if not provided
314
+ */
315
+ locale?: string;
311
316
  containerClassName?: string;
312
317
  }
313
318
  /**
package/dist/index.js CHANGED
@@ -1211,7 +1211,7 @@ var supportsWidevinePersistentLicenses = () => {
1211
1211
  var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
1212
1212
 
1213
1213
  // package.json
1214
- var version = "1.0.1-rc.53";
1214
+ var version = "1.0.1-rc.54";
1215
1215
 
1216
1216
  // src/utils/licenseCache.ts
1217
1217
  var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
@@ -2000,7 +2000,7 @@ var SkipForwardButtonFactory = class {
2000
2000
  return new SkipForwardButton(rootElement, controls, this.onSkipForward, this.iconSize);
2001
2001
  }
2002
2002
  };
2003
- var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig, seekbarColors, onSkipBack, onSkipForward, iconSizes) => {
2003
+ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig, seekbarColors, onSkipBack, onSkipForward, iconSizes, locale = "en") => {
2004
2004
  const uiRef = (0, import_react6.useRef)(null);
2005
2005
  const registeredElements = (0, import_react6.useRef)(/* @__PURE__ */ new Set());
2006
2006
  const initializeUI = (0, import_react6.useCallback)(async () => {
@@ -2017,6 +2017,14 @@ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig,
2017
2017
  }
2018
2018
  const ui = new import_shaka_player3.ui.Overlay(playerRef.current, containerRef.current, videoRef.current);
2019
2019
  uiRef.current = ui;
2020
+ if (locale !== "en") {
2021
+ try {
2022
+ ui.getControls().getLocalization().changeLocale([locale]);
2023
+ console.log(`Set locale to '${locale}'`);
2024
+ } catch (error) {
2025
+ console.warn(`Failed to set locale to '${locale}', falling back to 'en':`, error);
2026
+ }
2027
+ }
2020
2028
  const isMobile = window.innerWidth <= 767;
2021
2029
  const controlPanelElements = [
2022
2030
  ...isMobile ? [] : ["skip_back_button"],
@@ -2081,7 +2089,7 @@ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig,
2081
2089
  }
2082
2090
  }
2083
2091
  return ui;
2084
- }, [controls, containerRef, playerRef, videoRef, chromecastConfig, seekbarColors, onSkipBack, onSkipForward, iconSizes]);
2092
+ }, [controls, containerRef, playerRef, videoRef, chromecastConfig, seekbarColors, onSkipBack, onSkipForward, iconSizes, locale]);
2085
2093
  const destroyUI = (0, import_react6.useCallback)(() => {
2086
2094
  if (uiRef.current) {
2087
2095
  try {
@@ -3695,6 +3703,7 @@ var Player = (0, import_react12.forwardRef)(
3695
3703
  seekbarConfig,
3696
3704
  iconSizes,
3697
3705
  events,
3706
+ locale = "en",
3698
3707
  containerClassName,
3699
3708
  ...videoProps
3700
3709
  }, ref) => {
@@ -3751,7 +3760,8 @@ var Player = (0, import_react12.forwardRef)(
3751
3760
  seekbarConfig,
3752
3761
  events?.onSkipBack,
3753
3762
  events?.onSkipForward,
3754
- iconSizes
3763
+ iconSizes,
3764
+ locale
3755
3765
  );
3756
3766
  const { isLive, isVisible: isLiveBadgeVisible } = useLiveBadge(playerRef, {
3757
3767
  enabled: true,
@@ -4522,6 +4532,7 @@ var Video = ({
4522
4532
  src: activePlaylist,
4523
4533
  className: (0, import_tailwind_merge3.twMerge)("video-player-container", className),
4524
4534
  events,
4535
+ locale,
4525
4536
  containerClassName: "w-full h-full",
4526
4537
  children
4527
4538
  }
@@ -4690,6 +4701,7 @@ var Event = ({
4690
4701
  src: activePlaylist,
4691
4702
  className: (0, import_tailwind_merge4.twMerge)(className, "peer"),
4692
4703
  events,
4704
+ locale,
4693
4705
  containerClassName: "w-full h-full"
4694
4706
  }
4695
4707
  ) }),
@@ -5045,6 +5057,7 @@ var CreativeWork = ({
5045
5057
  ...events
5046
5058
  },
5047
5059
  src: activePlaylist,
5060
+ locale,
5048
5061
  containerClassName: "w-full h-full"
5049
5062
  }
5050
5063
  ),