mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-21 07:22:17 +00:00
update subtitle defaults
This commit is contained in:
parent
66f0a3b95b
commit
0ed041fe93
4 changed files with 45 additions and 42 deletions
|
|
@ -1159,8 +1159,8 @@
|
||||||
"title": "Subtitles",
|
"title": "Subtitles",
|
||||||
"textBoldLabel": "Bold text",
|
"textBoldLabel": "Bold text",
|
||||||
"verticalPositionLabel": "Vertical position",
|
"verticalPositionLabel": "Vertical position",
|
||||||
"default": "Default",
|
"high": "High",
|
||||||
"low": "Low",
|
"low": "Default",
|
||||||
"textStyle": {
|
"textStyle": {
|
||||||
"title": "Text style",
|
"title": "Text style",
|
||||||
"default": "Default",
|
"default": "Default",
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import { useProgressBar } from "@/hooks/useProgressBar";
|
||||||
import { usePlayerStore } from "@/stores/player/store";
|
import { usePlayerStore } from "@/stores/player/store";
|
||||||
import { usePreferencesStore } from "@/stores/preferences";
|
import { usePreferencesStore } from "@/stores/preferences";
|
||||||
import { SubtitleStyling, useSubtitleStore } from "@/stores/subtitles";
|
import { SubtitleStyling, useSubtitleStore } from "@/stores/subtitles";
|
||||||
|
import { isFirefox } from "@/utils/detectFeatures";
|
||||||
|
|
||||||
export function ColorOption(props: {
|
export function ColorOption(props: {
|
||||||
color: string;
|
color: string;
|
||||||
|
|
@ -423,10 +424,12 @@ export function CaptionSettingsView({
|
||||||
const resetSubStyling = () => {
|
const resetSubStyling = () => {
|
||||||
subtitleStore.updateStyling({
|
subtitleStore.updateStyling({
|
||||||
color: "#ffffff",
|
color: "#ffffff",
|
||||||
backgroundOpacity: 0.5,
|
backgroundOpacity: 0.25,
|
||||||
size: 1,
|
size: 0.75,
|
||||||
backgroundBlur: 0.5,
|
backgroundBlur: 0.25,
|
||||||
|
backgroundBlurEnabled: !isFirefox,
|
||||||
bold: false,
|
bold: false,
|
||||||
|
verticalPosition: 1,
|
||||||
fontStyle: "default",
|
fontStyle: "default",
|
||||||
borderThickness: 1,
|
borderThickness: 1,
|
||||||
});
|
});
|
||||||
|
|
@ -635,23 +638,6 @@ export function CaptionSettingsView({
|
||||||
{t("settings.subtitles.verticalPositionLabel")}
|
{t("settings.subtitles.verticalPositionLabel")}
|
||||||
</Menu.FieldTitle>
|
</Menu.FieldTitle>
|
||||||
<div className="flex justify-center items-center space-x-2">
|
<div className="flex justify-center items-center space-x-2">
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className={classNames(
|
|
||||||
"px-3 py-1 rounded transition-colors duration-100",
|
|
||||||
styling.verticalPosition === 3
|
|
||||||
? "bg-video-context-buttonFocus"
|
|
||||||
: "bg-video-context-buttonFocus bg-opacity-0 hover:bg-opacity-50",
|
|
||||||
)}
|
|
||||||
onClick={() =>
|
|
||||||
handleStylingChange({
|
|
||||||
...styling,
|
|
||||||
verticalPosition: 3,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{t("settings.subtitles.default")}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={classNames(
|
className={classNames(
|
||||||
|
|
@ -669,6 +655,23 @@ export function CaptionSettingsView({
|
||||||
>
|
>
|
||||||
{t("settings.subtitles.low")}
|
{t("settings.subtitles.low")}
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={classNames(
|
||||||
|
"px-3 py-1 rounded transition-colors duration-100",
|
||||||
|
styling.verticalPosition === 3
|
||||||
|
? "bg-video-context-buttonFocus"
|
||||||
|
: "bg-video-context-buttonFocus bg-opacity-0 hover:bg-opacity-50",
|
||||||
|
)}
|
||||||
|
onClick={() =>
|
||||||
|
handleStylingChange({
|
||||||
|
...styling,
|
||||||
|
verticalPosition: 3,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{t("settings.subtitles.high")}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ export function CaptionsPart(props: {
|
||||||
backgroundBlur: 0.5,
|
backgroundBlur: 0.5,
|
||||||
backgroundBlurEnabled: !isFirefox,
|
backgroundBlurEnabled: !isFirefox,
|
||||||
bold: false,
|
bold: false,
|
||||||
verticalPosition: 3,
|
verticalPosition: 1,
|
||||||
fontStyle: "default",
|
fontStyle: "default",
|
||||||
borderThickness: 1,
|
borderThickness: 1,
|
||||||
});
|
});
|
||||||
|
|
@ -327,23 +327,6 @@ export function CaptionsPart(props: {
|
||||||
{t("settings.subtitles.verticalPositionLabel")}
|
{t("settings.subtitles.verticalPositionLabel")}
|
||||||
</Menu.FieldTitle>
|
</Menu.FieldTitle>
|
||||||
<div className="flex justify-center items-center space-x-2">
|
<div className="flex justify-center items-center space-x-2">
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className={classNames(
|
|
||||||
"px-3 py-1 rounded transition-colors duration-100",
|
|
||||||
props.styling.verticalPosition === 3
|
|
||||||
? "bg-video-context-buttonFocus"
|
|
||||||
: "bg-video-context-buttonFocus bg-opacity-0 hover:bg-opacity-50",
|
|
||||||
)}
|
|
||||||
onClick={() =>
|
|
||||||
handleStylingChange({
|
|
||||||
...props.styling,
|
|
||||||
verticalPosition: 3,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{t("settings.subtitles.default")}
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={classNames(
|
className={classNames(
|
||||||
|
|
@ -361,6 +344,23 @@ export function CaptionsPart(props: {
|
||||||
>
|
>
|
||||||
{t("settings.subtitles.low")}
|
{t("settings.subtitles.low")}
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={classNames(
|
||||||
|
"px-3 py-1 rounded transition-colors duration-100",
|
||||||
|
props.styling.verticalPosition === 3
|
||||||
|
? "bg-video-context-buttonFocus"
|
||||||
|
: "bg-video-context-buttonFocus bg-opacity-0 hover:bg-opacity-50",
|
||||||
|
)}
|
||||||
|
onClick={() =>
|
||||||
|
handleStylingChange({
|
||||||
|
...props.styling,
|
||||||
|
verticalPosition: 3,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{t("settings.subtitles.high")}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ export const useSubtitleStore = create(
|
||||||
backgroundBlur: 0.5,
|
backgroundBlur: 0.5,
|
||||||
backgroundBlurEnabled: !isFirefox,
|
backgroundBlurEnabled: !isFirefox,
|
||||||
bold: false,
|
bold: false,
|
||||||
verticalPosition: 3,
|
verticalPosition: 1,
|
||||||
fontStyle: "default",
|
fontStyle: "default",
|
||||||
borderThickness: 1,
|
borderThickness: 1,
|
||||||
},
|
},
|
||||||
|
|
@ -147,7 +147,7 @@ export const useSubtitleStore = create(
|
||||||
backgroundBlur: 0.5,
|
backgroundBlur: 0.5,
|
||||||
backgroundBlurEnabled: !isFirefox,
|
backgroundBlurEnabled: !isFirefox,
|
||||||
bold: false,
|
bold: false,
|
||||||
verticalPosition: 3,
|
verticalPosition: 1,
|
||||||
fontStyle: "default",
|
fontStyle: "default",
|
||||||
borderThickness: 1,
|
borderThickness: 1,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue