diff --git a/materialious/src/lib/components/Player.svelte b/materialious/src/lib/components/Player.svelte index 887d3ad3..9ebdb4ae 100644 --- a/materialious/src/lib/components/Player.svelte +++ b/materialious/src/lib/components/Player.svelte @@ -23,7 +23,6 @@ import type { VideoPlay } from '../api/model'; import { authStore, - companionStore, instanceStore, playerAndroidLockOrientation, playerAutoPlayStore, @@ -318,10 +317,6 @@ (button as HTMLElement).blur(); // Remove focus from the button button.removeAttribute('aria-pressed'); // Reset any ARIA attributes that might indicate selection }); - - const tempDiv = document.createElement('div'); - tempDiv.click(); - document.removeChild(tempDiv); }); // Based off the following @@ -629,10 +624,16 @@ await player.attach(playerElement); - if (!data.video.hlsUrl) { + console.log(data.video.dashUrl); + + if (!data.video.liveNow) { let dashUrl: string = ''; - if ($companionStore) { - dashUrl = `${$companionStore}/api/manifest/dash/id/${data.video.videoId}`; + + // Due to CORs issues with redirects, hosted instances of Materialious + // dirctly provide the companion instance + // while clients can just use the reirect provided by Invidious' API + if (import.meta.env.VITE_DEFAULT_COMPANION_INSTANCE && Capacitor.getPlatform() === 'web') { + dashUrl = `${import.meta.env.VITE_DEFAULT_COMPANION_INSTANCE}/api/manifest/dash/id/${data.video.videoId}`; } else { dashUrl = data.video.dashUrl; } diff --git a/materialious/src/lib/components/Settings/Interface.svelte b/materialious/src/lib/components/Settings/Interface.svelte index e07fad12..297a8e9a 100644 --- a/materialious/src/lib/components/Settings/Interface.svelte +++ b/materialious/src/lib/components/Settings/Interface.svelte @@ -13,7 +13,6 @@ import { getPages } from '../../navPages'; import { authStore, - companionStore, darkModeStore, instanceStore, interfaceAllowInsecureRequests, @@ -31,7 +30,6 @@ } from '../../store'; let invidiousInstance = $state(get(instanceStore)); - let companionInstance = $state(get(companionStore)); let region = $state(get(interfaceRegionStore)); let forceCase = $state(get(interfaceForceCase)); let defaultPage = $state(get(interfaceDefaultPage)); @@ -93,11 +91,6 @@ ui('#dialog-settings'); } - function setCompanion(event: Event) { - event.preventDefault(); - companionStore.set(ensureNoTrailingSlash(companionInstance)); - } - function allowInsecureRequests() { if (!Capacitor.isNativePlatform()) return; interfaceAllowInsecureRequests.set(!$interfaceAllowInsecureRequests); @@ -153,21 +146,6 @@ {/if} - -
- -
- {#if invalidInstance} -
- {/if} {/if}