I have an HTML video that plays full screen when the user clicks play. If the user hits escape inside of full screen, everything works properly - the video stops playing and exits full screen. However, if the user pauses the video inside of full screen and then hits escape, the video starts playing again causing the sound from the video to loop over the page that is returned to upon exiting full screen. My js controls are as follows:
exitHandler: function(){
vid = Video.vid;
$(Video.featuredVideo).toggleClass('featured-video-show');
if (document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement !== null){
if (vid.paused){
vid.play();
}
else {
vid.pause();
}
}
}
How can I stop the video/audio from starting back up if a user pauses inside of full screen and then hits 'escape' to exit full screen?