feat: add ass subtitles styling setting

This commit is contained in:
Tim 2025-11-21 09:11:35 +01:00
parent c3f1f6c911
commit e8bee4997a
4 changed files with 29 additions and 0 deletions

View file

@ -346,6 +346,7 @@ const Player = ({ urlParams, queryParams }) => {
forceTranscoding: forceTranscoding || casting,
maxAudioChannels: settings.surroundSound ? 32 : 2,
hardwareDecoding: settings.hardwareDecoding,
assSubtitlesStyling: settings.assSubtitlesStyling,
videoMode: settings.videoMode,
platform: platform.name,
streamingServerURL: streamingServer.baseUrl ?

View file

@ -19,6 +19,7 @@ const Player = forwardRef<HTMLDivElement, Props>(({ profile }: Props, ref) => {
subtitlesTextColorInput,
subtitlesBackgroundColorInput,
subtitlesOutlineColorInput,
assSubtitlesStylingToggle,
audioLanguageSelect,
surroundSoundToggle,
seekTimeDurationSelect,
@ -65,6 +66,15 @@ const Player = forwardRef<HTMLDivElement, Props>(({ profile }: Props, ref) => {
{...subtitlesOutlineColorInput}
/>
</Option>
{
shell.active &&
<Option label={'SETTINGS_ASS_SUBTITLES_STYLING'}>
<Toggle
tabIndex={-1}
{...assSubtitlesStylingToggle}
/>
</Option>
}
</Category>
<Category icon={'volume-medium'} label={'SETTINGS_SECTION_AUDIO'}>
<Option label={'SETTINGS_DEFAULT_AUDIO_TRACK'}>

View file

@ -92,6 +92,22 @@ const usePlayerOptions = (profile: Profile) => {
}
}), [profile.settings]);
const assSubtitlesStylingToggle = useMemo(() => ({
checked: profile.settings.assSubtitlesStyling,
onClick: () => {
core.transport.dispatch({
action: 'Ctx',
args: {
action: 'UpdateSettings',
args: {
...profile.settings,
assSubtitlesStyling: !profile.settings.assSubtitlesStyling
}
}
});
}
}), [profile.settings]);
const subtitlesOutlineColorInput = useMemo(() => ({
value: profile.settings.subtitlesOutlineColor,
onChange: (value: string) => {
@ -341,6 +357,7 @@ const usePlayerOptions = (profile: Profile) => {
subtitlesTextColorInput,
subtitlesBackgroundColorInput,
subtitlesOutlineColorInput,
assSubtitlesStylingToggle,
audioLanguageSelect,
surroundSoundToggle,
seekTimeDurationSelect,

View file

@ -42,6 +42,7 @@ type Settings = {
subtitlesOutlineColor: string,
subtitlesSize: number,
subtitlesTextColor: string,
assSubtitlesStyling: boolean,
surroundSound: boolean,
pauseOnMinimize: boolean,
};