mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-19 01:44:00 +02:00
properly set mpv volume on init
This commit is contained in:
@@ -89,6 +89,7 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
|
|||||||
const properties: Record<string, any> = {
|
const properties: Record<string, any> = {
|
||||||
...getMpvProperties(mpvProperties),
|
...getMpvProperties(mpvProperties),
|
||||||
speed: speed,
|
speed: speed,
|
||||||
|
volume: volume,
|
||||||
};
|
};
|
||||||
|
|
||||||
await mpvPlayer?.initialize({
|
await mpvPlayer?.initialize({
|
||||||
@@ -96,10 +97,6 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
|
|||||||
properties,
|
properties,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set volume from the current app volume
|
|
||||||
mpvPlayer?.volume(volume);
|
|
||||||
isInitializedRef.current = true;
|
|
||||||
|
|
||||||
// After initialization, populate the queue if currentSrc is available
|
// After initialization, populate the queue if currentSrc is available
|
||||||
// Don't override queue if radio is active
|
// Don't override queue if radio is active
|
||||||
const radioState = useRadioStore.getState();
|
const radioState = useRadioStore.getState();
|
||||||
@@ -118,6 +115,8 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
|
|||||||
hasPopulatedQueueRef.current = true;
|
hasPopulatedQueueRef.current = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isInitializedRef.current = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
initializeMpv();
|
initializeMpv();
|
||||||
|
|||||||
@@ -111,4 +111,3 @@ export const openCreateRadioStationModal = (
|
|||||||
title: t('action.createRadioStation', { postProcess: 'titleCase' }) as string,
|
title: t('action.createRadioStation', { postProcess: 'titleCase' }) as string,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -38,4 +38,3 @@ export const RadioListHeader = ({ title }: RadioListHeaderProps) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -40,4 +40,3 @@ const RadioListRouteWithBoundary = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default RadioListRouteWithBoundary;
|
export default RadioListRouteWithBoundary;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user