mirror of
https://github.com/p-stream/p-stream.git
synced 2026-03-11 17:55:33 +00:00
If cast framework is not available (e.g., on Safari), hide the button
This commit is contained in:
parent
5a17ee5f89
commit
388a25fe12
1 changed files with 6 additions and 1 deletions
|
|
@ -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 = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue