| 190 | // If the browser is currently in fullscreen mode, |
| 191 | // then it should exit and vice versa. |
| 192 | function toggleFullScreen() { |
| 193 | if (document.fullscreenElement) { |
| 194 | document.exitFullscreen(); |
| 195 | } else if (document.webkitFullscreenElement) { |
| 196 | // Need this to support Safari |
| 197 | document.webkitExitFullscreen(); |
| 198 | } else if (videoContainer.webkitRequestFullscreen) { |
| 199 | // Need this to support Safari |
| 200 | videoContainer.webkitRequestFullscreen(); |
| 201 | } else { |
| 202 | videoContainer.requestFullscreen(); |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | // updateFullscreenButton changes the icon of the full screen button |
| 207 | // and tooltip to reflect the current full screen state of the video |