Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/routes/Player/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
Expand Down
10 changes: 10 additions & 0 deletions src/routes/Settings/Player/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const Player = forwardRef<HTMLDivElement, Props>(({ profile }: Props, ref) => {
subtitlesTextColorInput,
subtitlesBackgroundColorInput,
subtitlesOutlineColorInput,
assSubtitlesStylingToggle,
audioLanguageSelect,
surroundSoundToggle,
seekTimeDurationSelect,
Expand Down Expand Up @@ -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'}>
Expand Down
17 changes: 17 additions & 0 deletions src/routes/Settings/Player/usePlayerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -341,6 +357,7 @@ const usePlayerOptions = (profile: Profile) => {
subtitlesTextColorInput,
subtitlesBackgroundColorInput,
subtitlesOutlineColorInput,
assSubtitlesStylingToggle,
audioLanguageSelect,
surroundSoundToggle,
seekTimeDurationSelect,
Expand Down
1 change: 1 addition & 0 deletions src/types/models/Ctx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type Settings = {
subtitlesOutlineColor: string,
subtitlesSize: number,
subtitlesTextColor: string,
assSubtitlesStyling: boolean,
surroundSound: boolean,
pauseOnMinimize: boolean,
};
Expand Down