Remove unused
This commit is contained in:
@@ -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;
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user