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

Function onOverlayButtonInteract

ads/google/ima/ima-video.js:583–601  ·  view source on GitHub ↗
(global)

Source from the content-addressed store, hash-verified

581 * @visibleForTesting
582 */
583export function onOverlayButtonInteract(global) {
584 const {'overlayButton': overlayButton, 'video': video} = elements;
585 if (playbackStarted) {
586 // Resart the video
587 playVideo();
588 } else {
589 // Play the video for the first time
590 playbackStarted = true;
591 uiTicker = setInterval(uiTickerClick, 500);
592 setInterval(playerDataTick, 1000);
593 if (adDisplayContainer) {
594 adDisplayContainer.initialize();
595 }
596 video.load();
597 playAds(global);
598 }
599
600 toggle(overlayButton, false);
601}
602
603// TODO(alanorozco): Update name on test's end.
604export const onBigPlayClick = onOverlayButtonInteract;

Callers 1

onMessageFunction · 0.85

Calls 6

toggleFunction · 0.90
playVideoFunction · 0.85
playAdsFunction · 0.85
setIntervalFunction · 0.50
initializeMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected