@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.mjs CHANGED
@@ -1170,7 +1170,7 @@ var supportsWidevinePersistentLicenses = () => {
1170
1170
  import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
1171
1171
 
1172
1172
  // package.json
1173
- var version = "1.0.1-rc.53";
1173
+ var version = "1.0.1-rc.54";
1174
1174
 
1175
1175
  // src/utils/licenseCache.ts
1176
1176
  var PERSISTENT_LICENSE_PREFIX = "motto_lic_";
@@ -1959,7 +1959,7 @@ var SkipForwardButtonFactory = class {
1959
1959
  return new SkipForwardButton(rootElement, controls, this.onSkipForward, this.iconSize);
1960
1960
  }
1961
1961
  };
1962
- var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig, seekbarColors, onSkipBack, onSkipForward, iconSizes) => {
1962
+ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig, seekbarColors, onSkipBack, onSkipForward, iconSizes, locale = "en") => {
1963
1963
  const uiRef = useRef4(null);
1964
1964
  const registeredElements = useRef4(/* @__PURE__ */ new Set());
1965
1965
  const initializeUI = useCallback5(async () => {
@@ -1976,6 +1976,14 @@ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig,
1976
1976
  }
1977
1977
  const ui = new ShakaUI.Overlay(playerRef.current, containerRef.current, videoRef.current);
1978
1978
  uiRef.current = ui;
1979
+ if (locale !== "en") {
1980
+ try {
1981
+ ui.getControls().getLocalization().changeLocale([locale]);
1982
+ console.log(`Set locale to '${locale}'`);
1983
+ } catch (error) {
1984
+ console.warn(`Failed to set locale to '${locale}', falling back to 'en':`, error);
1985
+ }
1986
+ }
1979
1987
  const isMobile = window.innerWidth <= 767;
1980
1988
  const controlPanelElements = [
1981
1989
  ...isMobile ? [] : ["skip_back_button"],
@@ -2040,7 +2048,7 @@ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig,
2040
2048
  }
2041
2049
  }
2042
2050
  return ui;
2043
- }, [controls, containerRef, playerRef, videoRef, chromecastConfig, seekbarColors, onSkipBack, onSkipForward, iconSizes]);
2051
+ }, [controls, containerRef, playerRef, videoRef, chromecastConfig, seekbarColors, onSkipBack, onSkipForward, iconSizes, locale]);
2044
2052
  const destroyUI = useCallback5(() => {
2045
2053
  if (uiRef.current) {
2046
2054
  try {
@@ -3654,6 +3662,7 @@ var Player = forwardRef(
3654
3662
  seekbarConfig,
3655
3663
  iconSizes,
3656
3664
  events,
3665
+ locale = "en",
3657
3666
  containerClassName,
3658
3667
  ...videoProps
3659
3668
  }, ref) => {
@@ -3710,7 +3719,8 @@ var Player = forwardRef(
3710
3719
  seekbarConfig,
3711
3720
  events?.onSkipBack,
3712
3721
  events?.onSkipForward,
3713
- iconSizes
3722
+ iconSizes,
3723
+ locale
3714
3724
  );
3715
3725
  const { isLive, isVisible: isLiveBadgeVisible } = useLiveBadge(playerRef, {
3716
3726
  enabled: true,
@@ -4481,6 +4491,7 @@ var Video = ({
4481
4491
  src: activePlaylist,
4482
4492
  className: twMerge3("video-player-container", className),
4483
4493
  events,
4494
+ locale,
4484
4495
  containerClassName: "w-full h-full",
4485
4496
  children
4486
4497
  }
@@ -4649,6 +4660,7 @@ var Event = ({
4649
4660
  src: activePlaylist,
4650
4661
  className: twMerge4(className, "peer"),
4651
4662
  events,
4663
+ locale,
4652
4664
  containerClassName: "w-full h-full"
4653
4665
  }
4654
4666
  ) }),
@@ -5004,6 +5016,7 @@ var CreativeWork = ({
5004
5016
  ...events
5005
5017
  },
5006
5018
  src: activePlaylist,
5019
+ locale,
5007
5020
  containerClassName: "w-full h-full"
5008
5021
  }
5009
5022
  ),