mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +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> = {
|
||||
...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();
|
||||
|
||||
@@ -111,4 +111,3 @@ export const openCreateRadioStationModal = (
|
||||
title: t('action.createRadioStation', { postProcess: 'titleCase' }) as string,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -38,4 +38,3 @@ export const RadioListHeader = ({ title }: RadioListHeaderProps) => {
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -40,4 +40,3 @@ const RadioListRouteWithBoundary = () => {
|
||||
};
|
||||
|
||||
export default RadioListRouteWithBoundary;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user