properly set mpv volume on init

This commit is contained in:
jeffvli
2025-12-15 01:01:00 -08:00
parent 88b27fa378
commit bc898d6097
4 changed files with 3 additions and 7 deletions
@@ -89,6 +89,7 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
const properties: Record<string, any> = {
...getMpvProperties(mpvProperties),
speed: speed,
volume: volume,
};
await mpvPlayer?.initialize({
@@ -96,10 +97,6 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
properties,
});
// Set volume from the current app volume
mpvPlayer?.volume(volume);
isInitializedRef.current = true;
// After initialization, populate the queue if currentSrc is available
// Don't override queue if radio is active
const radioState = useRadioStore.getState();
@@ -118,6 +115,8 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
hasPopulatedQueueRef.current = true;
}
}
isInitializedRef.current = true;
};
initializeMpv();