make sure player is paused when unmounting

This commit is contained in:
Sean Yesmunt 2019-12-04 12:05:33 -05:00
parent e48da1ee4e
commit 27f1b4fa01

View file

@ -133,6 +133,7 @@ function VideoViewer(props: Props) {
// requireRedraw just makes it so the video component is removed from the page _by react_
// Then it's set to false immediately after so we can re-mount a new player
setRequireRedraw(true);
player.pause();
};
}, [videoRef, source, contentType, setRequireRedraw, requireRedraw]);