mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 10:42:12 +00:00
feat: implement transcoding profile
This commit is contained in:
parent
1c57dd3a65
commit
38365339f0
2 changed files with 48 additions and 2 deletions
|
|
@ -49,7 +49,8 @@ const Settings = () => {
|
|||
streamingServerRemoteUrlInput,
|
||||
remoteEndpointSelect,
|
||||
cacheSizeSelect,
|
||||
torrentProfileSelect
|
||||
torrentProfileSelect,
|
||||
transcodingProfileSelect,
|
||||
} = useStreamingServerSettingsInputs(streamingServer);
|
||||
const [configureServerUrlModalOpen, openConfigureServerUrlModal, closeConfigureServerUrlModal] = useBinaryState(false);
|
||||
const configureServerUrlInputRef = React.useRef(null);
|
||||
|
|
@ -612,6 +613,20 @@ const Settings = () => {
|
|||
:
|
||||
null
|
||||
}
|
||||
{
|
||||
transcodingProfileSelect !== null ?
|
||||
<div className={styles['option-container']}>
|
||||
<div className={styles['option-name-container']}>
|
||||
<div className={styles['label']}>{ t('SETTINGS_TRANSCODE_PROFILE') }</div>
|
||||
</div>
|
||||
<Multiselect
|
||||
className={classnames(styles['option-input-container'], styles['multiselect-container'])}
|
||||
{...transcodingProfileSelect}
|
||||
/>
|
||||
</div>
|
||||
:
|
||||
null
|
||||
}
|
||||
</div>
|
||||
<div ref={shortcutsSectionRef} className={styles['section-container']}>
|
||||
<div className={styles['section-title']}>{ t('SETTINGS_NAV_SHORTCUTS') }</div>
|
||||
|
|
|
|||
|
|
@ -167,7 +167,38 @@ const useStreamingServerSettingsInputs = (streamingServer) => {
|
|||
}
|
||||
};
|
||||
}, [streamingServer.settings]);
|
||||
return { streamingServerRemoteUrlInput, remoteEndpointSelect, cacheSizeSelect, torrentProfileSelect };
|
||||
const transcodingProfileSelect = React.useMemo(() => {
|
||||
if (streamingServer.settings?.type !== 'Ready' || streamingServer.deviceInfo?.type !== 'Ready') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
label: t('SETTINGS_DISABLED'),
|
||||
value: null,
|
||||
},
|
||||
...streamingServer.deviceInfo.content.availableHardwareAccelerations.map((name) => ({
|
||||
label: name,
|
||||
value: name,
|
||||
}))
|
||||
],
|
||||
selected: [streamingServer.settings.content.transcodeProfile],
|
||||
onSelect: (event) => {
|
||||
core.transport.dispatch({
|
||||
action: 'StreamingServer',
|
||||
args: {
|
||||
action: 'UpdateSettings',
|
||||
args: {
|
||||
...streamingServer.settings.content,
|
||||
transcodeProfile: event.value,
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}, [streamingServer.settings, streamingServer.deviceInfo]);
|
||||
return { streamingServerRemoteUrlInput, remoteEndpointSelect, cacheSizeSelect, torrentProfileSelect, transcodingProfileSelect };
|
||||
};
|
||||
|
||||
module.exports = useStreamingServerSettingsInputs;
|
||||
|
|
|
|||
Loading…
Reference in a new issue