@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.d.mts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +26 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -259,21 +259,15 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
|
|
|
259
259
|
nonLinearAdSlotHeight?: number;
|
|
260
260
|
};
|
|
261
261
|
/**
|
|
262
|
-
* Chromecast configuration
|
|
262
|
+
* Chromecast configuration (optional)
|
|
263
|
+
* Chromecast is always enabled by default. This config allows customization.
|
|
263
264
|
*/
|
|
264
265
|
chromecastConfig?: {
|
|
265
|
-
/**
|
|
266
|
-
* Whether to enable Chromecast support
|
|
267
|
-
*/
|
|
268
|
-
enabled?: boolean;
|
|
269
266
|
/**
|
|
270
267
|
* Custom receiver application ID
|
|
268
|
+
* Defaults to 'CC1AD845' (Google's default media receiver)
|
|
271
269
|
*/
|
|
272
270
|
receiverApplicationId?: string;
|
|
273
|
-
/**
|
|
274
|
-
* Whether to auto-join cast sessions
|
|
275
|
-
*/
|
|
276
|
-
autoJoinPolicy?: string;
|
|
277
271
|
};
|
|
278
272
|
/**
|
|
279
273
|
* Quality selection configuration
|
package/dist/index.d.ts
CHANGED
|
@@ -259,21 +259,15 @@ interface PlayerProps extends Omit<HTMLAttributes<HTMLVideoElement>, 'src' | 'on
|
|
|
259
259
|
nonLinearAdSlotHeight?: number;
|
|
260
260
|
};
|
|
261
261
|
/**
|
|
262
|
-
* Chromecast configuration
|
|
262
|
+
* Chromecast configuration (optional)
|
|
263
|
+
* Chromecast is always enabled by default. This config allows customization.
|
|
263
264
|
*/
|
|
264
265
|
chromecastConfig?: {
|
|
265
|
-
/**
|
|
266
|
-
* Whether to enable Chromecast support
|
|
267
|
-
*/
|
|
268
|
-
enabled?: boolean;
|
|
269
266
|
/**
|
|
270
267
|
* Custom receiver application ID
|
|
268
|
+
* Defaults to 'CC1AD845' (Google's default media receiver)
|
|
271
269
|
*/
|
|
272
270
|
receiverApplicationId?: string;
|
|
273
|
-
/**
|
|
274
|
-
* Whether to auto-join cast sessions
|
|
275
|
-
*/
|
|
276
|
-
autoJoinPolicy?: string;
|
|
277
271
|
};
|
|
278
272
|
/**
|
|
279
273
|
* Quality selection configuration
|
package/dist/index.js
CHANGED
|
@@ -1178,7 +1178,7 @@ var isPlayReadySupported = () => {
|
|
|
1178
1178
|
var import_mux_data_shakaplayer = __toESM(require("@mux/mux-data-shakaplayer"));
|
|
1179
1179
|
|
|
1180
1180
|
// package.json
|
|
1181
|
-
var version = "1.0.1-rc.
|
|
1181
|
+
var version = "1.0.1-rc.32";
|
|
1182
1182
|
|
|
1183
1183
|
// src/hooks/useShakePlayer.ts
|
|
1184
1184
|
var useShakePlayer = ({
|
|
@@ -1750,6 +1750,7 @@ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig,
|
|
|
1750
1750
|
"spacer",
|
|
1751
1751
|
"fullscreen",
|
|
1752
1752
|
"cast",
|
|
1753
|
+
// Always show cast button
|
|
1753
1754
|
"overflow_menu"
|
|
1754
1755
|
];
|
|
1755
1756
|
const uiConfig = {
|
|
@@ -1763,20 +1764,17 @@ var useShakaUI = (playerRef, containerRef, videoRef, controls, chromecastConfig,
|
|
|
1763
1764
|
},
|
|
1764
1765
|
controlPanelElements,
|
|
1765
1766
|
addBigPlayButton: isMobile,
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1767
|
+
// Always configure chromecast with defaults or provided config
|
|
1768
|
+
castReceiverAppId: chromecastConfig?.receiverApplicationId || "CC1AD845",
|
|
1769
|
+
// Default Media Receiver
|
|
1770
|
+
castAndroidReceiverCompatible: true,
|
|
1771
|
+
// Enable Android TV compatibility
|
|
1770
1772
|
overflowMenuButtons: [
|
|
1771
1773
|
"quality",
|
|
1772
1774
|
"picture_in_picture",
|
|
1773
1775
|
"playback_rate"
|
|
1774
1776
|
]
|
|
1775
1777
|
};
|
|
1776
|
-
if (chromecastConfig?.receiverApplicationId) {
|
|
1777
|
-
uiConfig.castReceiverAppId = chromecastConfig.receiverApplicationId;
|
|
1778
|
-
uiConfig.castAndroidReceiverCompatible = false;
|
|
1779
|
-
}
|
|
1780
1778
|
ui.configure(uiConfig);
|
|
1781
1779
|
if (isMobile) {
|
|
1782
1780
|
const customizeBigPlayButton = () => {
|
|
@@ -3431,15 +3429,29 @@ var Player = (0, import_react12.forwardRef)(
|
|
|
3431
3429
|
}
|
|
3432
3430
|
};
|
|
3433
3431
|
const initializeChromecast = () => {
|
|
3434
|
-
if (!chromecastConfig?.enabled) {
|
|
3435
|
-
return;
|
|
3436
|
-
}
|
|
3437
3432
|
try {
|
|
3438
|
-
if (
|
|
3439
|
-
|
|
3433
|
+
if (typeof window !== "undefined" && window.chrome?.cast) {
|
|
3434
|
+
const castContext = window.chrome.cast.CastContext.getInstance();
|
|
3435
|
+
if (castContext) {
|
|
3436
|
+
castContext.setOptions({
|
|
3437
|
+
receiverApplicationId: chromecastConfig?.receiverApplicationId || "CC1AD845"
|
|
3438
|
+
// Default Media Receiver
|
|
3439
|
+
});
|
|
3440
|
+
castContext.addEventListener("caststatechanged", (event) => {
|
|
3441
|
+
const isCasting = event.castState === "CONNECTED";
|
|
3442
|
+
events?.onCastStateChange?.(isCasting);
|
|
3443
|
+
});
|
|
3444
|
+
}
|
|
3445
|
+
} else {
|
|
3446
|
+
if (events?.onCastStateChange) {
|
|
3447
|
+
setTimeout(() => events.onCastStateChange(false), 100);
|
|
3448
|
+
}
|
|
3440
3449
|
}
|
|
3441
3450
|
} catch (error) {
|
|
3442
3451
|
console.warn("Chromecast initialization failed:", error);
|
|
3452
|
+
if (events?.onCastStateChange) {
|
|
3453
|
+
setTimeout(() => events.onCastStateChange(false), 100);
|
|
3454
|
+
}
|
|
3443
3455
|
}
|
|
3444
3456
|
};
|
|
3445
3457
|
(0, import_react12.useEffect)(() => {
|