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

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.55";
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,
@@ -3892,7 +3902,7 @@ var Player = forwardRef(
3892
3902
  getMuxMonitor: () => null
3893
3903
  }), [getAvailableQualities, setQuality, skipBack, skipForward, updateMuxData]);
3894
3904
  const isResponsive = !width && !height;
3895
- const containerClasses = twMerge2(containerClassName, "motto-video-container bg-black overflow-hidden md:rounded-2xl");
3905
+ const containerClasses = twMerge2(containerClassName, "motto-video-container bg-black ");
3896
3906
  const containerStyle = isResponsive ? {
3897
3907
  aspectRatio: aspectRatio.toString()
3898
3908
  } : { width, height };
@@ -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
  }
@@ -4637,18 +4648,19 @@ var Event = ({
4637
4648
  events.onEmptyPlaylists();
4638
4649
  }
4639
4650
  if (loadingPlaylist) {
4640
- return /* @__PURE__ */ jsx10("div", { className: twMerge4("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ jsx10("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ jsx10(Loading, {}) }) });
4651
+ return /* @__PURE__ */ jsx10("div", { className: twMerge4("", className), children: /* @__PURE__ */ jsx10("div", { className: "relative w-full h-full bg-[#151515]", children: /* @__PURE__ */ jsx10(Loading, {}) }) });
4641
4652
  }
4642
4653
  if (activePlaylist && activeVideoId && videosData) {
4643
4654
  const activeVideo = videosData.find((video) => video.id === activeVideoId);
4644
- return /* @__PURE__ */ jsxs8("div", { className: twMerge4("md:rounded-2xl overflow-hidden aspect-video", className), children: [
4655
+ return /* @__PURE__ */ jsxs8("div", { className: twMerge4("", className), children: [
4645
4656
  /* @__PURE__ */ jsx10("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx10(
4646
4657
  Player,
4647
4658
  {
4648
4659
  ...props,
4649
4660
  src: activePlaylist,
4650
- className: twMerge4(className, "peer"),
4661
+ className: twMerge4(className, "peer aspect-video"),
4651
4662
  events,
4663
+ locale,
4652
4664
  containerClassName: "w-full h-full"
4653
4665
  }
4654
4666
  ) }),
@@ -4664,7 +4676,7 @@ var Event = ({
4664
4676
  ] });
4665
4677
  }
4666
4678
  if (eventData) {
4667
- return /* @__PURE__ */ jsx10("div", { className: twMerge4("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ jsx10("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx10(
4679
+ return /* @__PURE__ */ jsx10("div", { className: twMerge4("", className), children: /* @__PURE__ */ jsx10("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx10(
4668
4680
  PreEvent,
4669
4681
  {
4670
4682
  event: eventData,
@@ -4948,7 +4960,7 @@ var CreativeWork = ({
4948
4960
  if (error) {
4949
4961
  const title = t(error.message)?.length ? t(error.message) : t("DEFAULT_ERROR");
4950
4962
  const description = t(`${error.message}_DESCRIPTION`)?.length ? t(`${error.message}_DESCRIPTION`) : t("DEFAULT_ERROR_DESCRIPTION");
4951
- return /* @__PURE__ */ jsx11("div", { className: twMerge5("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ jsx11("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx11(
4963
+ return /* @__PURE__ */ jsx11("div", { className: twMerge5("", className), children: /* @__PURE__ */ jsx11("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx11(
4952
4964
  ErrorScreen,
4953
4965
  {
4954
4966
  title,
@@ -4978,10 +4990,10 @@ var CreativeWork = ({
4978
4990
  events
4979
4991
  ]);
4980
4992
  if (isCreativeWorkLoading || videosIsLoading || loadingApisState) {
4981
- return /* @__PURE__ */ jsx11("div", { className: twMerge5("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ jsx11("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx11(Loading, {}) }) });
4993
+ return /* @__PURE__ */ jsx11("div", { className: twMerge5("", className), children: /* @__PURE__ */ jsx11("div", { className: "relative w-full h-full", children: /* @__PURE__ */ jsx11(Loading, {}) }) });
4982
4994
  }
4983
4995
  if (showCountDown && creativeWorkData) {
4984
- return /* @__PURE__ */ jsx11("div", { className: twMerge5("md:rounded-2xl overflow-hidden aspect-video", className), children: /* @__PURE__ */ jsx11("div", { className: "relative w-full h-full bg-base-200 text-base-content flex justify-center items-center flex-col", children: /* @__PURE__ */ jsx11(
4996
+ return /* @__PURE__ */ jsx11("div", { className: twMerge5("", className), children: /* @__PURE__ */ jsx11("div", { className: "relative w-full h-full bg-base-200 text-base-content flex justify-center items-center flex-col", children: /* @__PURE__ */ jsx11(
4985
4997
  PreCreativeWork,
4986
4998
  {
4987
4999
  creativeWork: creativeWorkData,
@@ -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
  ),