mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-12 18:39:58 +00:00
Add stubbed cast.framework API implementation
This commit is contained in:
@@ -14,6 +14,21 @@ if (!global.chrome) {
|
||||
global.chrome.cast = cast;
|
||||
|
||||
|
||||
if (document.currentScript) {
|
||||
const currentScript = (document.currentScript as HTMLScriptElement);
|
||||
const currentScriptUrl = new URL(currentScript.src);
|
||||
const currentScriptParams = new URLSearchParams(currentScriptUrl.search);
|
||||
|
||||
// Load Framework API if requested
|
||||
if (currentScriptParams.get("loadCastFramework") === "1") {
|
||||
import("./framework").then(framework => {
|
||||
global.cast = {};
|
||||
global.cast.framework = framework.default;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onMessage(message => {
|
||||
switch (message.subject) {
|
||||
case "shim:/initialized": {
|
||||
|
||||
Reference in New Issue
Block a user