Implemented PUBLIC_PLAYER_ID
This commit is contained in:
@@ -47,6 +47,11 @@ services:
|
||||
# guide here for URL structure https://docs.preset.io/docs/uri-connection-strings
|
||||
DATABASE_CONNECTION_URI: "sqlite:///materialious-data/materialious.db"
|
||||
|
||||
# YouTube player id to use, can be left blank but setting to a older player id may fix
|
||||
# video playback with local video processing.
|
||||
# https://youtube-player-ids.nadeko.net
|
||||
PUBLIC_PLAYER_ID: ""
|
||||
|
||||
# Use Materialious account system.
|
||||
PUBLIC_INTERNAL_AUTH: "true"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { getPublicEnv } from '$lib/misc';
|
||||
import { interfaceRegionStore } from '$lib/store';
|
||||
import { USER_AGENT } from 'bgutils-js';
|
||||
import { get } from 'svelte/store';
|
||||
@@ -12,7 +13,8 @@ export async function getInnertube(): Promise<Innertube> {
|
||||
fetch: fetch,
|
||||
cache: new UniversalCache(true),
|
||||
location: get(interfaceRegionStore),
|
||||
user_agent: USER_AGENT
|
||||
user_agent: USER_AGENT,
|
||||
player_id: getPublicEnv('PLAYER_ID') ?? '9f4cc5e4'
|
||||
});
|
||||
|
||||
return innertube;
|
||||
|
||||
@@ -10,7 +10,9 @@ import { addToast } from './components/Toast.svelte';
|
||||
import { _ } from './i18n';
|
||||
|
||||
export function getPublicEnv(envName: string): string | undefined {
|
||||
return env[`PUBLIC_${envName}`] ?? import.meta.env[`VITE_${envName}`];
|
||||
const envValue = env[`PUBLIC_${envName}`] ?? import.meta.env[`VITE_${envName}`];
|
||||
if (envValue === '') return;
|
||||
return envValue;
|
||||
}
|
||||
|
||||
export function isMobile(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user