@mottosports/motto-video-player 1.0.1-rc.31 → 1.0.1-rc.32

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
@@ -1137,7 +1137,7 @@ var isPlayReadySupported = () => {
1137
1137
  import initShakaPlayerMux from "@mux/mux-data-shakaplayer";
1138
1138
 
1139
1139
  // package.json
1140
- var version = "1.0.1-rc.31";
1140
+ var version = "1.0.1-rc.32";
1141
1141
 
1142
1142
  // src/hooks/useShakePlayer.ts
1143
1143
  var useShakePlayer = ({
@@ -1709,6 +1709,7 @@ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig,
1709
1709
  "spacer",
1710
1710
  "fullscreen",
1711
1711
  "cast",
1712
+ // Always show cast button
1712
1713
  "overflow_menu"
1713
1714
  ];
1714
1715
  const uiConfig = {
@@ -1722,20 +1723,17 @@ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig,
1722
1723
  },
1723
1724
  controlPanelElements,
1724
1725
  addBigPlayButton: isMobile,
1725
- ...chromecastConfig?.receiverApplicationId && {
1726
- "castReceiverAppId": chromecastConfig.receiverApplicationId,
1727
- "castAndroidReceiverCompatible": false
1728
- },
1726
+ // Always configure chromecast with defaults or provided config
1727
+ castReceiverAppId: chromecastConfig?.receiverApplicationId || "CC1AD845",
1728
+ // Default Media Receiver
1729
+ castAndroidReceiverCompatible: true,
1730
+ // Enable Android TV compatibility
1729
1731
  overflowMenuButtons: [
1730
1732
  "quality",
1731
1733
  "picture_in_picture",
1732
1734
  "playback_rate"
1733
1735
  ]
1734
1736
  };
1735
- if (chromecastConfig?.receiverApplicationId) {
1736
- uiConfig.castReceiverAppId = chromecastConfig.receiverApplicationId;
1737
- uiConfig.castAndroidReceiverCompatible = false;
1738
- }
1739
1737
  ui.configure(uiConfig);
1740
1738
  if (isMobile) {
1741
1739
  const customizeBigPlayButton = () => {
@@ -3390,15 +3388,29 @@ var Player = forwardRef(
3390
3388
  }
3391
3389
  };
3392
3390
  const initializeChromecast = () => {
3393
- if (!chromecastConfig?.enabled) {
3394
- return;
3395
- }
3396
3391
  try {
3397
- if (events?.onCastStateChange) {
3398
- setTimeout(() => events.onCastStateChange(false), 100);
3392
+ if (typeof window !== "undefined" && window.chrome?.cast) {
3393
+ const castContext = window.chrome.cast.CastContext.getInstance();
3394
+ if (castContext) {
3395
+ castContext.setOptions({
3396
+ receiverApplicationId: chromecastConfig?.receiverApplicationId || "CC1AD845"
3397
+ // Default Media Receiver
3398
+ });
3399
+ castContext.addEventListener("caststatechanged", (event) => {
3400
+ const isCasting = event.castState === "CONNECTED";
3401
+ events?.onCastStateChange?.(isCasting);
3402
+ });
3403
+ }
3404
+ } else {
3405
+ if (events?.onCastStateChange) {
3406
+ setTimeout(() => events.onCastStateChange(false), 100);
3407
+ }
3399
3408
  }
3400
3409
  } catch (error) {
3401
3410
  console.warn("Chromecast initialization failed:", error);
3411
+ if (events?.onCastStateChange) {
3412
+ setTimeout(() => events.onCastStateChange(false), 100);
3413
+ }
3402
3414
  }
3403
3415
  };
3404
3416
  useEffect5(() => {