mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-09 09:09:58 +00:00
Minor cast.framework changes
This commit is contained in:
@@ -25,7 +25,7 @@ type EventHandler = (eventData:
|
||||
type MessageListener = (namespace: string, message: string) => void;
|
||||
|
||||
|
||||
export default class RemotePlayer {
|
||||
export default class CastSession {
|
||||
constructor (sessionObj: Session, state: string) {
|
||||
console.info("STUB :: CastSession#constructor");
|
||||
}
|
||||
|
||||
@@ -44,16 +44,22 @@ export default {
|
||||
, RemotePlayer, RemotePlayerChangedEvent, RemotePlayerController
|
||||
, SessionStateEventData, VolumeEventData
|
||||
|
||||
, CastContext: Object.assign(CastContext, {
|
||||
getInstance () {
|
||||
/**
|
||||
* CastContext class with an extra getInstance method used to
|
||||
* instantiate and fetch a singleton instance.
|
||||
*/
|
||||
, CastContext: {
|
||||
...CastContext
|
||||
|
||||
, getInstance () {
|
||||
if (castContext) {
|
||||
return castContext;
|
||||
return castContext
|
||||
}
|
||||
|
||||
castContext = new CastContext();
|
||||
return castContext;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
, VERSION: "1.0.07"
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@ import { onMessage } from "./messageBridge";
|
||||
|
||||
const global = (window as any);
|
||||
|
||||
if (!global.chrome) {
|
||||
global.chrome = {};
|
||||
}
|
||||
|
||||
global.chrome = {};
|
||||
global.chrome.cast = cast;
|
||||
|
||||
|
||||
/**
|
||||
* If loaded within a page via a <script> element,
|
||||
* document.currentScript should exist and we can check its
|
||||
* [src] query string for the loadCastFramework param.
|
||||
*/
|
||||
if (document.currentScript) {
|
||||
const currentScript = (document.currentScript as HTMLScriptElement);
|
||||
const currentScriptUrl = new URL(currentScript.src);
|
||||
|
||||
Reference in New Issue
Block a user