MCPcopy
hub / github.com/ampproject/amphtml / pauseVideo

Function pauseVideo

ads/google/ima/ima-video.js:1140–1158  ·  view source on GitHub ↗
(event = null)

Source from the content-addressed store, hash-verified

1138 * @visibleForTesting
1139 */
1140export 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

Callers 2

onPlayPauseClickFunction · 0.85
onMessageFunction · 0.85

Calls 5

showControlsFunction · 0.85
toggleRootDataAttributeFunction · 0.85
removeEventListenerMethod · 0.80
postMessageFunction · 0.70
pauseMethod · 0.45

Tested by

no test coverage detected