cloud/etc: shuffle cors

This commit is contained in:
Koushik Dutta
2024-03-06 17:57:59 -08:00
parent 0e1305ec5e
commit b320fd425b
9 changed files with 20 additions and 13 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/chromecast",
"version": "0.1.56",
"version": "0.1.57",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/chromecast",
"version": "0.1.56",
"version": "0.1.57",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/chromecast",
"version": "0.1.56",
"version": "0.1.57",
"description": "Send video, audio, and text to speech notifications to Chromecast and Google Home devices",
"author": "Scrypted",
"license": "Apache-2.0",

View File

@@ -215,7 +215,7 @@ class CastDevice extends ScryptedDeviceBase implements MediaPlayer, Refresh, Eng
let cameraStreamAuthToken: string;
try {
cameraStreamAuthToken= await mediaManager.convertMediaObjectToUrl(mo, ScryptedMimeTypes.LocalUrl);
cameraStreamAuthToken = await mediaManager.convertMediaObjectToUrl(mo, ScryptedMimeTypes.LocalUrl);
}
catch (e) {
this.log.a('Streaming failed. Install and set up Scrypted Cloud to cast this media type.');
@@ -469,6 +469,12 @@ class CastDeviceProvider extends ScryptedDeviceBase implements DeviceProvider {
constructor() {
super(null);
endpointManager.setAccessControlAllowOrigin({
origins: [
// chromecast receiver
'https://koush.github.io',
],
});
this.browser.on('response', response => {
for (const additional of response.additionals) {
@@ -562,7 +568,7 @@ class CastDeviceProvider extends ScryptedDeviceBase implements DeviceProvider {
}
async releaseDevice(id: string, nativeId: string): Promise<void> {
}
async discoverDevices(duration: number) {

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/cloud",
"version": "0.2.12",
"version": "0.2.13",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@scrypted/cloud",
"version": "0.2.12",
"version": "0.2.13",
"dependencies": {
"@eneris/push-receiver": "^3.1.5",
"@scrypted/common": "file:../../common",

View File

@@ -53,5 +53,5 @@
"@types/nat-upnp": "^1.1.5",
"@types/node": "^20.11.19"
},
"version": "0.2.12"
"version": "0.2.13"
}

View File

@@ -557,8 +557,6 @@ class ScryptedCloud extends ScryptedDeviceBase implements OauthClient, Settings,
origins: [
`http://${SCRYPTED_SERVER}`,
`https://${SCRYPTED_SERVER}`,
// chromecast receiver. move this into google home and chromecast plugins?
'https://koush.github.io',
...this.storageSettings.values.additionalCorsOrigins,
],
});

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/google-home",
"version": "0.0.59",
"version": "0.0.60",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/google-home",
"version": "0.0.59",
"version": "0.0.60",
"dependencies": {
"@googleapis/homegraph": "^2.0.0",
"@homebridge/ciao": "^1.1.5",

View File

@@ -49,5 +49,5 @@
"@types/lodash": "^4.14.168",
"@types/url-parse": "^1.4.3"
},
"version": "0.0.59"
"version": "0.0.60"
}

View File

@@ -97,7 +97,10 @@ class GoogleHome extends ScryptedDeviceBase implements HttpRequestHandler, Engin
endpointManager.setAccessControlAllowOrigin({
origins: [
// webrtc signaling
'https://www.gstatic.com',
// chromecast receiver
'https://koush.github.io',
],
});