mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 01:59:58 +00:00
Move http media server to separate class
This commit is contained in:
@@ -119,7 +119,7 @@
|
||||
"message": "HTML5 video/audio media casting."
|
||||
}
|
||||
, "optionsMediaEnabled": {
|
||||
"message": "Media casting enabled"
|
||||
"message": "Enable media casting"
|
||||
}
|
||||
, "optionsMediaSyncElement": {
|
||||
"message": "Sync receiver state with media element"
|
||||
@@ -135,7 +135,7 @@
|
||||
"message": "HTTP server started by the bridge app to stream local media files to the cast receiver."
|
||||
}
|
||||
, "optionsLocalMediaEnabled": {
|
||||
"message": "Local media casting enabled"
|
||||
"message": "Enable local media casting"
|
||||
}
|
||||
, "optionsLocalMediaServerPort": {
|
||||
"message": "HTTP server port:"
|
||||
@@ -148,7 +148,7 @@
|
||||
"message": "Sites for which to replace the user agent with a Chrome version for compatibility. Must be valid match patterns."
|
||||
}
|
||||
, "optionsUserAgentWhitelistEnabled": {
|
||||
"message": "Site whitelist enabled"
|
||||
"message": "Enable site whitelist"
|
||||
}
|
||||
, "optionsUserAgentWhitelistContent": {
|
||||
"message": "Match patterns (newline-separated):"
|
||||
@@ -182,7 +182,7 @@
|
||||
"message": "Screen/Tab mirroring to a Chromecast receiver app."
|
||||
}
|
||||
, "optionsMirroringEnabled": {
|
||||
"message": "Screen mirroring enabled"
|
||||
"message": "Enable screen mirroring"
|
||||
}
|
||||
, "optionsMirroringAppId": {
|
||||
"message": "Receiver app ID:"
|
||||
|
||||
@@ -373,8 +373,6 @@ const statusBridge = browser.runtime.connectNative(APPLICATION_NAME);
|
||||
const statusBridgeReceivers = new Map<string, Receiver>();
|
||||
|
||||
statusBridge.onMessage.addListener(async (message: Message) => {
|
||||
console.log(message);
|
||||
|
||||
switch (message.subject) {
|
||||
case "shim:/serviceUp": {
|
||||
const receiver = (message as ServiceUpMessage).data;
|
||||
|
||||
@@ -18,7 +18,7 @@ const mediaElement = browser.menus.getTargetElement(targetElementId);
|
||||
|
||||
window.addEventListener("beforeunload", () => {
|
||||
browser.runtime.sendMessage({
|
||||
subject: "bridge:/stopHttpServer"
|
||||
subject: "bridge:/mediaServer/stop"
|
||||
});
|
||||
|
||||
if (options.mediaStopOnUnload) {
|
||||
@@ -58,7 +58,7 @@ async function onRequestSessionSuccess (session_) {
|
||||
if (isLocalFile) {
|
||||
await new Promise((resolve, reject) => {
|
||||
browser.runtime.sendMessage({
|
||||
subject: "bridge:/startHttpServer"
|
||||
subject: "bridge:/mediaServer/start"
|
||||
, data: {
|
||||
filePath: decodeURI(mediaUrl.pathname)
|
||||
, port
|
||||
@@ -66,7 +66,7 @@ async function onRequestSessionSuccess (session_) {
|
||||
});
|
||||
|
||||
browser.runtime.onMessage.addListener(function onMessage (message) {
|
||||
if (message.subject === "mediaCast:/httpServerStarted") {
|
||||
if (message.subject === "mediaCast:/mediaServer/started") {
|
||||
browser.runtime.onMessage.removeListener(onMessage);
|
||||
resolve();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user