Add --idle to default mpv parameters (#76)

This commit is contained in:
jeffvli 2023-05-20 14:40:55 -07:00
parent fe59011882
commit 7dd56bfb9b
2 changed files with 4 additions and 2 deletions

View File

@ -315,7 +315,7 @@ const prefetchPlaylistParams = [
];
const DEFAULT_MPV_PARAMETERS = (extraParameters?: string[]) => {
const parameters = [];
const parameters = ['--idle=yes'];
if (!extraParameters?.some((param) => prefetchPlaylistParams.includes(param))) {
parameters.push('--prefetch-playlist=yes');
@ -330,6 +330,7 @@ const createMpv = (data: { extraParameters?: string[]; properties?: Record<strin
const { extraParameters, properties } = data;
const params = uniq([...DEFAULT_MPV_PARAMETERS(extraParameters), ...(extraParameters || [])]);
console.log('Setting mpv params: ', params);
mpvInstance = new MpvAPI(
{
@ -341,6 +342,7 @@ const createMpv = (data: { extraParameters?: string[]; properties?: Record<strin
params,
);
console.log('Setting mpv properties: ', properties);
mpvInstance.setMultipleProperties(properties || {});
mpvInstance.start().catch((error) => {

View File

@ -42,7 +42,7 @@ export const App = () => {
const extraParameters = useSettingsStore.getState().playback.mpvExtraParameters;
const properties = {
...getMpvProperties(useSettingsStore.getState().playback.mpvProperties),
volume: usePlayerStore.getState().volume,
volume: usePlayerStore.getState().volume || 50,
};
mpvPlayer?.initialize({