Skip to content

Commit 5ea170a

Browse files
committed
web: deprecate youtube HLS, enable it only via env variable
it's now disabled by default because if we ever need HLS for youtube in the future, it'll be managed by the processing instance, not the web client. will probably be removed completely in next major release.
1 parent 863d39d commit 5ea170a

File tree

4 files changed

+30
-21
lines changed

4 files changed

+30
-21
lines changed

web/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ them, you must specify them when building the frontend (or running a vite server
1212

1313
`WEB_DEFAULT_API` is **required** to run cobalt frontend.
1414

15-
| name | example | description |
16-
|:---------------------|:----------------------------|:--------------------------------------------------------------------------------------------|
17-
| `WEB_HOST` | `cobalt.tools` | domain on which the frontend will be running. used for meta tags and configuring plausible. |
18-
| `WEB_PLAUSIBLE_HOST` | `plausible.io`* | enables plausible analytics with provided hostname as receiver backend. |
19-
| `WEB_DEFAULT_API` | `https://api.cobalt.tools/` | changes url which is used for api requests by frontend clients. |
15+
| name | example | description |
16+
|:--------------------------------|:----------------------------|:--------------------------------------------------------------------------------------------------------|
17+
| `WEB_HOST` | `cobalt.tools` | domain on which the frontend will be running. used for meta tags and configuring plausible. |
18+
| `WEB_PLAUSIBLE_HOST` | `plausible.io`* | enables plausible analytics with provided hostname as receiver backend. |
19+
| `WEB_DEFAULT_API` | `https://api.cobalt.tools/` | changes url which is used for api requests by frontend clients. |
20+
| `ENABLE_DEPRECATED_YOUTUBE_HLS` | `true` | enables the youtube HLS settings entry; allows sending the related variable to the processing instance. |
2021

2122
\* don't use plausible.io as receiver backend unless you paid for their cloud service.
2223
use your own domain when hosting community edition of plausible. refer to their [docs](https://plausible.io/docs) when needed.

web/src/lib/api/saving-handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import env from "$lib/env";
12
import API from "$lib/api/api";
23
import settings from "$lib/state/settings";
34
import lazySettingGetter from "$lib/settings/lazy-get";
@@ -60,7 +61,7 @@ export const savingHandler = async ({ url, request, oldTaskId }: SavingHandlerAr
6061

6162
youtubeVideoCodec: getSetting("save", "youtubeVideoCodec"),
6263
videoQuality: getSetting("save", "videoQuality"),
63-
youtubeHLS: getSetting("save", "youtubeHLS"),
64+
youtubeHLS: env.ENABLE_DEPRECATED_YOUTUBE_HLS ? getSetting("save", "youtubeHLS") : undefined,
6465

6566
convertGif: getSetting("save", "convertGif"),
6667
allowH265: getSetting("save", "allowH265"),

web/src/lib/env.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ const getEnv = (_key: string) => {
99
}
1010
}
1111

12+
const getEnvBool = (key: string) => {
13+
return getEnv(key) === "true";
14+
}
15+
1216
const variables = {
1317
HOST: getEnv('HOST'),
1418
PLAUSIBLE_HOST: getEnv('PLAUSIBLE_HOST'),
1519
PLAUSIBLE_ENABLED: getEnv('HOST') && getEnv('PLAUSIBLE_HOST'),
1620
DEFAULT_API: getEnv('DEFAULT_API'),
17-
// temporary variable until webcodecs features are ready for testing
18-
ENABLE_WEBCODECS: !!getEnv('ENABLE_WEBCODECS'),
21+
ENABLE_WEBCODECS: getEnvBool('ENABLE_WEBCODECS'),
22+
ENABLE_DEPRECATED_YOUTUBE_HLS: getEnvBool('ENABLE_DEPRECATED_YOUTUBE_HLS'),
1923
}
2024

2125
const contacts = {

web/src/routes/settings/video/+page.svelte

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import env from "$lib/env";
23
import settings from "$lib/state/settings";
34
import { t } from "$lib/i18n/translations";
45
@@ -54,20 +55,22 @@
5455
</Switcher>
5556
</SettingsCategory>
5657

57-
<SettingsCategory
58-
sectionId="youtube-hls"
59-
title={$t("settings.video.youtube.hls")}
60-
disabled={$settings.save.youtubeVideoCodec === "av1"}
61-
beta
62-
>
63-
<SettingsToggle
64-
settingContext="save"
65-
settingId="youtubeHLS"
66-
title={$t("settings.video.youtube.hls.title")}
67-
description={$t("settings.video.youtube.hls.description")}
58+
{#if env.ENABLE_DEPRECATED_YOUTUBE_HLS}
59+
<SettingsCategory
60+
sectionId="youtube-hls"
61+
title={$t("settings.video.youtube.hls")}
6862
disabled={$settings.save.youtubeVideoCodec === "av1"}
69-
/>
70-
</SettingsCategory>
63+
beta
64+
>
65+
<SettingsToggle
66+
settingContext="save"
67+
settingId="youtubeHLS"
68+
title={$t("settings.video.youtube.hls.title")}
69+
description={$t("settings.video.youtube.hls.description")}
70+
disabled={$settings.save.youtubeVideoCodec === "av1"}
71+
/>
72+
</SettingsCategory>
73+
{/if}
7174

7275
<SettingsCategory sectionId="h265" title={$t("settings.video.h265")}>
7376
<SettingsToggle

0 commit comments

Comments
 (0)