Only play automatically on enabling PFL.
This commit is contained in:
parent
e5358c7cff
commit
658ef5f1eb
1 changed files with 7 additions and 5 deletions
|
@ -760,12 +760,14 @@ export const setChannelPFL = (
|
||||||
player: number,
|
player: number,
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
): AppThunk => async (dispatch) => {
|
): AppThunk => async (dispatch) => {
|
||||||
if (typeof audioEngine.players[player] !== "undefined") {
|
if (
|
||||||
if (!audioEngine.players[player]?.isPlaying) {
|
enabled &&
|
||||||
|
typeof audioEngine.players[player] !== "undefined" &&
|
||||||
|
!audioEngine.players[player]?.isPlaying
|
||||||
|
) {
|
||||||
dispatch(setVolume(player, "off", false));
|
dispatch(setVolume(player, "off", false));
|
||||||
dispatch(play(player));
|
dispatch(play(player));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dispatch(mixerState.actions.setPlayerPFL({ player, enabled }));
|
dispatch(mixerState.actions.setPlayerPFL({ player, enabled }));
|
||||||
audioEngine.setPFL(player, enabled);
|
audioEngine.setPFL(player, enabled);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue