Remove unused

This commit is contained in:
Manav Rathi
2024-09-21 17:04:37 +05:30
parent 1895e90b3e
commit 9ecb7c4044

View File

@@ -1,38 +0,0 @@
declare const chrome: any;
declare const cast: any;
declare global {
interface Window {
__onGCastApiAvailable: (isAvailable: boolean) => void;
}
}
/**
* Load the Chromecast script, resolving with the global `cast` object.
*/
export const loadCast = (() => {
let promise: Promise<any> | undefined;
return () => {
if (promise === undefined) {
promise = new Promise((resolve) => {
const script = document.createElement("script");
script.src =
"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";
window.__onGCastApiAvailable = (isAvailable) => {
if (isAvailable) {
cast.framework.CastContext.getInstance().setOptions({
receiverApplicationId: "F5BCEC64",
autoJoinPolicy:
chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
});
resolve(cast);
}
};
document.body.appendChild(script);
});
}
return promise;
};
})();