mirror of
https://github.com/p-stream/p-stream.git
synced 2026-05-11 02:40:52 +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(() => {
|
useEffect(() => {
|
||||||
const w = window as unknown as { cast?: typeof cast };
|
const w = window as unknown as { cast?: typeof cast };
|
||||||
const castFramework = w.cast?.framework;
|
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 context = castFramework.CastContext.getInstance();
|
||||||
const updateVisibility = () => {
|
const updateVisibility = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue