const init_video_lb=e=>{const t=document.querySelectorAll(".box_embed_video_lightbox");if(t.length>0){let e=0;document.querySelector('meta[name="tt_page_type_new"]')&&"3"==document.querySelector('meta[name="tt_page_type_new"]').getAttribute("content")&&(e=parseInt(document.querySelector('meta[name="tt_article_id"]').getAttribute("content")));for(let i of t)i.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation();const a=+i.getAttribute("data-vid"),o=+i.getAttribute("data-current-time"),n='
\n `,type:"inline",midClick:!0,mainClass:"mfp-with-zoom",fixedContentPos:!1,fixedBgPos:!0,overflowY:"auto",closeBtnInside:!0,preloader:!1,removalDelay:300},callbacks:{open:t=>{const d=new XMLHttpRequest;d.open("GET","https://vnexpress.net/microservice/videoparser/aid/"+(e||i.getAttribute("data-articleoriginal"))+"/vid/"+a,!0),d.onload=function(){if(this.status>=200&&this.status<400)try{const e=document.querySelector("#popup-video-"+a+" .wrap-video-lightbox .thumb-video"),t=JSON.parse(this.response);if(void 0!==t.data&&(e.innerHTML=t.data,setTimeout((e=>{Video.init(),Video.playVideo(a)}),10),o>0)){let e=setInterval((t=>{void 0!==Video.vodIns[a]&&(clearInterval(e),Video.vodIns[a].currentTime(o))}),100);setTimeout((t=>{clearInterval(e)}),5e3)}}catch(e){v.innerHTML=n}else v.innerHTML=n},d.onerror=function(){v.innerHTML=n},d.send()},beforeClose:e=>{document.querySelector('.box_embed_video_lightbox[data-vid="'+a+'"]').setAttribute("data-current-time",Video.vodIns[a].currentTime())},afterClose:e=>{Video.vodIns[a].dispose(),delete Video.vodIns[a]}}})}))}};init_video_lb();var log_url="https://l-saas.vnecdn.net";if(void 0===isHome)var isHome="undefined"!=typeof PAGE_FOLDER&&1e6==PAGE_FOLDER;if(1==isHome)var cycle=setInterval((function(){var e=document.querySelector(".wrap_video");if(null!=e){var t=e.getAttribute("data-article-id"),i=e.getAttribute("data-share-url");void 0!==Video.articleId&&(Video.articleId=t),void 0!==Video.articleId&&(Video.articleUrl=i),clearInterval(cycle)}}),100);var Video={playerArr:{},parentContainer:{},suggestionData:{},videoUrl:window.location.host.indexOf("ngoisao.vnexpress.net")>-1?"https://video.ngoisao.vnexpress.net":(-1!=window.location.hostname.indexOf("demo-")||-1!=window.location.hostname.indexOf("seo.")?"https://demo-":"https://")+"video.vnexpress.net",articleId:1==isHome&&"undefined"!=typeof ARID?ARID:document.querySelector('meta[name="tt_article_id"]').getAttribute("content"),articleUrl:1==isHome&&"undefined"!=typeof ARSU?ARSU:document.querySelector('link[rel="canonical"]')?document.querySelector('link[rel="canonical"]').getAttribute("href"):window.location.href,adsVideoId:0,suggestionVideoId:0,loadAdPlugin:!1,subtileVideoIdArr:[],isMobile:{Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return this.Android()||this.BlackBerry()||this.iOS()||this.Opera()||this.Windows()}},isHtml5Support:function(){return!0},isFlash:function(){return!1},getDataAttributes:function(e){var t={};return[].forEach.call(e.attributes,(function(e){if(/^data-/.test(e.name)){var i=e.name.substr(5).replace(/-(.)/g,(function(e,t){return t.toUpperCase()}));t[i]=e.value}})),t},_fbAppID:"1547540628876392",_forceMute:!1,urlencode:function(e){return e=(e+"").toString(),encodeURIComponent(e).replace(/#!/g,"%23").replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")},shareFB:function(e){var t=document.getElementById("video_parent_"+e);if(t){var i="https://video.vnexpress.net/embed/v_"+e,a=t.querySelector(".box_img_video img").getAttribute("src"),o=t.querySelector(".box_img_video img").getAttribute("alt"),n="https://facebook.com/sharer/sharer.php?u="+this.urlencode(i)+"&p[images][0]="+a+"&t="+o;window.open(n,"_blank","menubar=no,toolbar=no,resizable=no,scrollbars=no,height=450,width=710")}},shareTW:function(e){var t=document.getElementById("video_parent_"+e);if(t){var i="https://video.vnexpress.net/embed/v_"+e,a=t.querySelector(".box_img_video img").getAttribute("alt"),o="https://twitter.com/intent/tweet?source=webclient&url="+this.urlencode(i)+"&text="+a;window.open(o,"_blank","menubar=no,toolbar=no,resizable=no,scrollbars=no,height=450,width=710")}},copyLink:function(e){var t=document.getElementById("embed_video_"+e);if(t){var i="https://video.vnexpress.net/embed/v_"+e,a=document.createElement("input");a.setAttribute("style","opacity:0"),document.body.appendChild(a),a.value=i,a.select(),document.execCommand("copy"),a.remove();var o=t.querySelector(".tip");o.style.display="block",setTimeout((function(){o.style.display="none"}),500);try{navigator.clipboard.writeText(i)}catch(e){}}},initShare:function(e){if("undefined"!=typeof PAGE_DETAIL&&1==PAGE_DETAIL&&"undefined"!=typeof article_type&&8!=article_type&&("demo.vnexpress.net"==location.hostname||"vnexpress.net"==location.hostname)){var t=document.getElementById("video_parent_"+e).querySelector(".share-hover"),i=document.getElementById("embed_video_"+e);if(!t&&i)try{var a=document.createElement("div");a.className="share-hover",a.innerHTML=`\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tCopy link thành công\n\t\t\t\t\t\t\t\t\t\t\t`;var o=i.querySelector(".video-js");o?o.appendChild(a):i.querySelector(".embed-container").appendChild(a)}catch(e){}}},showShare:function(e){if(-1!=e.indexOf("video_parent_"))var t=e.replace("video_parent_","");else t=e.replace("media-video-","");var i=document.getElementById("video_parent_"+t).querySelector(".share-hover");i&&(i.style.display="flex")},hideShare:function(e){if(-1!=e.indexOf("video_parent_"))var t=e.replace("video_parent_","");else t=e.replace("media-video-","");var i=document.getElementById("video_parent_"+t).querySelector(".share-hover");i&&(i.style.display="none")},initDOM:function(e){void 0===e&&(e=0);var t=this,i=document.getElementsByClassName("embed_video_new");if(i.length>0){for(var a=0;a=0?"240"==e.getAttribute("max-mode")?a:a.replace("/mp4/","/mp4/240p/"):"",360:o.indexOf("360")>=0?"360"==e.getAttribute("max-mode")?a:a.replace("/mp4/","/mp4/360p/"):"",480:o.indexOf("480")>=0?"480"==e.getAttribute("max-mode")?a:a.replace("/mp4/","/mp4/480p/"):"",720:o.indexOf("720")>=0?"720"==e.getAttribute("max-mode")?a:a.replace("/mp4/","/mp4/720p/"):""};if(i<0||Video.isMobile.any())""!=n[240]?t=n[240]:""!=n[360]?t=n[360]:""!=n[480]?t=n[480]:""!=n[720]&&(t=n[720]);else{var d=0;d=i>=3268107.6?720:i>=1476148*1.2?480:i>=1090788?360:240;var r=!1;""!=n[d=240]||(Object.keys(n).forEach((function(e){r||parseInt(e)d&&""!=n[e]&&(r=!0,d=parseInt(e))})))),t=n[d]}return null!=t&&""!=t&&addPreloadLink(t+="1-v1-a1.ts"),e.getAttribute("src")},subIns:{},getSubs:function(e){var t=this,i="//vnexpress.net/detail/subtitle/vids/";window.location.hostname.indexOf("demo-")>-1&&(i="//demo-vne.vnexpress.net/detail/subtitle/vids/"),e=i+e;var a=new XMLHttpRequest;a.responseType="json",a.onreadystatechange=function(e){4==a.readyState&&200==a.status&&(t.subIns=a.response)},a.open("GET",e,!0),a.send(null)},init:function(){var e=this,t=0,i=setInterval((function(){if("function"==typeof videojs&&"undefined"!=typeof isScriptLoaded&&1==isScriptLoaded){++t>20&&clearInterval(i),videojs.addLanguage("vi",{Play:"Xem",Pause:"Dừng","Current Time":"Hiện tại",Duration:"Thời lượng","Remaining Time":"Thời lượng còn lại","Stream Type":"Stream Type",LIVE:"LIVE",Loaded:"Đã tải",Progress:"Tiến trình",Fullscreen:"Toàn màn hình","Non-Fullscreen":"Thu nhỏ",Mute:"Tắt tiếng",Unmute:"Bỏ tắt tiếng","Playback Rate":"Tỷ lệ phát lại",Subtitles:"Bật phụ đề","Subtitles off":"Tắt phụ đề",Captions:"Chú thích","captions off":"Tắt chú thích",Chapters:"Chương mục","Close Modal Dialog":"Close Modal Dialog","You aborted the video playback":"Đã hủy phát lại video","A network error caused the video download to fail part-way.":"Lỗi mạng khiến tải xuống video không thành công.","The video could not be loaded, either because the server or network failed or because the format is not supported.":"Không thể tải video vì máy chủ hoặc mạng không thành công hoặc do định dạng không được hỗ trợ.","The video playback was aborted due to a corruption problem or because the video used features your browser did not support.":"Phát lại video đã bị hủy do sự cố tham nhũng hoặc do video được sử dụng các tính năng mà trình duyệt của bạn không hỗ trợ.","No compatible source was found for this video.":"Không tìm thấy nguồn tương thích cho video này.","No compatible source was found for this media.":"Không tìm thấy nguồn tương thích cho video này."});var a=document.querySelectorAll(".embed_video_new video[preload=auto], .embed_video_new iframe");if(a.length>0){clearInterval(i),e.initDOM();for(var o=[],n="undefined"!=typeof SITE_ID&&1003888==SITE_ID||"undefined"!=typeof ZONE_ADS&&1==ZONE_ADS?"en":"vi",d=0;d0?"application/x-mpegURL":"video/mp4",src:c}),e.vodIns[l].on("ready",(function(t){if(0==e.loadAdPlugin){e.loadAdPlugin=!0;var i=document.createElement("script");i.type="text/javascript",i.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",i.onload=function(){e.scriptLoaded=!0},i.onerror=function(){console.log("ima fail or adblock!!!")},document.getElementsByTagName("head")[0].appendChild(i)}document.getElementById(this.id()).appendChild(createDiv(this.id().replace("media-video-","").replace("_html5_api","")+"_moaContainer","","position: absolute; top: 0px; left: 0px; width: 1px; height: 1px; display: none; background-color: transparent;padding-top:0;")),document.getElementById(this.id()).appendChild(createDiv(this.id().replace("media-video-","").replace("_html5_api","")+"_moaContainer2","","position: absolute; top: 0px; left: 0px; width: 1px; height: 1px; display: none; background-color: transparent;padding-top:0;")),document.getElementById(this.id()).appendChild(createDiv(this.id().replace("media-video-","").replace("_html5_api","")+"_soundTopRight","fp-sound-status-container","")),null!=Video.getStorage("fp-vlt")&&-1!=Video.getStorage("fp-vlt")&&(new Date).getTime()-parseInt(Video.getStorage("fp-vlt"))<144e5?this.volume(null!=Video.getStorage("fp-volume")&&-1!=Video.getStorage("fp-volume")?Math.max(0,Math.min(1,Video.getStorage("fp-volume"))):.5):this.volume(.5),this.lastVolume_(this.volume()),this.check3s=setTimeout(function(){0==this.videoLogging.canplay&&videoVODLog(this,"canplayover3s",(new Date).getTime()-this.timestartinit)}.bind(this),3e3)})),e.vodIns[l].on("loadedmetadata",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");0==e.vodIns[i].videoLogging.loadedmetadata&&(e.vodIns[i].videoLogging.loadedmetadata=!0,videoVODLog(e.vodIns[i],"loadedmetadata",(new Date).getTime()-e.vodIns[i].timestartinit))})),e.vodIns[l].on("canplay",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");0==e.vodIns[i].videoLogging.canplay&&(e.vodIns[i].videoLogging.canplay=!0,videoVODLog(e.vodIns[i],"canplay",(new Date).getTime()-e.vodIns[i].timestartinit))})),e.vodIns[l].on("canplaythrough",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");0==e.vodIns[i].videoLogging.canplay&&(e.vodIns[i].videoLogging.canplay=!0,videoVODLog(e.vodIns[i],"canplay",(new Date).getTime()-e.vodIns[i].timestartinit))})),e.vodIns[l].on("volumechange",(function(){Video.setStorage("fp-mute",this.muted()),Video.setStorage("fp-volume",this.muted()?this.lastVolume_():this.volume()),Video.setStorage("fp-vlt",(new Date).getTime())})),e.vodIns[l].on("play",(function(t){void 0!==this.firstplay&&1==this.firstplay&&(null!=Video.getStorage("fp-vlt")&&-1!=Video.getStorage("fp-vlt")&&(new Date).getTime()-parseInt(Video.getStorage("fp-vlt"))<144e5?this.volume(null!=Video.getStorage("fp-volume")&&-1!=Video.getStorage("fp-volume")?Math.max(0,Math.min(1,Video.getStorage("fp-volume"))):.5):this.volume(.5));var i=t.target.id.replace("media-video-","").replace("_html5_api","");void 0!==i&&i&&(e.pauseOtherPlayer("media-video-"+i),e.scriptLoaded&&null==e.vodIns[i].ads&&(null!=e.vodIns[i].adsConfig&&""!=e.vodIns[i].adsConfig?(e.vodIns[i].ads=new AdObject(e.vodIns[i],i+"_moaContainer",i+"_moaContainer2",e.vodIns[i].adsConfig,0),e.vodIns[i].ads.initIMA()):null!=e.vodIns[i].adsTag&&""!=e.vodIns[i].adsTag&&(e.vodIns[i].ads=new AdObject(e.vodIns[i],i+"_moaContainer",i+"_moaContainer2",e.vodIns[i].adsTag,1),e.vodIns[i].ads.initIMA())),e.vodIns[i].rtv=(new Date).getTime())})),e.vodIns[l].on("waiting",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");void 0!==i&&i&&(e.vodIns[i].rtv=(new Date).getTime());try{this.seeking()||videoVODLog2(this,"ts","waiting",0,hls.abrController.fragCurrent.url)}catch(e){console.log(e)}clearTimeout(this.waitingTimeout),this.waitingTimeout=setTimeout(function(){videoVODLog(this,"waiting",isNaN(this.currentTime())?0:this.currentTime())}.bind(this),5e3)})),e.vodIns[l].on("error",(function(e){if(errorVODLog(this,this.error().code),this.src().indexOf(".mp4")>0)if(this.modeList&&this.modeList.length>0){(a=this.modeList.indexOf(this.src()))>=0&&(this.retryMode[a]=!0);for(var t=this.modeList.length-1;t>=0;t--)if(0==this.retryMode[t]&&""!=this.modeList[t]){this.retryMode[t]=!0,this.src({type:"video/mp4",src:this.modeList[t]});break}}else{this.modeList=document.getElementById(this.id()).getAttribute("data-mode").split("|"),this.retryMode=[],document.getElementById(this.id()).getAttribute("max-mode")!=this.modeList[this.modeList.length-1]?this.modeList[this.modeList.length-1]=this.src().replace("/240p/","/").replace("/360p/","/").replace("/480p/","/").replace("/mp4/","/mp4/"+this.modeList[this.modeList.length-1]+"p/"):this.modeList[this.modeList.length-1]=this.src().replace("/240p/","/").replace("/360p/","/").replace("/480p/","/"),this.retryMode[this.modeList.length-1]=!1;for(t=0;t=0&&(this.retryMode[a]=!0);for(var o=this.modeList.length-1;o>=0;o--)if(0==this.retryMode[o]&&""!=this.modeList[o]){this.retryMode[o]=!0,this.src({type:"video/mp4",src:this.modeList[o]});break}}else if(3==this.error().code){var n=this.videoHeight();n>this.videoWidth()&&(n=this.videoWidth());var d=this.src();d.indexOf("index-v1-a1")>0?(d=d.replace("/240p/","/").replace("/360p/","/").replace("/480p/","/").replace("/index-v1-a1.m3u8",".mp4").replace("d1.vnecdn","v.vnecdn").replace("/video/video/","/video/"),this.src({type:"video/mp4",src:d})):(((d=n==this.maxMode?d.replace(",,",","):d.replace(","+n+"p","")).indexOf("/,/")>=0||d.indexOf("mp4//")>=0)&&(d=d.replace("/,/","/").replace("mp4//","mp4/").replace("vne/master","index-v1-a1")),this.src({type:"application/x-mpegURL",src:d}))}})),e.vodIns[l].on("pause",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");void 0!==i&&i&&(e.vodIns[i].rtv=(new Date).getTime())})),e.vodIns[l].on("firstplay",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");void 0!==i&&i&&0==e.vodIns[i].videoLogging.firstPlay&&(e.vodIns[i].videoLogging.firstPlay=!0,e.trackingDataPlayer("media-video-"+i,"videoStart",e.vodIns[i].src(),"0%",((new Date).getTime()-e.vodIns[i].rtv)/1e3,e.vodIns[i].timeWatching),e.vodIns[i].rtv=(new Date).getTime()),this.firstplay=!0,null!=Video.getStorage("fp-vlt")&&-1!=Video.getStorage("fp-vlt")&&(new Date).getTime()-parseInt(Video.getStorage("fp-vlt"))<144e5?this.muted()||"function"!=typeof fadeVolume?this.volume(null!=Video.getStorage("fp-volume")&&-1!=Video.getStorage("fp-volume")?Math.max(0,Math.min(1,Video.getStorage("fp-volume"))):.5):fadeVolume(this,null!=Video.getStorage("fp-volume")&&-1!=Video.getStorage("fp-volume")?Math.max(0,Math.min(1,Video.getStorage("fp-volume"))):.5,1):this.muted()||"function"!=typeof fadeVolume?this.volume(.5):fadeVolume(this,.5,1)})),e.vodIns[l].on("playing",(function(t){clearTimeout(this.waitingTimeout);var i=t.target.id.replace("media-video-","").replace("_html5_api","");void 0!==i&&i&&(e.pauseOtherPlayer("media-video-"+i),e.vodIns[i].rtv=(new Date).getTime())})),e.vodIns[l].on("seeking",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");void 0!==i&&i&&(e.vodIns[i].currentTime()+2>e.vodIns[i].duration()&&e.vodIns[i].currentTime(e.vodIns[i].duration()-2),null!=e.vodIns[i].ads&&(e.vodIns[i].ads.loadAd()||e.vodIns[i].ads.playAd())&&e.vodIns[i].pause(),e.vodIns[i].rtv=(new Date).getTime())})),e.vodIns[l].on("seeked",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");void 0!==i&&i&&(null!=e.vodIns[i].ads&&(e.vodIns[i].ads.loadAd()||e.vodIns[i].ads.playAd())&&e.vodIns[i].pause(),e.vodIns[i].rtv=(new Date).getTime())})),e.vodIns[l].on("ended",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");void 0!==i&&i&&0==e.vodIns[i].videoLogging.complete&&(e.vodIns[i].videoLogging.complete=!0,e.trackingDataPlayer("media-video-"+i,"videoComplete",e.vodIns[i].src(),"100%",((new Date).getTime()-e.vodIns[i].rtv)/1e3,e.vodIns[i].timeWatching),e.vodIns[i].rtv=(new Date).getTime()),console.log("vplayer: - duration: ",e.vodIns[i].duration());try{if(1002835==SITE_ID&&"undefined"!=typeof next_id&&"undefined"!=typeof vod_support)return load_video(next_id,vod_support),!1}catch(e){console.log(e)}if(null!=e.vodIns[i].ads&&null!=e.vodIns[i].ads.moslotForType("post-roll"))return!1;void 0!==i&&i&&e.showEndVideo(i)})),e.vodIns[l].on("loadstart",(function(t){var i=t.target.id.replace("media-video-","").replace("_html5_api","");if(void 0!==i&&i&&null!=e.vodIns[i].ads&&e.vodIns[i].ads.initAdPlugin()&&e.vodIns[i].ads.playAd())return!1})),e.vodIns[l].on("timeupdate",(function(t){var i;try{i=t.target.player.id().replace("media-video-","").replace("_html5_api","")}catch(e){i=t.target.player().id().replace("media-video-","").replace("_html5_api","")}if(0==e.vodIns[i].videoLogging.addedSub&&null!=e.subIns[i]){e.vodIns[i].videoLogging.addedSub=!0,e.vodIns[i].track=[];var a=JSON.parse(e.subIns[i]);if("safari"==getBrowser().name.toLowerCase())for(var o=0;o=0?a.cue[o].clist[d].content:""+a.cue[o].clist[d].content+"")).id=d,null!=a.cue[o].clist[d].attributes)switch(r.line=void 0!==a.cue[o].clist[d].attributes.line?parseInt(a.cue[o].clist[d].attributes.line):-1,r.align){case"right":void 0!==a.cue[o].clist[d].attributes.position?r.position=Math.min(100,Math.max(0,2*parseInt(a.cue[o].clist[d].attributes.position))):r.position=50,void 0!==a.cue[o].clist[d].attributes.size?r.size=Math.min(100,Math.max(0,100-(r.position-20)+parseInt(a.cue[o].clist[d].attributes.size))):r.size=100;break;case"left":void 0!==a.cue[o].clist[d].attributes.position?parseInt(a.cue[o].clist[d].attributes.position)>50?r.position=Math.min(100,Math.max(0,parseInt(a.cue[o].clist[d].attributes.position)/2)-20):r.position=0:r.position=50,void 0!==a.cue[o].clist[d].attributes.size&&void 0!==a.cue[o].clist[d].attributes.position?(r.size=parseInt(a.cue[o].clist[d].attributes.size),r.position=Math.min(100,Math.max(0,100-r.size-(parseInt(a.cue[o].clist[d].attributes.position)-50)))):r.size=100;break;case"middle":void 0!==a.cue[o].clist[d].attributes.position?50==parseInt(a.cue[o].clist[d].attributes.position)?r.position=50:parseInt(a.cue[o].clist[d].attributes.position)>50?(r.align="right",r.position=Math.min(100,Math.max(0,parseInt(a.cue[o].clist[d].attributes.position)+20))):(r.align="left",r.position=Math.min(100,Math.max(0,parseInt(a.cue[o].clist[d].attributes.position)-20))):r.position=50,r.size=void 0!==a.cue[o].clist[d].attributes.size?parseInt(a.cue[o].clist[d].attributes.size):100}else r.line=-1,r.position=50,r.size=100,r.align=Video.isMobile.iOS()?"center":"middle";e.vodIns[i].track[o].addCue(r)}}else for(o=0;o=0?a.cue[o].clist[d].content:""+a.cue[o].clist[d].content+"")).id=d,null!=a.cue[o].clist[d].attributes?(r.line=void 0!==a.cue[o].clist[d].attributes.line?parseInt(a.cue[o].clist[d].attributes.line):-1,r.position=void 0!==a.cue[o].clist[d].attributes.position?parseInt(a.cue[o].clist[d].attributes.position):50,r.size=void 0!==a.cue[o].clist[d].attributes.size?parseInt(a.cue[o].clist[d].attributes.size):90,r.align=void 0!==a.cue[o].clist[d].attributes.align?a.cue[o].clist[d].attributes.align:"middle"):(r.line=-1,r.position=50,r.size=90,r.align="middle"),e.vodIns[i].track[o].addCue(r)}}e.vodIns[i].track[0].mode="showing",e.vodIns[i].track.length>0&&e.vodIns[i].track.length<2&&(e.vodIns[i].controlBar.subsCapsButton.menu.el_.style.display="none"),e.vodIns[i].player_.subShowing=!0,e.vodIns[i].controlBar.subsCapsButton.controlText("Subtitles off")}var s=e.vodIns[i].currentTime(),l=Math.floor(s),c=e.vodIns[i].duration();if(0==e.vodIns[i].videoLogging.callSuggesion&&s>c/2){e.vodIns[i].videoLogging.callSuggesion=!0;try{e.getDataSuggestion("media-video-"+i)}catch(e){}}if(null!=e.vodIns[i].ads&&e.vodIns[i].ads.initAdPlugin()){if(e.vodIns[i].ads.playAd())return!1;!e.vodIns[i].ads.initAd()&&s>5?(e.vodIns[i].ads.initAd(!0),null!=e.vodIns[i].adsConfig&&""!=e.vodIns[i].adsConfig?e.vodIns[i].ads.moinitAds2(JSON.parse(e.vodIns[i].adsConfig)):null!=e.vodIns[i].adsTag&&""!=e.vodIns[i].adsTag&&e.vodIns[i].ads.moinitAds(e.vodIns[i].adsTag)):!e.vodIns[i].ads.initAd()||e.vodIns[i].ads.loadAd()||e.vodIns[i].ads.playAd()||e.vodIns[i].ads.moslotForCurrentTime(l)}if(e.vodIns[i].paused()||(e.vodIns[i].timeWatching+=((new Date).getTime()-e.vodIns[i].rtv)/1e3),e.vodIns[i].rtv=(new Date).getTime(),0==e.vodIns[i].videoLogging.firstQuartile&&l==Math.floor(.25*c))e.vodIns[i].videoLogging.firstQuartile=!0,e.trackingDataPlayer("media-video-"+i,"videoProgress",e.vodIns[i].src(),"25%",((new Date).getTime()-e.vodIns[i].rtv)/1e3,e.vodIns[i].timeWatching),e.vodIns[i].rtv=(new Date).getTime();else if(0==e.vodIns[i].videoLogging.midpoint&&l==Math.floor(.5*c))e.vodIns[i].videoLogging.midpoint=!0,e.trackingDataPlayer("media-video-"+i,"videoProgress",e.vodIns[i].src(),"50%",((new Date).getTime()-e.vodIns[i].rtv)/1e3,e.vodIns[i].timeWatching),e.vodIns[i].rtv=(new Date).getTime();else if(0==e.vodIns[i].videoLogging.thirdQuartile&&l==Math.floor(.75*c))e.vodIns[i].videoLogging.thirdQuartile=!0,e.trackingDataPlayer("media-video-"+i,"videoProgress",e.vodIns[i].src(),"75%",((new Date).getTime()-e.vodIns[i].rtv)/1e3,e.vodIns[i].timeWatching),e.vodIns[i].rtv=(new Date).getTime();else{var g="0";switch(l){case Math.floor(.05*c):g="5";break;case Math.floor(.1*c):g="10";break;case Math.floor(.15*c):g="15";break;case Math.floor(.2*c):g="20";break;case Math.floor(.3*c):g="30";break;case Math.floor(.35*c):g="35";break;case Math.floor(.4*c):g="40";break;case Math.floor(.45*c):g="45";break;case Math.floor(.55*c):g="55";break;case Math.floor(.6*c):g="60";break;case Math.floor(.65*c):g="65";break;case Math.floor(.7*c):g="70";break;case Math.floor(.8*c):g="80";break;case Math.floor(.85*c):g="85";break;case Math.floor(.9*c):g="90";break;case Math.floor(.95*c):g="95"}"0"!=g&&void 0===e.vodIns[i].videoLogging.tracking_every_5percent["percent_"+g]&&(e.vodIns[i].videoLogging.tracking_every_5percent["percent_"+g]=1,e.trackingDataPlayer("media-video-"+i,"videoProgress",e.vodIns[i].src(),g+"%",((new Date).getTime()-e.vodIns[i].rtv)/1e3,e.vodIns[i].timeWatching),e.vodIns[i].rtv=(new Date).getTime())}if(e.vodIns[i].ended()&&!e.vodIns[i].paused()&&e.vodIns[i].pause(),Math.floor(e.vodIns[i].currentTime())===Math.floor(e.vodIns[i].duration()))try{if(1002835==SITE_ID&&"undefined"!=typeof next_id&&"undefined"!=typeof vod_support)return load_video(next_id,vod_support),!1;if("undefined"!=typeof parser_playlist&&1==parser_playlist)return fpt.require("module/home").nextVideo(),!1}catch(e){console.log(e)}}))}}}catch(e){console.log(e)}}o.length>0&&1!=isHome?e.getSubs(o.join("-")):o.length>0&&1==isHome&&(e.subtileVideoIdArr=o,e.getSubs(o.join("-")))}}}),100);e.checkFB(),setInterval((function(){e.checkFB()}),3e5);var a=document.getElementsByClassName("embed_video_new");function o(){var e=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement;isFullscreen=!!e,Video.vodIns.forEach((function(e,t){Video.vodIns[t].ads&&Video.vodIns[t].ads.playAd()&&Video.vodIns[t].ads.screenChange(),Video.vodIns[t].addedSub&&Video.vodIns[t].textTrackDisplay.updateDisplay()}))}"undefined"!=typeof parser_autoplay&&1==parser_autoplay&&a.length>0&&window.addEventListener("load",(function(){var t=a[0],i=new e.inView(t);if(i.isInView()){var o=e.getDataAttributes(t);"363311"==o.vid||0!=o.type&&4!=o.type||1!=o.initdom||!e.isHtml5Support()||e.isMobile.iOS()||e.isMobile.Android()||(t.setAttribute("data-view","inview"),0==t.getAttribute("data-play")&&(t.setAttribute("data-auto",1),e.playVideo(o.vid,!0)))}i.onInView(function(i){var a=e.getDataAttributes(t);"363311"==a.vid||0!=a.type&&4!=a.type||1!=a.initdom||!e.isHtml5Support()||e.isMobile.iOS()||e.isMobile.Android()||(t.setAttribute("data-view","inview"),0==t.getAttribute("data-play")&&(1!=t.getAttribute("data-auto")?(t.setAttribute("data-auto",1),e.playVideo(a.vid,!0)):1==t.getAttribute("data-auto")&&e.playVideo(a.vid,!0)))}.bind(this,0))})),document.addEventListener("webkitfullscreenchange",o,!1),document.addEventListener("mozfullscreenchange",o,!1),document.addEventListener("fullscreenchange",o,!1),document.addEventListener("MSFullscreenChange",o,!1)},resume:function(e){return!0},player:function(e){var t=this,i=t.parentContainer[e];void 0!==t.parentContainer[e]&&t.parentContainer[e]||(i=document.getElementById("media-video-"+e),t.parentContainer[e]=i),document.getElementById("parser_player_"+e).style.display="block",t.html5Player(t.getDataAttributes(i))},html5Player:function(e,t){var i=this;if(document.getElementById("parser_player_"+e.vid)&&(document.getElementById("parser_player_"+e.vid).style.display="block"),void 0!==i.vodIns[e.vid]){i.vodIns[e.vid].autoplay(!0),i.vodIns[e.vid].timestartinit=(new Date).getTime(),void 0!==t&&0==i._forceMute&&window.location.href.indexOf("video.ngoisao.vnexpress.net")<0&&i.vodIns[e.vid].muted(t);try{var a=i.vodIns[e.vid].play();void 0!==a&&a.then((function(){console("video started!!!")})).catch((function(){i.vodIns[e.vid].hasStarted(!0)}))}catch(t){i.vodIns[e.vid].play()}i.vodIns[e.vid].timestartinit=(new Date).getTime();try{document.getElementById("media-video-"+e.vid).children[0].controls=""}catch(e){console.log(e)}}else var o=setInterval((function(){void 0!==i.vodIns[e.vid]&&(clearInterval(o),i.html5Player(e,t))}),10)},suggestSource:"portal",checkContractNumber:function(){var e=!1;if("false"!=typeof dataLayer&&dataLayer.length>0)for(i=0;i0&&(0==e.error?t.suggestionData[t.suggestionVideoId]={suggestion:e.data}:t.suggestionData[t.suggestionVideoId]=[])},pauseOtherPlayer:function(e){var t=this;if(t.vodIns.length>0){var i=e.replace("media-video-","");t.vodIns.forEach((function(e,a){a!=i&&(t.vodIns[a].pause(),t.vodIns[a].ads&&(t.vodIns[a].ads.playAd()?t.vodIns[a].ads.pauseAd():t.vodIns[a].ads.loadAd()&&t.vodIns[a].ads.removeAdData()))}))}},playCompleted:function(e){var t=this;if(null!=t.isMobile.any())return null;var i=e.replace("media-video-","");return void 0!==t.suggestionData[i]&&t.suggestionData[i]?(t.trackingRecommend(),JSON.stringify(t.suggestionData[i])):null},siteTracking:function(e){var t=5;switch(e){case 1003834:t=30;break;case 1002835:t=10;break;case 1003695:t=16;break;case 1002764:t=8;break;default:t=5}return t},trackingPlayVideo:function(e){return!1},trackingPageView:function(e){return!1},trackingRecommend:function(){"portal"==this.suggestSource?$dimension1="Ctbqt_Embed_Display":$dimension1="rcm_video_embed_display",function(e,t,i,a,o,n,d){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,n=t.createElement(i),d=t.getElementsByTagName(i)[0],n.async=1,n.src="https://www.google-analytics.com/analytics.js",d.parentNode.insertBefore(n,d)}(window,document,"script",0,"ga")},trackingDataPlayer:function(e,t,i,a,o,n){if(n=void 0!==n&&n>0?Math.round(n):0,void 0===window.pageCategoryID)for(var d=0;dthis.boxTop}).bind(this),(this.detectInView=function(){var e=this.isInView();!e||this.stateInView&&void 0!==this.stateInView?e||!this.stateInView&&void 0!==this.stateInView||(this.stateInView=!1,this.outView&&this.outView()):(this.stateInView=!0,this.inView&&this.inView())}).bind(this),(this.onInView=function(e){this.inView=function(){e.call(this)}.bind(this),this.detectInView()}).bind(this),(this.onOutView=function(e){this.outView=function(){e.call(this)}.bind(this),this.detectInView()}).bind(this),this.getBoundingRect(),this.detectInView(),window.addEventListener("scroll",function(){this.detectInView()}.bind(this)),window.addEventListener("resize",function(){this.getBoundingRect()}.bind(this))},showEndVideo:function(e){var t=this;null!=t.vodIns[e].ads&&(t.vodIns[e].ads.loadAd()||t.vodIns[e].ads.playAd())&&t.vodIns[e].ads.removeAdData();var i=JSON.parse(t.playCompleted("media-video-"+e));if(null!=i&&i.length>0){t.vodIns[e].showSuggestion(!0),t.vodIns[e].suggestionData=i,t.vodIns[e].isShowSuggestion=!0,null==document.getElementById(e+"_fp_suggest_popup")?(t.vodIns[e].suggestionPopup=createDiv(e+"_fp_suggest_popup","fp-suggest-popup","display:block;background-color:rgba(0,0,0,0.7);"),document.getElementById(event.target.id).parentNode.appendChild(t.vodIns[e].suggestionPopup)):(t.vodIns[e].suggestionPopup=document.getElementById(e+"_fp_suggest_popup"),t.vodIns[e].suggestionPopup.innerHTML="",t.vodIns[e].suggestionPopup.style.display="block",t.vodIns[e].suggestionPopup.style.backgroundColor="rgba(0,0,0,0.7)");var a='