src/index.js
function onFullscreenClick() {
		if (requestFullscreen) {
			if (player === fullscreenElement()) {
				// exit fullscreen
				exitFullscreen().call(document);
			} else {
				// enter fullscreen
				requestFullscreen.call(player);

				// maintain focus in internet explorer
				self.fullscreen.focus();

				// maintain focus in safari
				setTimeout(() => {
					self.fullscreen.focus();
				}, 200);
			}
		} else if (media.webkitSupportsFullscreen) {
			// iOS allows fullscreen of the video itself
			if (media.webkitDisplayingFullscreen) {
				// exit ios fullscreen
				media.webkitExitFullscreen();
			} else {
				// enter ios fullscreen
				media.webkitEnterFullscreen();
			}

			onFullscreenChange();
		}
	}
function onFullscreenClick() {
		if (requestFullscreen) {
			if (player === fullscreenElement()) {
				// exit fullscreen
				exitFullscreen().call(document);
			} else {
				// enter fullscreen
				requestFullscreen.call(player);

				// maintain focus in internet explorer
				self.fullscreen.focus();

				// maintain focus in safari
				setTimeout(() => {
					self.fullscreen.focus();
				}, 200);
			}
		} else if (media.webkitSupportsFullscreen) {
			// iOS allows fullscreen of the video itself
			if (media.webkitDisplayingFullscreen) {
				// exit ios fullscreen
				media.webkitExitFullscreen();
			} else {
				// enter ios fullscreen
				media.webkitEnterFullscreen();
			}

			onFullscreenChange();
		}
	}
function onFullscreenClick ( ) { if ( requestFullscreen ) { if ( player === fullscreenElement ( ) ) { // exit fullscreen exitFullscreen ( ) . call ( document ) ; } else { // enter fullscreen requestFullscreen . call ( player ) ; // maintain focus in internet explorer self . fullscreen . focus ( ) ; // maintain focus in safari setTimeout ( ( ) => { self . fullscreen . focus ( ) ; } , 200 ) ; } } else if ( media . webkitSupportsFullscreen ) { // iOS allows fullscreen of the video itself if ( media . webkitDisplayingFullscreen ) { // exit ios fullscreen media . webkitExitFullscreen ( ) ; } else { // enter ios fullscreen media . webkitEnterFullscreen ( ) ; } onFullscreenChange ( ) ; } }
click from fullscreen control
click from fullscreen control