mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-14 18:00:32 +01:00
refactor(player): consolidate subtitle settings to use mpvSubtitleScale only
This commit is contained in:
@@ -284,26 +284,10 @@ export default function SettingsTV() {
|
||||
/>
|
||||
<TVSettingsStepper
|
||||
label={t("home.settings.subtitles.subtitle_size")}
|
||||
value={settings.subtitleSize / 100}
|
||||
onDecrease={() => {
|
||||
const newValue = Math.max(0.3, settings.subtitleSize / 100 - 0.1);
|
||||
updateSettings({ subtitleSize: Math.round(newValue * 100) });
|
||||
}}
|
||||
onIncrease={() => {
|
||||
const newValue = Math.min(1.5, settings.subtitleSize / 100 + 0.1);
|
||||
updateSettings({ subtitleSize: Math.round(newValue * 100) });
|
||||
}}
|
||||
formatValue={(v) => `${v.toFixed(1)}x`}
|
||||
/>
|
||||
|
||||
{/* MPV Subtitles Section */}
|
||||
<TVSectionHeader title='MPV Subtitle Settings' />
|
||||
<TVSettingsStepper
|
||||
label='Subtitle Scale'
|
||||
value={settings.mpvSubtitleScale ?? 1.0}
|
||||
onDecrease={() => {
|
||||
const newValue = Math.max(
|
||||
0.5,
|
||||
0.1,
|
||||
(settings.mpvSubtitleScale ?? 1.0) - 0.1,
|
||||
);
|
||||
updateSettings({
|
||||
@@ -312,7 +296,7 @@ export default function SettingsTV() {
|
||||
}}
|
||||
onIncrease={() => {
|
||||
const newValue = Math.min(
|
||||
2.0,
|
||||
3.0,
|
||||
(settings.mpvSubtitleScale ?? 1.0) + 0.1,
|
||||
);
|
||||
updateSettings({
|
||||
|
||||
@@ -1039,15 +1039,6 @@ export default function page() {
|
||||
if (settings.mpvSubtitleAlignY !== undefined) {
|
||||
await videoRef.current?.setSubtitleAlignY?.(settings.mpvSubtitleAlignY);
|
||||
}
|
||||
if (settings.mpvSubtitleFontSize !== undefined) {
|
||||
await videoRef.current?.setSubtitleFontSize?.(
|
||||
settings.mpvSubtitleFontSize,
|
||||
);
|
||||
}
|
||||
// Apply subtitle size from general settings
|
||||
if (settings.subtitleSize) {
|
||||
await videoRef.current?.setSubtitleFontSize?.(settings.subtitleSize);
|
||||
}
|
||||
};
|
||||
|
||||
applySubtitleSettings();
|
||||
|
||||
@@ -905,8 +905,8 @@ export default function TVSubtitleModal() {
|
||||
<View style={styles.settingRow}>
|
||||
<TVStepperControl
|
||||
value={settings.mpvSubtitleScale ?? 1.0}
|
||||
min={0.5}
|
||||
max={2.0}
|
||||
min={0.1}
|
||||
max={3.0}
|
||||
step={0.1}
|
||||
formatValue={(v) => `${v.toFixed(1)}x`}
|
||||
onChange={(newValue) => {
|
||||
|
||||
Reference in New Issue
Block a user