console.log('displaySingleVideoUpdated >> prerollUrl found...'); var Ads = function() { this.player = videojs("vid148114_9", options); this.startEvent = 'click'; if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i)) { this.startEvent = 'touchend'; } this.wrapperDiv = document.getElementById("vid148114_9"); this.boundInit = this.init.bind(this); this.wrapperDiv.addEventListener(this.startEvent, this.boundInit); var options = { id: "vid148114_9", adsManagerLoadedCallback: this.adsManagerLoadedCallback.bind(this) }; this.player.ima(options); this.player.ready(function(){ this.controlBar.removeChild('fullscreenToggle'); this.controlBar.addChild('QualitySelector'); this.controlBar.addChild('fullscreenToggle'); this.src([ { src: "https://dehayf5mhw1h7.cloudfront.net/wp-content/uploads/sites/1527/2026/04/28210733/new-berlin-vs-pleasant-plains-baseball_21e301.mp4", type: 'video/mp4', label: "720p", }, { src: "https://dehayf5mhw1h7.cloudfront.net/wp-content/uploads/sites/1527/2026/04/28210733/new-berlin-vs-pleasant-plains-baseball_f0689c.mp4", type: 'video/mp4', label: "406p", }, { src: "https://dehayf5mhw1h7.cloudfront.net/wp-content/uploads/sites/1527/2026/04/28210733/new-berlin-vs-pleasant-plains-baseball_3ac9ea9.mp4", type: 'video/mp4', label: "270p", }, { src: "https://dehayf5mhw1h7.cloudfront.net/wp-content/uploads/sites/1527/2026/04/28210733/new-berlin-vs-pleasant-plains-baseball_897776.mp4", type: 'video/mp4', label: "180p", }, ]); this.socialShare({ // WPB-1169. facebook: { shareUrl: 'https://www.channel1450.com/video/new-berlin-vs-pleasant-plains-baseball-2/', shareImage: '', shareText: '', app_id: '', }, twitter: { handle: '', shareUrl: 'https://www.channel1450.com/video/new-berlin-vs-pleasant-plains-baseball-2/', shareText: '' }, embed: { embedMarkup: 'hid-extra-embed-div-9' // required WPB-1169. } }); // End of socialShare. this.overlay({ overlays:[{ start:'ready', content:'New Berlin vs Pleasant Plains Baseball', end:'playing', align:'top-left' }, { content:'New Berlin vs Pleasant Plains Baseball', start:'pause', end:'play', align:"top-left", }] }); this.on("timeupdate", function (e) { durationTimeGlobal9 = this.currentTime(); }); this.on("play", function (e) { // WPB-5854. e.preventDefault(); // console.log('play button click...'); alert('play click......'); var vid_player = this; var durationTime = vid_player.currentTime(); var total_duration = vid_player.duration(); console.log('play button click... 148114 : '+durationTime+' : '+total_duration); if (ads_video_found9) { console.log('ads found...'); return; } else { console.log('ads NOT found... displaySingleVideoUpdated'); /*vid_player.play();*/ } // collect stats. jQuery.collectStats_Video(vid_player, '148114', 'play', durationTime, uuidVid9, '9',total_duration); pollingInterval_Video9 = setInterval(function(){ durationTime = vid_player.currentTime(); var total_duration = vid_player.duration(); jQuery.collectStats_Video(vid_player, '148114', 'play_interval', durationTime, uuidVid9, '9',total_duration); }, 5000 ); }); this.on("vast-preroll-removed", function (e) { e.preventDefault(); //console.log('play button click...'); ads_video_found9 = true; var vid_player = this; //alert(vid_player.vast.prerollURL); if (durationTimeGlobal9 != -1) { //pause and play again same video. This is when there is no preroll ads. var durationTime = durationTimeGlobal9; var total_duration = vid_player.duration(); jQuery.collectStats_Video(this, '148114', 'play_interval', durationTime, uuidVid9, '9',total_duration); } else { var durationTime = -1; var total_duration = vid_player.duration(); jQuery.collectStats_Video(this, '148114', 'vast-preroll-removed', durationTime, uuidVid9, '9',total_duration); } //check every 5 seconds and update stats for particular video player and for particular user. pollingInterval_Video9 = setInterval(function(){ //durationTime = vid_player.duration(); //get duration every 5 seconds. var durationTime = vid_player.currentTime(); //durationTime = durationTimeGlobal9; var total_duration = vid_player.duration(); jQuery.collectStats_Video(vid_player, '148114', 'play_interval', durationTime, uuidVid9, '9',total_duration); }, 5000 ); }); this.on("pause", function (e) { e.preventDefault(); /*console.log('pause button click or video ended...');*/ clearInterval(pollingInterval_Video9); //clear interval when pause or end. videoEvent9 = 'pause'; if (actualVideoPlay9) { /*if actual video then only fire collect stats, donot fire for preroll. */ } else { return; } //var durationTime = this.duration(); //get end or pause duration. var durationTime = this.currentTime(); var total_duration = this.duration(); jQuery.collectStats_Video(this, '148114' , 'pause', durationTime, uuidVid9, '9',total_duration); }); this.on("ended", function (e) { e.preventDefault(); /*console.log('ended event called...'); */ clearInterval(pollingInterval_Video9); /*clear interval when pause or end.*/ videoEvent9 = 'ended'; }); }); } Ads.prototype.initFromStart = function() { if (!this.initialized) { this.init(); this.wrapperDiv.removeEventListener( this.startEvent, this.boundInitFromStart); } } Ads.prototype.init = function() { try { this.initialized = true; this.player.ima.initializeAdDisplayContainer(); this.player.ima.setContentWithAdTag(null, 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/21422154/HighlightsTopStories&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=[referrer_url]&description_url=[description_url]&correlator=&cust_params=view%3Dvideo%26title%3Dnew-berlin-vs-pleasant-plains-baseball-2%26playlist%3D&player=16%3A9+Highlights+and+Top+Story+DFP&vid_t=new-berlin-vs-pleasant-plains-baseball-2&tag=baseball,featured,new-berlin,pleasant-plains', false); this.player.ima.requestAds(); this.wrapperDiv.removeEventListener(this.startEvent, this.boundInit); }catch(e){ /* WPB-1233 */ this.initialized = false; console.log('init in catch : displaySingleVideoUpdated.....'); this.wrapperDiv.removeEventListener(this.startEvent, this.boundInit); /*this.player.play();*/ } }; Ads.prototype.adsManagerLoadedCallback = function() { var events = [google.ima.AdEvent.Type.ALL_ADS_COMPLETED, google.ima.AdEvent.Type.CLICK, google.ima.AdEvent.Type.COMPLETE, google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED, google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED, google.ima.AdEvent.Type.FIRST_QUARTILE, google.ima.AdEvent.Type.LOADED, google.ima.AdEvent.Type.MIDPOINT, google.ima.AdEvent.Type.PAUSED, google.ima.AdEvent.Type.STARTED, google.ima.AdEvent.Type.THIRD_QUARTILE]; for (var index = 0; index < events.length; index++) { this.player.ima.addEventListener( events[index], this.onAdEvent.bind(this)); } this.player.on('adslog', this.onAdLog.bind(this)); }; Ads.prototype.onAdLog = function(data) { //this.log('Ad log: ' + data.data.AdError); }; Ads.prototype.onAdEvent = function(event) { vid_player = this.player; //console.log('event type : '+event.type); if(event.type=='start'){ adPlayed9=true; // console.log('ad started.................'); // ----------------------------- WPB-5920 var prerollIdFromVast = 0; try { var clickThroughUrl_val = event.ad.data.clickThroughUrl; var params = getParamsArrFromURL(clickThroughUrl_val); prerollIdFromVast = params['wpb_pId']; // preroll id from get_vast }catch(ex){ console.log(ex); } console.log('prerollIdFromVast : '+prerollIdFromVast); //var hiddenVal = jQuery('#hid-extra-vid-9').val(); //var hidExtraInfoArr = getHidExtraInfo_Video_Common(9); var new_hidden_extra_vid_value = changeHidExtraInfo_Video_Common(9,'p_id',prerollIdFromVast); if (new_hidden_extra_vid_value) { jQuery('#hid-extra-vid-9').val(new_hidden_extra_vid_value); } // ----------------------------- actualVideoPlay9 = false; jQuery( "#vid148114_9 .vjs-overlay-bottom-left-ready" ).hide(); jQuery( "#vid148114_9 .vjs-overlay-bottom-left" ).hide(); pollingInterval_Video9 = setInterval(function(){ durationTime = vid_player.currentTime(); var total_duration = vid_player.duration(); jQuery.collectStats_Video(vid_player, '148114', 'play_interval', durationTime, uuidVid9, '9',total_duration); }, 5000 ); }else if(event.type=='complete' || event.type=='allAdsCompleted'){ actualVideoPlay9 = true; videoEvent9 = 'play'; pollingInterval_Video9 = setInterval(function(){ durationTime = vid_player.currentTime(); var total_duration = vid_player.duration(); jQuery.collectStats_Video(vid_player, '148114', 'play_interval', durationTime, uuidVid9, '9',total_duration); }, 5000 ); } }; var vidAds = new Ads();
Pleasant Plains baseball won its 11th straight and moved within one win of a Sangamo conference title with a 14-1 victory over New Berlin on Tuesday. Drew Green got the win and drove in three runs for the Cardinals who host Williamsville on Thursday looking to lock up the outright Sangamo crown.
