(function (cjs, an) { var p; // shortcut to reference prototypes var lib={};var ss={};var img={}; lib.ssMetadata = []; // symbols: (lib.bg = function() { this.initialize(img.bg); }).prototype = p = new cjs.Bitmap(); p.nominalBounds = new cjs.Rectangle(0,0,300,250);// helper functions: function mc_symbol_clone() { var clone = this._cloneProps(new this.constructor(this.mode, this.startPosition, this.loop)); clone.gotoAndStop(this.currentFrame); clone.paused = this.paused; clone.framerate = this.framerate; return clone; } function getMCSymbolPrototype(symbol, nominalBounds, frameBounds) { var prototype = cjs.extend(symbol, cjs.MovieClip); prototype.clone = mc_symbol_clone; prototype.nominalBounds = nominalBounds; prototype.frameBounds = frameBounds; return prototype; } (lib.mcVideo = function(mode,startPosition,loop) { this.initialize(mode,startPosition,loop,{}); // timeline functions: this.frame_0 = function() { var playerOptions = { videoURL: "https://adtima-video.zadn.vn/2018/12/d07f8f8f-d1e0-4c9a-9b8b-cd78bcb8d878.mp4", poster: "", canvas:canvas, box:this, autoplay: true, muted: true, is_mobile: false }; var aPlayer = function (obj){ var auto_resize = obj.auto_resize === true ? true : false; var is_zingtv = obj.is_zingtv === true ? true : false; var box = obj.box; var canvas = obj.canvas ? obj.canvas : window.canvas; var unmute_after_replay = obj.unmute_after_replay === true ? true : false; var click_through = obj.clickthrough ? obj.clickthrough : user_clickthrough; var videoURL = obj.videoURL ? obj.videoURL : ""; var posterURL = obj.poster ? obj.poster : ""; var is_mobile = obj.is_mobile === true ? true : false; var offMute = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAAAnRJREFUSA3FVztoG0EQvXMcE8dRwKSw49Ig3LmyMIGQTiAIuFAhhIogdI0LVUGFU4UUrlQEjERUKKQXWIXBYCOVNgG7SpoEEtL5V4iDxFiHMbq8Z1hxWk7avZOEBp5uPzPzdm5nb0emoSdTUIsBCWAVWAAWAcolcAV8Bw6AU6ADDBRz4KxhPMK8BWwCzxS6YrqFRgX4DDhiUH4OIn4N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BXNDkTomyXxMgGRsdGSKSA6clDEUToMA2I+JY4qxUKhUTECgReeEJGTAfe+PwDGAvlzBgrbskAAAAASUVORK5CYII="; var iconPause = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAY9JREFUOBGVk0tOBDEMRCfNd/hIXIEV1+O2XACxGrVYoO4e6A/13K4oYoclj51yueJOMuWwW2mi84QOW1MzRgR3bbvUgkZ7pxy3WEs2R+UQWBXxEKMJg3Qhv16W5W3bthHv+/5V2A1ObhwOXDk9saknQvBKfuy67lkxbF3XFyX3LDIPPDnHWOQnWiimUeEuixHGcWTXRxaZB54/cJf0FSHME93uy/13miaEYqLM2zLcSX4G9EQ+I86j2jzPTBrimdeaErg+o+KJEGIqCtV0Lp6UMyJvDS5YPWyKLCzGOky3VLHMXSJaJIT+7tIS/5X70/zweGDVSinggWVea4m7L8aj6IZlGIYPs0+n07vyHzzzKCWHq68vm+/j0LiBB/lTOo8Nca42rlcRDk7PKP9M/1I8+9NQZmfeBYVvOUYEx8gtSg6XWnw6QuzMmBQHOYUWn7XGwPxuwBCih9749/t8vDORBuOxo9bcsK+cZsQ8UbwTvtnekgWHGIKYOeTtJuQhRAES1pJ3ZG9yzRgxBBLYfgHHT6wsDj7HAQAAAABJRU5ErkJggg=="; var playOver = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACUAAAAwCAYAAACWhbMrAAAAAXNSR0IArs4c6QAAAtdJREFUWAnFmc2LUlEYxmeapEmKPgaUIHFVA7NoMy3azRCRq2ox/0Fu3ApiBO2jhbvmb2hbQf+AiDq4cl0tpAhciAb5NTpOz3P0Xo4XxftxPl54732P3pnz47nXc55Xt7fmcWVx5mkm1VbKHcxKoNhgMPjQ7/fP6vX6FONLKzTSpFdR710ixuPx90aj8Qzja0hZPelyMyUB0oRaxLTdbn/MZrN38TqBt81gLM+yi+EDh2g2m12wHo1GP2yqRqh9ByqXy73vdru/F2Nrqi1B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kis0ijtkDAitYRLQGZwYRlZYZWoJCIoztYRNRF+M0HWQPgEzEX2BrJElgPiCrjelGPnLn/TdnpHpC+RMJAFvb29bpH9dZHHV9LGlifYRyBpZAqQr0hndcZn0hSx9bGnkPQRyRpYA6Yh0RToTPkE3snCNTU7rJ+hsI2Tjgeir/umDvrWEH514x8ZwhPa/lwAFjxSHkHvE7hP/9PE3oA0Hf9TwZEsAAAAASUVORK5CYII="; var muted = obj.muted === false ? false : true; var autoplay = obj.autoplay === false ? false : true; var played = true; canvas.video = this; var bounds = box.nominalBounds; var pt = box.localToGlobal(bounds.x, bounds.y); var tPer = pt.y / canvas.height; var lPer = pt.x / canvas.width; var newT = tPer * canvas.scrollHeight; var newL = lPer * canvas.scrollWidth; var newW = canvas.scrollWidth / canvas.width * bounds.width; var newH = canvas.scrollHeight / canvas.height * bounds.height; var muteDiv; var m_Icon = 10; var w_Icon = 30; muteDiv = document.createElement('div'); muteDiv.id = "mute"; muteDiv.style.width = w_Icon + "px"; muteDiv.style.height = w_Icon + "px"; muteDiv.style.position = "absolute"; muteDiv.style.top = newT + newH - (w_Icon + m_Icon) + "px"; muteDiv.style.left = newL + m_Icon + "px"; muteDiv.style['object-fit'] = "cover"; muteDiv.style['background-image'] = "url(" + (muted ? offMute : onMute) + ")"; muteDiv.style['cursor'] = "pointer"; muteDiv.style['z-index'] = "49"; canvas.parentNode.appendChild(muteDiv); muteDiv.addEventListener("click", function(){ muted = !muted; fnMuteVideo(muted); } ); muteDiv.addEventListener("mouseover", player_over); var playDiv; var m_Play_Icon = 10; var w_Play_Icon = 18; playDiv = document.createElement('div'); playDiv.id = "play_pause_button"; playDiv.style.width = w_Play_Icon + "px"; playDiv.style.height = w_Play_Icon + "px"; playDiv.style.position = "absolute"; playDiv.style.top = newT + newH - (w_Play_Icon + m_Play_Icon) + "px"; playDiv.style.left = newL + newW - (w_Play_Icon + m_Play_Icon) + "px"; playDiv.style['object-fit'] = "cover"; playDiv.style['background-image'] = "url(" + (played ? iconPause : iconPlay) + ")"; playDiv.style['cursor'] = "pointer"; playDiv.style['z-index'] = "49"; canvas.parentNode.appendChild(playDiv); playDiv.addEventListener("click", toogle_video); function toogle_video(){ played = !played; if(played) { fnPlayVideo(); } else { fnPauseVideo(); } } playDiv.addEventListener("mouseover", player_over); var video = document.getElementById('video'); if(!video) { video = document.createElement('video'); if(autoplay) video.autoplay = true; video.src = videoURL; video.style.width = newW + "px"; video.style.height = newH + "px"; video.style.position = "absolute"; video.style.top = newT + "px"; video.style.left = newL + "px"; video.style['object-fit'] = "cover"; video.style.cursor = "pointer"; canvas.parentNode.appendChild(video); video.muted = muted; if(is_mobile) { video.setAttribute('playsinline',true); enableInlineVideo(video); setTimeout(function(){ video.removeAttribute('controls'); }, 500); } } video.addEventListener("click", function(){ if(autoplay || video.isPlay) { click_through(); } else { video.play(); video.isPlay = true; } } ); ///////////////////////////////////////////////////////////////// // config video tracking ///////////////////////////////////////////////////////////////// // tracking percent var trackerObj = {}; var ebVideoStarted = ('getCreativeViewUrl' in window)? getCreativeViewUrl() : ["#"]; var eb25Per_Played = ('getFirstQuatileUrl' in window) ? getFirstQuatileUrl() : ["#"]; var eb50Per_Played = ('getMidpointUrl' in window) ? getMidpointUrl() : ["#"]; var eb75Per_Played = ('getThirdQuatileUrl' in window) ? getThirdQuatileUrl() : ["#"]; var ebVideoFullPlay = ('getCompleteUrl' in window) ? getCompleteUrl() : ["#"]; // tracking second var timeTrackingArr = [ {time:3, link: ''}, {time:10, link: ''}, {time:30, link: ''}, {time:30, link: ('getProgressUrl' in window) ? getProgressUrl() : ["#"]} // pls don't change it :) ]; // sort on time //timeTrackingArr.sortOn('time', Array.DESCENDING); ///////////////////////////////////////////////////////////////// video.addEventListener('timeupdate', function () { var del = Math.round((video.currentTime / video.duration) * 100); var currentTime = video.currentTime; // tracking time (10s, 15s ...) for(var i = 0; i < timeTrackingArr.length; i++) { var trackVO = timeTrackingArr[i]; if(currentTime >= trackVO.time && trackVO.link && !trackVO.isTrack) { console.log("TRACKING: " + trackVO.time + '_Played'); loadTracker(trackVO.link); trackVO.isTrack = true; } } // tracing start, 25%, 50%, 75%, complete if(del == 100 && !trackerObj["ebVideoFullPlay"] && ebVideoFullPlay) // 100% { console.log("TRACKING: ebVideoFullPlay"); trackerObj["ebVideoFullPlay"] = true; loadTracker(ebVideoFullPlay); } else if (del >= 75 && !trackerObj["eb75Per_Played"] && eb75Per_Played) // 75% { console.log("TRACKING: eb75Per_Played"); trackerObj["eb75Per_Played"] = true; loadTracker(eb75Per_Played); } else if (del >= 50 && !trackerObj["eb50Per_Played"] && eb50Per_Played) // 50% { console.log("TRACKING: eb50Per_Played"); trackerObj["eb50Per_Played"] = true; loadTracker(eb50Per_Played); } else if (del >= 25 && !trackerObj["eb25Per_Played"] && eb25Per_Played) // 25% { console.log("TRACKING: eb25Per_Played"); trackerObj["eb25Per_Played"] = true; loadTracker(eb25Per_Played); } else if (del >= 0 && !trackerObj["ebVideoStarted"] && ebVideoStarted) // 0% { console.log("TRACKING: ebVideoStarted"); trackerObj["ebVideoStarted"] = true; loadTracker(ebVideoStarted); } }, 0); function loadTracker(param) { if(Array.isArray(param)) { for(var i = 0; i < param.length; i++) { iTracker(param[i]); } } else { iTracker(param); } } function iTracker(val) { if (val.length > 0) { var rnd = Math.floor(Math.random() * 10000000000); val = val.replace('[timestamp]', rnd); var img_tracking = document.createElement('img'); img_tracking.src = '' + val; img_tracking.style.height = '0px'; img_tracking.style.width = '0px'; img_tracking.style.display = 'none'; document.body.appendChild(img_tracking); console.log("iTracker: " + val); } } function clearTrackTag() { trackerObj["ebVideoStarted"] = false; trackerObj["eb25Per_Played"] = false; trackerObj["eb50Per_Played"] = false; trackerObj["eb75Per_Played"] = false; trackerObj["ebVideoFullPlay"] = false; for(var i = 0; i < timeTrackingArr.length; i++) { var trackVO = timeTrackingArr[i]; trackVO.isTrack = false; } } video.addEventListener('ended', function () { clearTrackTag(); muteDiv.style['display'] = "none"; playDiv.style['display'] = "none"; createEndFrame(); // off - Mashead if('fnCloseMasHead' in window) { window.fnCloseMasHead(); } else { try{ window.parent.fnCloseMasHead(); } catch(err) { console.log("Pls add fnCloseMasHead method!"); } } }, 0); var poster; function createPoster(posterURL) { if(!poster) { poster = document.createElement('div'); poster.id = "poster"; poster.style.width = newW + "px"; poster.style.height = newH + "px"; poster.style.position = "absolute"; poster.style.top = newT + "px"; poster.style.left = newL + "px"; poster.style['object-fit'] = "cover"; poster.style['background-size'] = "cover"; poster.style['cursor'] = "pointer"; poster.style['z-index'] = 999; if(posterURL) { poster.style['background-image'] = "url(" + posterURL + ")"; } else { poster.style['background-color'] = "rgba(0,0,0,0)"; } canvas.parentNode.appendChild(poster); var poster_icon = document.createElement('div'); poster_icon.id = "poster_icon"; poster_icon.style.width = "37px"; poster_icon.style.height = "48px"; poster_icon.style.position = "absolute"; poster_icon.style.top = "50%"; poster_icon.style.left = "50%"; poster_icon.style['margin-left'] = "-24px"; poster_icon.style['margin-top'] = "-18px"; poster_icon.style['object-fit'] = "cover"; poster_icon.style['background-size'] = "cover"; poster_icon.style['cursor'] = "pointer"; poster_icon.style['z-index'] = 222; poster_icon.style['background-image'] = "url(" + playOver + ")"; poster.appendChild(poster_icon); if(autoplay) { hide_all_controls(); } else { hide_controls(); } poster.onclick = function () { canvas.video.fnPlayVideo(); }; } } function hide_all_controls() { poster.style['display'] = "none"; if(is_mobile) { muteDiv.style['display'] = "block"; playDiv.style['display'] = "block"; } else { muteDiv.style['display'] = "none"; playDiv.style['display'] = "none"; } } function show_controls() { poster.style['display'] = "none"; muteDiv.style['display'] = "block"; playDiv.style['display'] = "block"; } function hide_controls() { poster.style['display'] = "block"; muteDiv.style['display'] = "none"; playDiv.style['display'] = "none"; } createPoster(posterURL); poster.addEventListener("mouseover", player_over); poster.addEventListener("mouseout", player_out); video.addEventListener("mouseover", player_over); video.addEventListener("mouseout", player_out); function player_over(){ if(poster.style['display'] === "none") { muteDiv.style['display'] = "block"; playDiv.style['display'] = "block"; } } function player_out(){ if(is_mobile) { //playDiv.style['display'] = "block"; //muteDiv.style['display'] = "block"; } else { muteDiv.style['display'] = "none"; playDiv.style['display'] = "none"; } } var end_frame; function createEndFrame() { var newT = tPer * canvas.scrollHeight; var newL = lPer * canvas.scrollWidth; var newW = canvas.scrollWidth / canvas.width * bounds.width; var newH = canvas.scrollHeight / canvas.height * bounds.height; end_frame = document.createElement('div'); end_frame.id = "end_frame"; end_frame.style.width = newW + "px"; end_frame.style.height = newH + "px"; end_frame.style.position = "absolute"; end_frame.style.top = newT + "px"; end_frame.style.left = newL + "px"; end_frame.style['object-fit'] = "cover"; end_frame.style['background-size'] = "cover"; end_frame.style['cursor'] = "pointer"; end_frame.style['z-index'] = 9999; canvas.parentNode.appendChild(end_frame); var overlay = document.createElement('div'); overlay.id = "overlay"; overlay.style.width = "100%"; overlay.style.height = "100%"; overlay.style.position = "absolute"; overlay.style['object-fit'] = "cover"; overlay.style['background-size'] = "cover"; overlay.style['cursor'] = "pointer"; overlay.style['background-color'] = "rgba(0, 0, 0, 0.7)"; overlay.style['z-index'] = 1; end_frame.appendChild(overlay); var replay = document.createElement('div'); replay.id = "replay"; replay.style.width = "77px"; replay.style.height = "30px"; replay.style.position = "absolute"; replay.style['margin-top'] = "-15px"; replay.style['margin-left'] = "-77px"; replay.style.top = "50%"; replay.style.right = "55%"; replay.style['object-fit'] = "cover"; replay.style['background-size'] = "cover"; replay.style['cursor'] = "pointer"; replay.style['background-image'] = "url(" + iconReplay + ")"; replay.style['z-index'] = 2; end_frame.appendChild(replay); var click_more = document.createElement('div'); click_more.id = "click_more"; click_more.style.width = "110px"; click_more.style.height = "30px"; click_more.style.position = "absolute"; click_more.style['margin-top'] = "-15px"; click_more.style.top = "50%"; click_more.style.left = "55%"; click_more.style['object-fit'] = "cover"; click_more.style['background-size'] = "cover"; click_more.style['cursor'] = "pointer"; click_more.style['background-image'] = "url(" + iconReadmore + ")"; click_more.style['z-index'] = 2; end_frame.appendChild(click_more); overlay.onclick = user_clickthrough; click_more.onclick = user_clickthrough; replay.onclick = user_click_replay; } function user_click_replay() { canvas.video.fnReplayVideo(); if(unmute_after_replay) canvas.video.fnMuteVideo(false); } function user_clickthrough() { if('getTargetUrl' in window) { var clickTAG = getTargetUrl(); window.open(clickTAG, "_blank"); } else { if('EB' in window) { EB.clickthrough(); console.log("Call EB.clickthrough()"); } else { console.log('Pls check getTargetUrl method!'); } } } ///////////////////////////////////////////////////// // Resize player ///////////////////////////////////////////////////// window.addEventListener("resize", onResizeHDL); function onResizeHDL() { var newT = tPer * canvas.scrollHeight; var newL = lPer * canvas.scrollWidth; var newW = canvas.scrollWidth / canvas.width * bounds.width; var newH = canvas.scrollHeight / canvas.height * bounds.height; video.style.top = newT + 'px'; video.style.left = newL + 'px'; video.style.width = newW + "px"; video.style.height = newH + "px"; poster.style.top = newT + 'px'; poster.style.left = newL + 'px'; poster.style.width = newW + "px"; poster.style.height = newH + "px"; muteDiv.style.top = newT + newH - (w_Icon + m_Icon) + "px"; muteDiv.style.left = newL + m_Icon + "px"; playDiv.style.top = newT + newH - (w_Play_Icon + m_Play_Icon) + "px"; playDiv.style.left = newL + newW - (w_Play_Icon + m_Play_Icon) + "px"; if(end_frame) { end_frame.style.top = newT + 'px'; end_frame.style.left = newL + 'px'; end_frame.style.width = newW + "px"; end_frame.style.height = newH + "px"; } } ///////////////////////////////////////////////////// // Define public methods ///////////////////////////////////////////////////// this['fnReplayVideo'] = fnReplayVideo; this['fnMuteVideo'] = fnMuteVideo; this['fnVolume'] = fnVolume; this['fnPauseVideo'] = fnPauseVideo; this['fnPlayVideo'] = fnPlayVideo; function fnReplayVideo() { hide_all_controls(); clearTrackTag(); video.currentTime = 0; video.play(); if(end_frame) { canvas.parentNode.removeChild(end_frame); end_frame = null; } } function fnMuteVideo(val) { muted = val; if(video) video.muted = muted; if(muted) { muteDiv.style['background-image'] = "url(" + offMute + ")"; } else { muteDiv.style['background-image'] = "url(" + onMute + ")"; videoClickSound(); } } function videoClickSound() { if(window.parent.adtimaCallBack) { window.parent.adtimaCallBack.videoClickSound({ "muted": false }); console.log('called videoClickSound'); } else { console.log('can not call videoClickSound'); } } function fnVolume(val) { video.volume = val; } function fnPauseVideo() { played = false; video.pause(); playDiv.style['background-image'] = "url(" + iconPlay + ")"; hide_controls(); } function fnPlayVideo() { played = true; video.play(); playDiv.style['background-image'] = "url(" + iconPause + ")"; show_controls(); } } var player = new aPlayer(playerOptions); } // actions tween: this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1)); // bg this.shape = new cjs.Shape(); this.shape.graphics.f("rgba(0,0,153,0.498)").s().p("A1jMIIAA4PMArHAAAIAAYPg"); this.shape.setTransform(150.1,-25.6); this.timeline.addTween(cjs.Tween.get(this.shape).wait(1)); }).prototype = getMCSymbolPrototype(lib.mcVideo, new cjs.Rectangle(1,-88,299,105), null); (lib.clickTAG = function(mode,startPosition,loop) { this.initialize(mode,startPosition,loop,{}); // timeline functions: this.frame_0 = function() { var self = this; self.addEventListener('click', clickTAG); self.cursor = 'pointer'; function clickTAG(evt) { if(evt.nativeEvent && evt.nativeEvent.button==2){ evt.preventDefault(); } else { if('getTargetUrl' in window) { var clickTAG = getTargetUrl(); window.open(clickTAG, "_blank"); } else { console.log('Pls check getTargetUrl method!'); } } } } // actions tween: this.timeline.addTween(cjs.Tween.get(this).call(this.frame_0).wait(1)); // bg this.shape = new cjs.Shape(); this.shape.graphics.f("#000000").s().p("A3bTiMAAAgnDMAu3AAAMAAAAnDg"); this.shape.setTransform(150,125); this.timeline.addTween(cjs.Tween.get(this.shape).wait(1)); }).prototype = getMCSymbolPrototype(lib.clickTAG, new cjs.Rectangle(0,0,300,250), null); (lib.mcMain = function(mode,startPosition,loop) { this.initialize(mode,startPosition,loop,{}); // timeline functions: this.frame_94 = function() { this.stop(); } // actions tween: this.timeline.addTween(cjs.Tween.get(this).wait(94).call(this.frame_94).wait(1)); // mcVideo this.mcVideo = new lib.mcVideo(); this.mcVideo.name = "mcVideo"; this.mcVideo.parent = this; this.mcVideo.setTransform(150,245,1,1,0,0,0,150,125); this.mcVideo.alpha = 0.012; this.timeline.addTween(cjs.Tween.get(this.mcVideo).wait(95)); // clickTAG this.instance = new lib.clickTAG(); this.instance.parent = this; this.instance.setTransform(0,0,1,2.4); this.instance.alpha = 0.012; this.timeline.addTween(cjs.Tween.get(this.instance).wait(95)); // Layer_2 this.instance_1 = new lib.bg(); this.instance_1.parent = this; this.instance_1.setTransform(1,0); this.timeline.addTween(cjs.Tween.get(this.instance_1).wait(95)); }).prototype = p = new cjs.MovieClip(); p.nominalBounds = new cjs.Rectangle(0,0,301,250); // stage content: (lib._300x600_JS_300x600 = function(mode,startPosition,loop) { this.initialize(mode,startPosition,loop,{}); // timeline functions: this.frame_0 = function() { //////////////////////////////////////////////////////////// // Create CSS For Banner //////////////////////////////////////////////////////////// // Create the