The Morning Walk Poem by Alan Alexander Milne

The Morning Walk Poem by Alan Alexander Milne

the morning walk
close = 20 || referrer_url == null || referrer_url == “”) { videoContent.muted = true; } function createAdDisplayContainer() { adDisplayContainer = new google.ima.AdDisplayContainer(document.getElementById(‘adContainer’)); } function requestAds() { checkAutoplaySupport(); document.getElementById(‘playButton’).style.display = ‘none’; createAdDisplayContainer(); adDisplayContainer.initialize(); adsLoader = new google.ima.AdsLoader(adDisplayContainer); adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.INSECURE); adsLoader.addEventListener( google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, onAdsManagerLoaded, false); adsLoader.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, onAdError, false); } function autoplayChecksResolved() { var adsRequest = new google.ima.AdsRequest(); adsRequest.adTagUrl = vast_code; adsRequest.linearAdSlotWidth = 640; adsRequest.linearAdSlotHeight = 400; adsRequest.nonLinearAdSlotWidth = 300; adsRequest.nonLinearAdSlotHeight = 250; adsRequest.setAdWillAutoPlay(autoplayAllowed); adsRequest.setAdWillPlayMuted(autoplayRequiresMuted); adsLoader.requestAds(adsRequest); } function checkAutoplaySupport() { var playPromise = videoContent.play(); if (playPromise !== undefined) { playPromise.then(onAutoplayWithSoundSuccess).catch(onAutoplayWithSoundFail); } } function onAutoplayWithSoundSuccess() { videoContent.pause(); autoplayAllowed = true; autoplayRequiresMuted = false; autoplayChecksResolved(); } function onAutoplayWithSoundFail() { checkMutedAutoplaySupport(); } function checkMutedAutoplaySupport() { videoContent.volume = 0; videoContent.muted = true; var playPromise = videoContent.play(); if (playPromise !== undefined) { playPromise.then(onMutedAutoplaySuccess).catch(onMutedAutoplayFail); } } function onMutedAutoplaySuccess() { videoContent.pause(); autoplayAllowed = true; autoplayRequiresMuted = true; autoplayChecksResolved(); } function onMutedAutoplayFail() { videoContent.volume = 1; videoContent.muted = false; autoplayAllowed = false; autoplayRequiresMuted = false; autoplayChecksResolved(); } function onAdsManagerLoaded(adsManagerLoadedEvent) { adsManager = adsManagerLoadedEvent.getAdsManager(videoContent); adsManager.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, onAdError); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, onContentPauseRequested); adsManager.addEventListener( google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, onContentResumeRequested); adsManager.addEventListener( google.ima.AdEvent.Type.ALL_ADS_COMPLETED, onAdEvent); adsManager.addEventListener( google.ima.AdEvent.Type.LOADED, onAdEvent); adsManager.addEventListener( google.ima.AdEvent.Type.STARTED, onAdEvent); adsManager.addEventListener( google.ima.AdEvent.Type.COMPLETE, onAdEvent); adsManager.addEventListener( google.ima.AdEvent.Type.USER_CLOSE, onAdEvent); adsManager.addEventListener( google.ima.AdEvent.Type.SKIPPED, onAdEvent); try { adsManager.init(videoContent.offsetWidth, videoContent.offsetHeight, google.ima.ViewMode.NORMAL); adsManager.start(); } catch (adError) { videoContent.play(); } } function onAdEvent(adEvent) { var ad = adEvent.getAd(); switch (adEvent.type) { case google.ima.AdEvent.Type.LOADED: document.getElementById(‘contentElement’).setAttribute(‘style’, ‘display:none;’); document.getElementById(‘adContainer’).setAttribute(‘style’, ‘position: relative; width: 640px; height: 360px; display:block;’); if (!ad.isLinear()) { // Position AdDisplayContainer correctly for overlay. // Use ad.width and ad.height. } break; case google.ima.AdEvent.Type.STARTED: if (ad.isLinear()) { intervalTimer = setInterval( function () { var remainingTime = adsManager.getRemainingTime(); }, 300); // every 300ms } break; case google.ima.AdEvent.Type.COMPLETE: document.getElementById(‘adContainer’).setAttribute(‘style’, ‘display:none’); document.getElementById(‘contentElement’).setAttribute(‘style’, ‘display:block; width:640px; height:360px;’); if (ad.isLinear()) { clearInterval(intervalTimer); } break; case google.ima.AdEvent.Type.USER_CLOSE: document.getElementById(‘adContainer’).setAttribute(‘style’, ‘display:none’); document.getElementById(‘contentElement’).setAttribute(‘style’, ‘display:block; width:640px; height:360px;’); videoContent.play(); break; case google.ima.AdEvent.Type.SKIPPED: document.getElementById(‘adContainer’).setAttribute(‘style’, ‘display:none’); document.getElementById(‘contentElement’).setAttribute(‘style’, ‘display:block; width:640px; height:360px;’); videoContent.play(); break; } } function onAdError(adErrorEvent) { document.getElementById(‘adContainer’).setAttribute(‘style’, ‘display:none’); document.getElementById(‘contentElement’).setAttribute(‘style’, ‘display:block; width:640px; height:360px;’); videoContent.play(); console.log(adErrorEvent.getError()); } function onContentPauseRequested() { videoContent.pause(); } function onContentResumeRequested() { videoContent.play(); } var promise = videoContent.play(); if (promise !== undefined) { promise.then(_ => { requestAds(); }).catch(error => { videoContent.muted = false; requestAds(); }); } else { requestAds(); } document.getElementById(‘playButton’).onclick = function () { videoContent.muted = false; requestAds(); }; $(document).ready(function(){ $(“#contentElement”).on( “timeupdate”, function(event){ onTrackedVideoFrame(this.currentTime, this.duration); }); }); var midroll = true; function onTrackedVideoFrame(currentTime, duration) { if (currentTime > 20 && midroll) { document.getElementById(“adContainer”).innerHTML = “”; midroll = false; vast_code = ‘https://googleads.g.doubleclick.net/pagead/ads?client=ca-video-pub-3785345259461815&slotname=Poemhunter_Desktop_Midroll&ad_type=video&description_url=http%3A%2F%2Fwww.poemhunter.com&max_ad_duration=30000&videoad_start_delay=0&vpmute=0&vpa=0’; requestAds(); } } ]]>

Autoplay next video

When Anne and I go out a walk,
We hold each other’s hand and talk
Of all the things we mean to do
When Anne and I are forty-two.

And when we’ve thought about a thing,
Like bowling hoops or bicycling,
Or falling down on Anne’s balloon,
We do it in the afternoon.

Source

Leave a Reply