(event = null)
| 1138 | * @visibleForTesting |
| 1139 | */ |
| 1140 | export function pauseVideo(event = null) { |
| 1141 | if (adsActive) { |
| 1142 | adsManager.pause(); |
| 1143 | } else { |
| 1144 | const {'video': video} = elements; |
| 1145 | video.pause(); |
| 1146 | // Show controls and keep them there because we're paused. |
| 1147 | clearTimeout(hideControlsTimeout); |
| 1148 | showControls(); |
| 1149 | if (event && event.type == 'webkitendfullscreen') { |
| 1150 | // Video was paused because we exited fullscreen. |
| 1151 | video.removeEventListener('webkitendfullscreen', pauseVideo); |
| 1152 | fullscreen = false; |
| 1153 | } |
| 1154 | } |
| 1155 | playerState = PlayerStates.PAUSED; |
| 1156 | postMessage({event: VideoEvents_Enum.PAUSE}); |
| 1157 | toggleRootDataAttribute('playing', false); |
| 1158 | } |
| 1159 | |
| 1160 | /** |
| 1161 | * Handler when the mute/unmute button is clicked |
no test coverage detected