mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 15:52:02 +00:00
refactor(Settings): add audio language setting for player
This commit is contained in:
parent
ba1776b500
commit
a198fe635b
2 changed files with 30 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ const Settings = () => {
|
||||||
subtitlesTextColorInput,
|
subtitlesTextColorInput,
|
||||||
subtitlesBackgroundColorInput,
|
subtitlesBackgroundColorInput,
|
||||||
subtitlesOutlineColorInput,
|
subtitlesOutlineColorInput,
|
||||||
|
audioLanguageSelect,
|
||||||
seekTimeDurationSelect,
|
seekTimeDurationSelect,
|
||||||
bingeWatchingCheckbox,
|
bingeWatchingCheckbox,
|
||||||
playInBackgroundCheckbox,
|
playInBackgroundCheckbox,
|
||||||
|
|
@ -310,6 +311,15 @@ const Settings = () => {
|
||||||
{...subtitlesOutlineColorInput}
|
{...subtitlesOutlineColorInput}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={styles['option-container']}>
|
||||||
|
<div className={styles['option-name-container']}>
|
||||||
|
<div className={styles['label']}>Audio Language</div>
|
||||||
|
</div>
|
||||||
|
<Multiselect
|
||||||
|
className={classnames(styles['option-input-container'], styles['multiselect-container'])}
|
||||||
|
{...audioLanguageSelect}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div className={styles['option-container']}>
|
<div className={styles['option-container']}>
|
||||||
<div className={styles['option-name-container']}>
|
<div className={styles['option-name-container']}>
|
||||||
<div className={styles['label']}>Rewind & Fast-forward duration</div>
|
<div className={styles['label']}>Rewind & Fast-forward duration</div>
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,25 @@ const useProfileSettingsInputs = (profile) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}), [profile.settings]);
|
}), [profile.settings]);
|
||||||
|
const audioLanguageSelect = useDeepEqualMemo(() => ({
|
||||||
|
options: Object.keys(languageNames).map((code) => ({
|
||||||
|
value: code,
|
||||||
|
label: languageNames[code]
|
||||||
|
})),
|
||||||
|
selected: [profile.settings.audioLanguage],
|
||||||
|
onSelect: (event) => {
|
||||||
|
core.transport.dispatch({
|
||||||
|
action: 'Ctx',
|
||||||
|
args: {
|
||||||
|
action: 'UpdateSettings',
|
||||||
|
args: {
|
||||||
|
...profile.settings,
|
||||||
|
audioLanguage: event.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}), [profile.settings]);
|
||||||
const seekTimeDurationSelect = useDeepEqualMemo(() => ({
|
const seekTimeDurationSelect = useDeepEqualMemo(() => ({
|
||||||
options: CONSTANTS.SEEK_TIME_DURATIONS.map((size) => ({
|
options: CONSTANTS.SEEK_TIME_DURATIONS.map((size) => ({
|
||||||
value: `${size}`,
|
value: `${size}`,
|
||||||
|
|
@ -215,6 +234,7 @@ const useProfileSettingsInputs = (profile) => {
|
||||||
subtitlesTextColorInput,
|
subtitlesTextColorInput,
|
||||||
subtitlesBackgroundColorInput,
|
subtitlesBackgroundColorInput,
|
||||||
subtitlesOutlineColorInput,
|
subtitlesOutlineColorInput,
|
||||||
|
audioLanguageSelect,
|
||||||
seekTimeDurationSelect,
|
seekTimeDurationSelect,
|
||||||
bingeWatchingCheckbox,
|
bingeWatchingCheckbox,
|
||||||
playInBackgroundCheckbox,
|
playInBackgroundCheckbox,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue