web/settings/video: add youtube container settings

This commit is contained in:
wukko 2025-06-20 15:50:30 +06:00
parent 1e5cc353e4
commit 5860c50c59
No known key found for this signature in database
GPG Key ID: 3E30B3F26C7B4AA2
2 changed files with 28 additions and 5 deletions

View File

@ -28,9 +28,12 @@
"video.quality.144": "144p",
"video.quality.description": "if preferred video quality isn't available, next best is picked instead.",
"video.youtube.codec": "youtube codec and container",
"video.youtube.codec": "preferred youtube video codec",
"video.youtube.codec.description": "h264: best compatibility, average quality. max quality is 1080p. \nav1: best quality and efficiency. supports 8k & HDR. \nvp9: same quality as av1, but file is ~2x bigger. supports 4k & HDR.\n\nav1 and vp9 aren't widely supported, you might have to use additional software to play/edit them. cobalt picks next best codec if preferred one isn't available.",
"video.youtube.container": "youtube file container",
"video.youtube.container.description": "when \"auto\" is selected, cobalt will pick the best container automatically depending on selected codec: mp4 for h264; webm for vp9/av1.",
"video.youtube.hls": "youtube hls formats",
"video.youtube.hls.title": "prefer hls for video & audio",
"video.youtube.hls.description": "only h264 and vp9 codecs are available in this mode. original audio codec is aac, it's re-encoded for compatibility, audio quality may be slightly worse than the non-HLS counterpart.\n\nthis option is experimental, it may go away or change in the future.",

View File

@ -3,7 +3,7 @@
import settings from "$lib/state/settings";
import { t } from "$lib/i18n/translations";
import { videoQualityOptions } from "$lib/types/settings";
import { videoQualityOptions, youtubeVideoContainerOptions } from "$lib/types/settings";
import { youtubeVideoCodecOptions } from "$lib/types/settings";
import SettingsCategory from "$components/settings/SettingsCategory.svelte";
@ -12,9 +12,9 @@
import SettingsToggle from "$components/buttons/SettingsToggle.svelte";
const codecTitles = {
h264: "h264 (mp4)",
av1: "av1 (webm)",
vp9: "vp9 (webm)",
h264: "h264 + aac",
av1: "av1 + opus",
vp9: "vp9 + opus",
}
</script>
@ -55,6 +55,26 @@
</Switcher>
</SettingsCategory>
<SettingsCategory
sectionId="youtube-container"
title={$t("settings.video.youtube.container")}
>
<Switcher
big={true}
description={$t("settings.video.youtube.container.description")}
>
{#each youtubeVideoContainerOptions as value}
<SettingsButton
settingContext="save"
settingId="youtubeVideoContainer"
settingValue={value}
>
{value}
</SettingsButton>
{/each}
</Switcher>
</SettingsCategory>
{#if env.ENABLE_DEPRECATED_YOUTUBE_HLS}
<SettingsCategory
sectionId="youtube-hls"