diff --git a/src/showplanner/player/state.ts b/src/showplanner/player/state.ts index e7e401b..d9197fc 100644 --- a/src/showplanner/player/state.ts +++ b/src/showplanner/player/state.ts @@ -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"); }