If cast framework is not available (e.g., on Safari), hide the button

This commit is contained in:
Pas 2025-10-14 17:27:17 -06:00
parent 5a17ee5f89
commit 388a25fe12

View file

@ -28,7 +28,12 @@ export function Chromecast({ className }: ChromecastProps) {
useEffect(() => {
const w = window as unknown as { cast?: typeof cast };
const castFramework = w.cast?.framework;
if (!castFramework) return;
// If cast framework is not available (e.g., on Safari), hide the button
if (!castFramework) {
setCastHidden(true);
return;
}
const context = castFramework.CastContext.getInstance();
const updateVisibility = () => {