Move CastManager to cast/

This commit is contained in:
hensm
2022-04-18 02:47:10 +01:00
parent 61f9ff051d
commit 514b382344
5 changed files with 8 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import bridge, { BridgeInfo } from "../lib/bridge";
import { RemoteMatchPattern } from "../lib/matchPattern";
import CastManager from "./CastManager";
import CastManager from "../cast/CastManager";
import receiverDevices from "./receiverDevices";
import ReceiverSelectorManager from "./receiverSelector/ReceiverSelectorManager";

View File

@@ -3,7 +3,7 @@
import options from "../../lib/options";
import logger from "../../lib/logger";
import CastManager from "../CastManager";
import CastManager from "../../cast/CastManager";
import receiverDevices from "../receiverDevices";
import { getMediaTypesForPageUrl } from "../../lib/utils";

View File

@@ -9,11 +9,11 @@ import options from "../lib/options";
import {
ReceiverSelectionActionType,
ReceiverSelectorMediaType
} from "./receiverSelector";
} from "../background/receiverSelector";
import ReceiverSelectorManager from "./receiverSelector/ReceiverSelectorManager";
import ReceiverSelectorManager from "../background/receiverSelector/ReceiverSelectorManager";
import receiverDevices from "./receiverDevices";
import receiverDevices from "../background/receiverDevices";
type AnyPort = Port | MessagePort;
@@ -143,7 +143,7 @@ export default new (class CastManager {
/**
* If there's already an active instance for the sender
* tab/frame ID, disconnect it.
*
*
* TODO: Fix this behaviour!
*/
for (const instance of this.activeInstances) {

View File

@@ -45,9 +45,7 @@ export function ensureInit(): Promise<TypedMessagePort<Message>> {
* URL.
*/
if (window.location.protocol === "moz-extension:") {
const { default: CastManager } = await import(
"../background/CastManager"
);
const { default: CastManager } = await import("./CastManager");
// port2 will post bridge messages to port 1
await CastManager.init();

View File

@@ -9,7 +9,7 @@ import {
ReceiverSelectorMediaType
} from "../background/receiverSelector";
import CastManager from "../background/CastManager";
import CastManager from "../cast/CastManager";
interface LoadSenderOptions {
tabId: number;