diff --git a/src/components/Settings/playback.ts b/src/components/Settings/playback.ts index f64cf71c0..68b3210bc 100644 --- a/src/components/Settings/playback.ts +++ b/src/components/Settings/playback.ts @@ -13,92 +13,102 @@ export default function() {
${i18n('settings_playback')}
- ${Selector({ - label: 'settings_audio_quality', - id: 'qualityPreference', - handler: async (e) => { - setState('quality', e.target.value as 'low' | 'medium' | 'high'); - quickSwitch(); - }, - onmount: async (target) => { - target.value = state.quality || 'medium'; - }, - children: html` - - - - ` - })} + ${Selector({ + label: 'settings_audio_quality', + id: 'qualityPreference', + handler: async (e) => { + setState('quality', e.target.value as 'low' | 'medium' | 'high'); + quickSwitch(); + }, + onmount: async (target) => { + target.value = state.quality || 'medium'; + }, + children: html` + + + + ` + })} - ${ToggleSwitch({ - id: "prefetchSwitch", - name: 'settings_prefetch', - checked: Boolean(state.prefetch), - handler: () => { - setState('prefetch', !state.prefetch); - } - })} + ${ToggleSwitch({ + id: "prefetchSwitch", + name: 'settings_prefetch', + checked: Boolean(state.prefetch), + handler: () => { + setState('prefetch', !state.prefetch); + } + })} ${!state.HLS ? html` ${Selector({ - label: 'settings_codec_preference', - id: 'codecPreference', - handler: async (e) => { - setState('codec', e.target.value as 'opus' | 'any' | 'aac'); - quickSwitch(); - }, - onmount: async (target) => { - target.value = state.codec; - }, - children: html` + label: 'settings_codec_preference', + id: 'codecPreference', + handler: async (e) => { + setState('codec', e.target.value as 'opus' | 'any' | 'aac'); + quickSwitch(); + }, + onmount: async (target) => { + target.value = state.codec; + }, + children: html` ` - })} + })} ${ToggleSwitch({ - id: "stableVolumeSwitch", - name: 'settings_stable_volume', - checked: Boolean(state.stableVolume), - handler: () => { - setState('stableVolume', !state.stableVolume); - quickSwitch(); - } - })} + id: "stableVolumeSwitch", + name: 'settings_stable_volume', + checked: Boolean(state.stableVolume), + handler: () => { + setState('stableVolume', !state.stableVolume); + quickSwitch(); + } + })} + + ${ToggleSwitch({ + id: "enforcePipedSwitch", + name: 'settings_enforce_piped', + checked: state.enforcePiped, + handler: () => { + setState('enforcePiped', !state.enforcePiped); + quickSwitch(); + } + })} ${ToggleSwitch({ - id: "enforceProxySwitch", - name: 'settings_always_proxy_streams', - checked: state.enforceProxy, - handler: () => { - setState('enforceProxy', !state.enforceProxy); - quickSwitch(); - } - })} + id: "enforceProxySwitch", + name: 'settings_always_proxy_streams', + checked: state.enforceProxy, + handler: () => { + setState('enforceProxy', !state.enforceProxy); + quickSwitch(); + } + })} ` : html``} ${ToggleSwitch({ - id: "HLS_Switch", - name: 'settings_hls', - checked: state.HLS, - handler: () => { - setState('HLS', !state.HLS); - notify(i18n('settings_reload')); - } - })} + id: "HLS_Switch", + name: 'settings_hls', + checked: state.HLS, + handler: () => { + setState('HLS', !state.HLS); + notify(i18n('settings_reload')); + } + })} ${ToggleSwitch({ - id: "watchModeSwitch", - name: 'settings_watchmode', - checked: Boolean(state.watchMode), - handler: () => { - setState('watchMode', - state.watchMode ? - '' : '144p' - ); - } - })} + id: "watchModeSwitch", + name: 'settings_watchmode', + checked: Boolean(state.watchMode), + handler: () => { + setState('watchMode', + state.watchMode ? + '' : '144p' + ); + } + })} `; } diff --git a/src/lib/store.ts b/src/lib/store.ts index 87086e718..4c3cd416f 100644 --- a/src/lib/store.ts +++ b/src/lib/store.ts @@ -3,6 +3,7 @@ export const params = (new URL(location.href)).searchParams; export let state = { enforceProxy: false, + enforcePiped: false, defaultSuperCollection: 'featured', customInstance: '', stableVolume: false, @@ -72,8 +73,7 @@ export const store: { supportsOpus: Promise