displays stopped when track finished

This commit is contained in:
thekingofjibs 2020-03-18 15:33:01 +00:00 committed by Marks Polakovs
parent 2764bb60c8
commit 2fff0b7be0

View file

@ -95,6 +95,7 @@ export const play = (player: number): AppThunk => dispatch => {
try{
playerSources[player].mediaElement.play();
dispatch(playerState.actions.setPlayerState({ player, state: "playing" }));
playerSources[player].mediaElement.addEventListener("ended", function(){dispatch(playerState.actions.setPlayerState({ player, state: "stopped" }));})
} catch {
console.log("nothing selected/loaded");
}