Hai trận lũ lịch sử trong nửa tháng nhấn chìm thôn Kim Vân, xã Văn Lang, khiến gần 500 người dân mất nhà cửa, phải di tản lên núi dựng lều sống tạm.
Rạng sáng 1/10, lũ quét từ thượng nguồn ập vào thôn khi mọi người đang say ngủ. Căn nhà mới xây của chị Lộc Thị Tẩm, 37 tuổi, ngập hơn một mét, cuốn trôi 5 tấn xi măng cùng toàn bộ vật liệu cũng như đồ đạc.
Trận lũ đầu tiên khiến nhà chị Tẩm cùng 12 hộ khác ở vũng trũng phải di tản đến nhà người thân, hàng xóm có nhà tầng để trú tạm. Những ngày đó, cả thôn đùm bọc nhau. Nhà còn gạo góp gạo, nhà có con gà, con vịt cũng mang ra nấu chung.
Nước chưa kịp rút, những trận mưa lớn sau bão Matmo dồn thêm một trận lũ khác vào thôn. “Trong một tiếng nước dâng 3-5 m, nhấn chìm cả căn nhà trị giá cả tỷ đồng đang xây dở của tôi”, chị Tẩm kể.
Đến nay, căn nhà của chị vẫn chìm nghỉm dưới làn nước.
//
document.getElementById(“in-image-close”).setAttribute(“onclick”, “in_image_close();”);
v_counter_interval = 0;
var interval_in_image = setInterval(function() {
if(document.getElementById(“24h-banner-in-image”)){
var v_element_in_image = document.getElementById(“24h-banner-in-image”);
if(v_element_in_image.childNodes[2] && v_element_in_image.childNodes[2].id){
// setup căn phải
if(document.getElementById(v_element_in_image.childNodes[2].id)){
document.getElementById(v_element_in_image.childNodes[2].id).style.textAlign = “right”;
}
if(v_element_in_image.childNodes[2].childNodes[1]){
if(v_element_in_image.childNodes[2].childNodes[1].childNodes[0]){
if(v_element_in_image.childNodes[2].childNodes[1].childNodes[0].id || (isIE() && v_element_in_image.childNodes[2].childNodes[1].id)){
if(document.getElementById(v_element_in_image.childNodes[2].childNodes[1].childNodes[0].id) || (isIE() && document.getElementById(v_element_in_image.childNodes[2].childNodes[1].id))){
if(isIE()){
if(document.getElementById(v_element_in_image.childNodes[2].childNodes[1].childNodes[0].id).style.display !== “none” && document.getElementById(v_element_in_image.childNodes[2].childNodes[1].childNodes[0].id).getAttribute(“data-google-query-id”) !== null){
if(document.getElementById(“24h-banner-in-image-close”)){
document.getElementById(“24h-banner-in-image-close”).style.display = “inline-block”;
}
} else {
if(document.getElementById(“24h-banner-in-image-close”)){
document.getElementById(“24h-banner-in-image-close”).style.display = “none”;
}
}
} else {
if(document.getElementById(v_element_in_image.childNodes[2].childNodes[1].childNodes[0].id).style.display !== “none” && document.getElementById(v_element_in_image.childNodes[2].childNodes[1].childNodes[0].id).getAttribute(“data-google-query-id”) !== null){
if(document.getElementById(“24h-banner-in-image-close”)){
document.getElementById(“24h-banner-in-image-close”).style.display = “inline-block”;
}
} else {
if(document.getElementById(“24h-banner-in-image-close”)){
document.getElementById(“24h-banner-in-image-close”).style.display = “none”;
}
}
}
v_counter_interval++;
if(v_counter_interval === 15){
clearInterval(interval_in_image);
}
}
}
}
}
}
}
}, 1000);
function in_image_close(){
if(document.getElementById(“24h-banner-in-image”)){
document.getElementById(“24h-banner-in-image”).innerHTML = “”;
}
if(document.getElementById(“24h-banner-in-image-close”)){
document.getElementById(“24h-banner-in-image-close”).innerHTML = “”;
}
}
//]]>
Căn nhà mái Thái đang xây dựng của gia đình chị Lộc Thị Tẩm bị nước dâng cao nửa nhà trong sau bão Bualoi (trái) hôm 1/10 và hiện đã ngập hết mái sau bão Matmo (phải) hôm 13/10, tại thôn Kim Vân, xã Văn Lang. Ảnh: Nhân vật cung cấp
Thôn Kim Vân, xã Văn Lang (xã Kim Hỷ, huyện Na Rì, tỉnh Bắc Kạn cũ) nằm cách thành phố Thái Nguyên 130 km về phía bắc, có địa hình lòng chảo, lối thoát nước duy nhất là một cửa hang nhỏ. “Nhiều năm nước chỉ ngập hơn một mét rồi rút, nhưng trận lụt này chưa từng có”, chị Tẩm nói.
Cơn lũ lịch sử cũng nhấc bổng cả những căn nhà sàn trị giá hàng trăm triệu đồng, cuốn trôi theo dòng nước. Nhiều khu vực trong thôn giờ đây ngập sâu 15-20 m.
Nước dâng quá nhanh khiến chị Tẩm cùng nhiều gia đình phải di tản đến bốn lần lên những nơi cao hơn, dựng lán tạm bợ trên nương rẫy. Mất nhà, mất điện, người dân còn đối mặt với cảnh thiếu ăn, thiếu nước uống. Lương thực chìm trong nước lũ, giếng và các nguồn nước sạch đều bị ô nhiễm. Những ngày đầu bị cô lập, cả thôn gom từng lon gạo cho người già, trẻ nhỏ. Thanh niên nhịn đói chờ cứu trợ.
Sau ba ngày, lực lượng chức năng cùng các đoàn thiện nguyện mới tiếp cận được thôn Kim Vân, mang theo mì tôm, lương khô, nước uống. Ngoài nhu yếu phẩm, họ mong có thêm quần áo, sách vở cho trẻ em.
Vị trí thôn Kim Vân, xã Văn Lang. Ảnh: Google Map
Gia đình anh Nông Thiêm Tấn cũng mất trắng. Sáng 8/10, vợ chồng vừa về dọn dẹp nhà cửa sau trận lũ đầu tiên thì cơn lũ thứ hai tràn tới. “Tôi nghe tiếng suối gầm lên, liền chạy thoát thân”, anh Tấn kể.
Buổi trưa, nước đã chạm mái nhà. Vợ chồng anh cùng các con tay trắng di tản lên trường mầm non của thôn. Toàn bộ gia sản gồm căn nhà mới xây vẫn đang nợ 400 triệu đồng, hơn 2.000 m2 lúa sắp thu hoạch và đàn gà 20 con của anh Tấn, đều đã chìm sâu dưới dòng nước.
“15 ngày rồi vẫn chẳng thấy nóc nhà đâu”, người đàn ông 42 tuổi nói.
Các đoàn từ thiện đến thăm hai hộ dân với 11 người ở thôn Kim Vân, xã Văn Lang. Các hộ này dựng lều tạm trên núi khi nước lũ nhấn chìm nhà cửa, ngày 12/10. Ảnh: Ma Thiện Thiêm
Chiều 12/10, khi mang đồ cứu trợ vào thôn, chị Ma Thiện Thiêm ở xã Bắc Thành nhận ra nhiều người đã đói lả. Có người phải mặc áo len giữa trời nóng vì không còn quần áo.
Ông Lý Văn Minh, trưởng thôn Kim Vân, cho biết toàn thôn có 112 hộ với gần 500 nhân khẩu, tất cả đều bị cô lập và ảnh hưởng sau hai cơn bão. Đến ngày 13/10, vẫn còn 34 nhà đã bị ngập hoàn toàn, 40 căn khác ngập nhẹ hoặc thiệt hại do sạt lở.
“Thống kê sơ bộ hiện còn hai gia đình với 11 người đang phải dựng lán tạm trên núi do nơi ở bị cô lập”, ông Minh nói. Với tốc độ nước rút chỉ khoảng 10 cm mỗi ngày, vị trưởng thôn dự kiến phải hơn một tháng nữa, Kim Vân mới thoát ngập.
Ông Lèo Văn Thảo, Chủ tịch Mặt trận Tổ quốc xã Văn Lang, xác nhận đây là trận lụt lịch sử. “Nước ngập sâu, thoát kém do các cửa thoát nước bé, nguy cơ bị tắc nghẽn bởi đất đá che lấp miệng ống, hiện chưa thể xử lý”, ông Thảo giải thích.
banner_tostring(ADS_217_15s,”ADS_217_15s”);
} else {
var boxPositionBanner = document.getElementById(“ADS_217_15s_container”);
// Kiểm tra elementid có tồn tại
if (boxPositionBanner) {
// Ẩn phần tử container
boxPositionBanner.setAttribute(“style”, “display: none !important;”);
}
}
}
//]]>
banner_tostring(ADS_218_15s,”ADS_218_15s”);
} else {
var boxPositionBanner = document.getElementById(“ADS_218_15s_container”);
// Kiểm tra elementid có tồn tại
if (boxPositionBanner) {
// Ẩn phần tử container
boxPositionBanner.setAttribute(“style”, “display: none !important;”);
}
}
}
//]]>
// 0) {
// console.log(“AE volByCookie VAR : “+volByCookie);
vid_vol_var = volByCookie;
}
}
// console.log(“AE VIDVOL VAR : “+vid_vol_var);
var vidLoaded = false,
dynamicId,
vidId,
parentVid = “v-24hContainer_zplayer_6de8e1”,
videoElmStr = ‘
‘+
‘To view this video please enable JavaScript, and consider upgrading to a web browser that ‘+
‘supports HTML5 video ‘+
‘ ‘ +
”,
videozplayer_6de8e1,
videoAds1Conf = {
“poster”: “https://cdn.24h.com.vn/upload/4-2025/images/2025-10-14/1760406251-video9x16-15-ng–y-kh–ng-nh—c—a-ng—–i-v–ng-cao-th–i-nguy–n.jpg”,
“offsetWatchPercent”: 20,
“stopOtherOnPlay”: true,
“parentVid”: parentVid,
“offHighlightOnBannerBottom”:false,
“vidErrorLog”: 1,
“skipAble”: true,
“skipTime”: 5000,
/*CDN_DOMAIN_HLS*/
“skipAdsBtnContent”: “Skip Ad”,
“showAdVol”: true,
“VIDEOID”: “zplayer_6de8e1”,
/*MINI_VIDEO*/
“viewportAutoPlay”: true,
“vidVol” : vid_vol_var,
//”adVolIncrease”: 0.25,
//”showVolIncreasement”:1,
//”adVol” : “0.15”,
“trackSlowMedia”:1,
“secondToLoadMedia”:3000,
“secondToLoadMeta”:3000,
“prerollTimeEnd” : 31,
“midrollTimeEnd” : 15,
“postrollTimeEnd” : 30,
“skipAdsBtnPos”: “bottom-left”,
“theaterMod”: {height: 580},
“fastSeek”: {step: 5},
“userAgent”: “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36”,
“adLoadTimeout” : 8000
,”vastUri”: “https%3A%2F%2Fpubads.g.doubleclick.net%2Fgampad%2Fads%3Fsz%3D640x360%26iu%3D%2F124557882%2F24h%2Fus%2Fdesktop%2Fdaily_news%2Fpreroll%26impl%3Ds%26gdfp_req%3D1%26env%3Dvp%26output%3Dvast%26unviewed_position_start%3D1%26url%3Dhttps%253A%252F%252Fwww.24h.com.vn%252Ftin-tuc-trong-ngay%252F15-ngay-man-troi-chieu-dat-cua-nguoi-dan-ron-lu-thai-nguyen-c46a1705732.html%26description_url%3Dhttps%253A%252F%252Fwww.24h.com.vn%252Ftin-tuc-trong-ngay%252F15-ngay-man-troi-chieu-dat-cua-nguoi-dan-ron-lu-thai-nguyen-c46a1705732.html%26correlator%3D1760417792%26ambient%3D1%26plcmt%3D2%26cust_params%3Dcontent_groups%253DNOI_DUNG_NHAY_CAM_AI”
,”vastUriPost” : “https%3A%2F%2Fpubads.g.doubleclick.net%2Fgampad%2Fads%3Fsz%3D528x297%26iu%3D%2F124557882%2F24h%2Fus%2Fdesktop%2Fdaily_news%2Fpostroll%26impl%3Ds%26gdfp_req%3D1%26env%3Dvp%26output%3Dvast%26unviewed_position_start%3D1%26url%3Dhttps%253A%252F%252Fwww.24h.com.vn%252Ftin-tuc-trong-ngay%252F15-ngay-man-troi-chieu-dat-cua-nguoi-dan-ron-lu-thai-nguyen-c46a1705732.html%26description_url%3Dhttps%253A%252F%252Fwww.24h.com.vn%252Ftin-tuc-trong-ngay%252F15-ngay-man-troi-chieu-dat-cua-nguoi-dan-ron-lu-thai-nguyen-c46a1705732.html%26correlator%3D1760417792%26ambient%3D1%26plcmt%3D2″
,”vastUriMid” : “https%3A%2F%2Fvideo.24h.com.vn%2Fupload%2Fhtml%2Ftempvast.xml”
,”midTime”: 10
/*FALL_BACK*/
/*PLAYLIST_ITEM*/
/*DRM_VIDEO*/
,”tracking”: {
“video”: {
vidDuration: 33
,”eventsToTrack”: [“loaded”, “duration”, “percentsPlayed”, “start”, “end”, “replay”, “pause”,
“volumeChange”, “error”, “fullscreen”, “fullscreenduration”]
}
}
//{set_highlight_zplayer_html5}
,”idBannerBottom”: “bnnSponBot_zplayer_6de8e1”
}
if (volByCookie != null) {
if (volByCookie <= 0) {
// console.log("AE volByCookie VAR set MUTED : "+volByCookie);
videoAds1Conf.muted = 1;
}
}
if(document.getElementById(parentVid).innerHTML.trim() == ""){
loadVidzplayer_6de8e1();
vidLoaded = true;
}
var count_time_update_zplayer_6de8e1 = 0;
function loadVidzplayer_6de8e1(){
dynamicId = new Date().valueOf();
vidId = "my-video-multiple1_"+dynamicId;
videoAds1Conf.VIDEOID = vidId;
if(vidLoaded==true){
videoAds1Conf.viewportAutoPlay = false;
}
var newVideStr = videoElmStr.replace(/__VIDIDzplayer_6de8e1__/g, vidId);
document.getElementById(parentVid).innerHTML = newVideStr;
if (typeof adBlockEnabled_Unique != "undefined"){
// XLCYCMHENG-42783 – player – async lib ima3 + multi video – fix bug adBlockEnabled không đồng nhất
adBlockEnabled = adBlockEnabled_Unique;
}
videozplayer_6de8e1 = new videoObj(videoAds1Conf);
// console.log("AE LOAD PLAYER");
// console.log(videoAds1Conf);
// console.log("AE THIS VOLUME LOAD PLAYER muted VAR :"+videoAds1Conf.muteByUser);
//console.log("AE THIS VOLUME LOAD PLAYER is muted :"+videozplayer_6de8e1.player.muted());
//console.log("AE THIS VOLUME LOAD PLAYER: "+videozplayer_6de8e1.player.volume());
//console.log("AE THIS VOLUME LOAD PLAYER CURRENT VOLUME : "+current_vol_zplayer_6de8e1);
if ((typeof(videoAds1Conf.muteByUser) != "undefined" && videoAds1Conf.muteByUser == 1) || (volByCookie != null && volByCookie 0) {
videoAds1Conf.vidVol = current_vol_zplayer_6de8e1;
videoAds1Conf.muteByUser = 0;
} else {
videoAds1Conf.muteByUser = 1;
videoAds1Conf.vidVol = 0;
}
var videoConf = videoAds1Conf;
videoConf.viewportAutoPlay = false;
// console.log(“AE videoConf: “, videoConf);
var element = document.getElementById(videoConf.VIDEOID);
// element.parentNode.removeChild(element);
// videozplayer_6de8e1 = undefined;
videozplayer_6de8e1.player.dispose();
loadVidzplayer_6de8e1();
});
videozplayer_6de8e1.player.on(“loadeddata”, function(){
// 20220224 fix lỗi không khởi tạo đc playerInitHeight
if (this.playerInitHeight <= 0){
this.playerInitHeight = Math.round(this.getById(this.VIDEOID).getBoundingClientRect().height)
this.dbglog("this.playerInitHeight: " + this.playerInitHeight)
this.playerHasSponsorInitHeight = Math.floor(this.getById(this.VIDEOID).getBoundingClientRect().height) – 1;// làm tròn xuống & -1
this.dbglog("this.playerHasSponsorInitHeight: " + this.playerHasSponsorInitHeight);
}
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.on("volumechange", function(){
var new_vd_volume = videozplayer_6de8e1.player.volume();
// console.log("AE volume change");
// console.log("AE THIS VOLUME AFTER CHANGE: "+videozplayer_6de8e1.player.volume());
// console.log("AE volume change is mute : "+videozplayer_6de8e1.player.muted());
var is_vd_muted = videozplayer_6de8e1.player.muted();
var check_set_cookie = false;
if (new_vd_volume 10) {
is_vd_muted = true;
}
if (is_vd_muted == true) {
// console.log(“AE is_vd_muted TRUE”);
if (current_vol_zplayer_6de8e1 > 0 && count_time_update_zplayer_6de8e1 > 10) {
check_set_cookie = true;
}
current_vol_zplayer_6de8e1 = 0;
videozplayer_6de8e1.player.muted(1);
setTimeout(function(){
videozplayer_6de8e1.player.muted(1);
},300);
} else {
// console.log(“AE is_vd_muted FALSE”);
if (volByCookie <= 0 && count_time_update_zplayer_6de8e1 < 5) {
check_set_cookie = false;
} else {
check_set_cookie = true;
}
current_vol_zplayer_6de8e1 = new_vd_volume;
}
// console.log("AE check_set_cookie: "+check_set_cookie);
if (check_set_cookie == true) {
setCookie("videoVolumeByUser", current_vol_zplayer_6de8e1, 30*24, "/", "24h.com.vn", "");// lưu cookie 30 ngày
// console.log("AE SET COOKIE");
} else {
// console.log("AE NOTTTT SET COOKIE");
}
// console.log("AE THIS VOLUME AFTER CHANGE LATER: "+current_vol_zplayer_6de8e1);
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.ready(function () {
// XLCYCMHENG-38546 – [24H] Tối ưu khoảng trống trên/dưới banner sponsor_video_top / sponsor_video_botton
if (this.idBannerBottom != ""){
let vidEl = this.getById(this.VIDEOID);
let vidHeight = vidEl.getBoundingClientRect().height;
// làm tròn xuống & -1 height div chứa player
let parentHeight = Math.floor(vidHeight) – 1;
vidEl.parentNode.style.height = parentHeight + "px";
vidEl.parentNode.style.overflowY = "hidden";
// căn player lùi lên 0.7px
vidEl.style.marginTop = "-0.7px";
// 20220110: fix lỗi khi xem chế độ theater
let style = document.createElement("style");
style.type = "text/css";
style.innerHTML = ".theaterDisplay .video-js.vjs-16-9{margin-top: 0px !important}";
document.getElementsByTagName("head")[0].appendChild(style);
}
// XLCYCMHENG-44429 – 24h – Lỗi giao diện khi thu nhỏ màn hình – lỗi chiều cao theaterMod khi zoom
if (this.theaterMod && this.theaterMod.height) {
let style = document.createElement("style");
style.type = "text/css";
style.innerHTML = ".theaterDisplay .video-js.vjs-16-9-custom.zoomed:not(.mini-player){padding-top: 0px !important}";
document.getElementsByTagName("head")[0].appendChild(style);
}
// bổ sung class zoomed-out / zoomed-in theo chế độ zoom thực tế
function updateVideoZoomState() {
let vidEl = this.getById(this.VIDEOID);
const zoom = Math.round(window.devicePixelRatio * 100);
vidEl.classList.remove("zoomed", "zoomed-out", "zoomed-in");
if (zoom != 100) {
vidEl.classList.add("zoomed", zoom chưa xử lý; > 0 -> item cần nhảy tới; đã xử lý xong
let playTimeResuming = 0; // 0 -> chưa xử lý; > 0 -> thời điểm cần nhảy tới; đã xử lý xong
let useStorage = true; // sử dụng Storage để lưu trữ – không bị giới hạn số lượng, dung lượng, thời gian; không bị gửi lên server khi request trang
let minDuration = 10;
let adsTimeResuming = 0;
let adsBefore = true;
// XLCYCMHENG-39918 – player – resume watching – manager keys
// Math.floor(Date.now() / 1000) -> thời gian hiện tại (giây) theo UTC
let timeLiveKey = 720;
let updatetimeKey = “player__resume_watching__updatetime”;
// lấy item + thời gian đã xem từ cookie
let watching = “”;
if (useStorage && typeof Storage !== “undefined”){
// XLCYCMHENG-39918 – player – resume watching – manager keys
// khai báo hàm lấy thời điểm cập nhật key
var player__resume_watching__updatetime__get = function (key) {
if (typeof key == “undefined” || !key){return 0;}
let default_time = (new Date(“2022-10-01 00:00:00”)).getTime(); // mặc định nếu không có thời điểm cập nhật cũ
let updatetime = default_time;
let updatetime_all_text = localStorage.getItem(updatetimeKey);
if (updatetime_all_text != “”){
try {
let updatetime_all_obj = JSON.parse(updatetime_all_text);
if (typeof updatetime_all_obj == “object” && updatetime_all_obj !== null && typeof updatetime_all_obj[key] != “undefined”){
updatetime = parseInt(updatetime_all_obj[key]);
if (isNaN(updatetime)){
updatetime = default_time;
}
}
} catch (err){}
}
return updatetime;
};
// XLCYCMHENG-39918 – player – resume watching – manager keys
// khai báo hàm lưu thời điểm cập nhật key
var player__resume_watching__updatetime__set = function (key, remove_key) {
if (typeof key == “undefined” || !key){return false;}
if (typeof remove_key == “undefined”){
remove_key = false;
}
let updatetime_all_obj = {};
let updatetime_all_text = localStorage.getItem(updatetimeKey);
if (updatetime_all_text != “”){
try {
updatetime_all_obj = JSON.parse(updatetime_all_text);
} catch (err){}
}
if (typeof updatetime_all_obj != “object” || updatetime_all_obj === null){
updatetime_all_obj = {};
// danh sách các key có trong localStorage
let arr_all_key = Object.keys(localStorage);
if (typeof arr_all_key == “object” && arr_all_key !== null){
try {
// các key lưu lịch sử xem tiếp cũ chưa từng được đưa vào danh sách thời điểm cập nhật
let arr_key = arr_all_key.filter(key => key.match(/player__resume_watching_(.*)/));
if (typeof arr_key == “object” && arr_key !== null){
for (let i in arr_key) {
updatetime_all_obj[arr_key[i]] = Math.floor(Date.now() / 1000);
}
}
} catch (err){}
}
}
if (!remove_key){// cập nhật thời điểm cập nhật
updatetime_all_obj[key] = Math.floor(Date.now() / 1000);
try {
localStorage.setItem(updatetimeKey, JSON.stringify(updatetime_all_obj));
} catch (err){
console.log(“player: => set localStorage updatetimeKey after update – error: ” + err.message);
}
} else if (typeof updatetime_all_obj[key] != “undefined”){// remove nếu có thời điểm cập nhật cũ
delete updatetime_all_obj[key];
try {
localStorage.setItem(updatetimeKey, JSON.stringify(updatetime_all_obj));
} catch (err){
console.log(“player: => set localStorage updatetimeKey after delete – error: ” + err.message);
}
}
return true;
};
// lấy lịch sử đang xem
watching = localStorage.getItem(cookieKey);
console.log(“player: => get localStorage resume watching: ” + watching);
// có key -> check hết hạn key thì xóa, không dùng
if (timeLiveKey > 0 && watching !== null && watching !== “”){
let updatetime = player__resume_watching__updatetime__get(cookieKey);
if (updatetime + 60 * 60 * timeLiveKey remove expires localStorage resume watching: ” + cookieKey);
} catch (err){
console.log(“player: => remove expires localStorage resume watching: ” + cookieKey + ” – error: ” + err.message);
}
}
}
} else {
watching = getCookie(cookieKey);
console.log(“player: => get cookie resume watching: ” + watching);
}
if (!watching || typeof watching != “string”){
watching = “”;
}
if (watching != “”){
let arr_watching = watching.split(“:”);
if (arr_watching.length >= 2){
let watchingItem = parseInt(arr_watching[0]);
let watchingTime = parseFloat(arr_watching[1]);
if (!isNaN(watchingItem) && watchingItem > 0){
playItemResuming = watchingItem;// lưu item cần nhảy tới khi bắt đầu chạy video
}
if (!isNaN(watchingTime) && watchingTime > 0){
playTimeResuming = watchingTime;// lưu thời gian cần nhảy tới khi bắt đầu chạy video
adsTimeResuming = watchingTime;// lưu thời gian quảng cáo cần xử lý
}
if (playItemResuming > 0 || playTimeResuming > 0){
if (playItemResuming > 0){
adsTimeResuming = 100000;// playlist xem từ item thứ 2 -> chặn luôn preroll và midroll
}
console.log(“player: => need resume watching to item:” + playItemResuming + “; time:” + playTimeResuming);
}
}
}
videozplayer_6de8e1.player.on([
“resume-watching”,
], function (e) {
if (minDuration > 0 && typeof this.tracking != “undefined” && typeof this.tracking.video != “undefined”){
let duration = 0;
if (typeof this.tracking.video.playlistTotalMins != “undefined”){
duration = this.tracking.video.playlistTotalMins;
}
if (typeof this.tracking.video.vidDuration != “undefined”){
duration = this.tracking.video.vidDuration;
}
if (duration > 0 && duration hủy cố gắng phát tiếp
playItemResuming = -1;
playTimeResuming = -1;
// hủy cố gắng chặn quảng cáo
adsTimeResuming = -1;
}
}
if (playItemResuming > 0 || playTimeResuming > 0){
let currentItem = this.isPlaylist ? this.player.playlist.currentItem() : 0;
if (playItemResuming > 0 && this.isPlaylist && this.player.playlist.lastIndex() > 0){
if (playItemResuming > this.player.playlist.lastIndex()){
playItemResuming %= (this.player.playlist.lastIndex() + 1);
}
if (this.player.playlist.currentItem() != playItemResuming){
this.player.playlist.currentItem(playItemResuming);// nhảy tới item
console.log(“player:event:” + e.type + ” => resume watching item:” + this.player.playlist.currentItem());
}
}
if (currentItem != playItemResuming && playTimeResuming > 0){
// hẹn trigger vào sự kiện play/loadeddata tiếp theo (sau khi load được item) -> thay đổi time sau
this.player.one([
“play”,
“loadeddata”,
], function (e) {
if (playItemResuming > 0 || playTimeResuming > 0){
console.log(“player:event:” + e.type + ” => triggerEvt:resume-watching”);
this.triggerEvt(“resume-watching”);
}
}.bind(this));
return;
}
if (playTimeResuming > 0){
this.player.currentTime(playTimeResuming);
}
playItem = this.isPlaylist ? this.player.playlist.currentItem() : 0;
playTime = this.player.currentTime();
console.log(“player:event:” + e.type + ” => resume watching item:” + playItem + “; time:” + playTime);
// kích hoạt sự kiện onPlay nếu chưa chạy để đảm bảo tracking
if (!this.getState(“sentPlay”) && !this.player.paused()) {
this.triggerEvt(“onPlay”);
console.log(“player:event:” + e.type + ” => triggerEvt:onPlay”);
}
}
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.one([
“play”,
“loadeddata”,
], function (e) {
if (playItemResuming > 0 || playTimeResuming > 0){
if (adsBefore){
let hasPreroll = false;
if (this.isPlaylist){
let currentItem = this.player.playlist.currentItem();
let currentItemSource = this.playlistConf;
let currentSrc = currentItemSource[currentItem].sources[0];
let adTag = typeof currentSrc != “undefined” && typeof currentSrc.adTagUrl != “undefined” ? currentSrc.adTagUrl : false;
if (!adTag || adTag === “”) {
adTag = this.tempVast;
}
hasPreroll = !adTag ? false : true;
} else {
let vastUri = this.vastUri;
if (!vastUri || vastUri === “”) {
vastUri = this.tempVast;
}
hasPreroll = !vastUri ? false : true;
}
if (hasPreroll){
this.handlePreroll();
} else {
console.log(“player:event:” + e.type + ” => triggerEvt:resume-watching”);
this.triggerEvt(“resume-watching”);
}
} else {
console.log(“player:event:” + e.type + ” => triggerEvt:resume-watching”);
this.triggerEvt(“resume-watching”);
}
}
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.one([
“adend”,
“adskip”,
“nopreroll”,
“adscanceled”,
“adserror”,
], function (e) {
if (playItemResuming > 0 || playTimeResuming > 0){
// hẹn trigger vào sự kiện playing tiếp theo
this.player.one([
“playing”,
], function (e) {
if (playItemResuming > 0 || playTimeResuming > 0){
console.log(“player:event:” + e.type + ” => triggerEvt:resume-watching”);
this.triggerEvt(“resume-watching”);
}
}.bind(this));
}
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.on(“timeupdated”, function (e) {
let currentItem = this.isPlaylist ? this.player.playlist.currentItem() : 0;
let currentTime = this.player.currentTime();
if (currentItem != playItem || Math.abs(currentTime – playTime) > 0.5){// lưu cookie khi có sai khác trên 0.5s
playItem = currentItem;
playTime = currentTime;
if (useStorage && typeof Storage !== “undefined”){
try {
localStorage.setItem(cookieKey, playItem+”:”+playTime);
// console.log(“player:event:” + e.type + ” => set localStorage resume watching to item:” + currentItem + “; time:” + currentTime);
} catch (err){
console.log(“player:event:” + e.type + ” => set localStorage resume watching to item:” + currentItem + “; time:” + currentTime + “; err:” + err.message);
}
// XLCYCMHENG-39918 – player – resume watching – manager keys
player__resume_watching__updatetime__set(cookieKey);
} else {
setCookie(cookieKey, currentItem+”:”+currentTime, (timeLiveKey > 0 ? timeLiveKey : 720), “/”, “24h.com.vn”, “”);
// console.log(“player:event:” + e.type + ” => set cookie resume watching to item:” + currentItem + “; time:” + currentTime);
}
}
if (playItemResuming > 0 || playTimeResuming > 0){
if (currentItem >= playItemResuming && currentTime >= playTimeResuming + 5){
// hủy cố gắng phát tiếp từ cookie khi đã resume thành công & chạy được 1 khoảng
playItemResuming = -1;
playTimeResuming = -1;
// hủy cố gắng chặn quảng cáo
adsTimeResuming = -1;
}
}
// kích hoạt sự kiện onPlay nếu chưa chạy để đảm bảo tracking
if (!this.getState(“sentPlay”) && !this.player.paused()) {
this.triggerEvt(“onPlay”);
console.log(“player:event:” + e.type + ” => triggerEvt:onPlay”);
}
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.on([
“seeking”,
“seeked”,
], function (e) {
// hủy cố gắng phát tiếp từ cookie khi user tự thay đổi thời gian xem
playItemResuming = -1;
playTimeResuming = -1;
// hủy cố gắng chặn quảng cáo
adsTimeResuming = -1;
});
videozplayer_6de8e1.player.on([
“endVid”,
“onPostRollStart”,
“videoended”,
], function (e) {
// hủy cố gắng phát tiếp từ cookie khi đã kết thúc
playItemResuming = -1;
playTimeResuming = -1;
// hủy cố gắng chặn quảng cáo
adsTimeResuming = -1;
playItem = 0;
playTime = 0;
// xóa thông tin lịch sử đang xem
if (useStorage && typeof Storage !== “undefined”){
try {
localStorage.removeItem(cookieKey);
console.log(“player:event:” + e.type + ” => remove localStorage resume watching”);
} catch (err){
console.log(“player:event:” + e.type + ” => remove localStorage resume watching – error: ” + err.message);
}
// XLCYCMHENG-39918 – player – resume watching – manager keys
player__resume_watching__updatetime__set(cookieKey, true);
} else {
setCookie(cookieKey, playItem+”:”+playTime, 1, “/”, “24h.com.vn”, “”);
console.log(“player:event:” + e.type + ” => remove cookie resume watching”);
}
});
videozplayer_6de8e1.player.on([
“readyforpreroll”,
], function (e) {
if (!adsBefore && adsTimeResuming > 0){
let closeAds = “”;
if (this.player.ads.isInAdMode()){// preroll
if (adsTimeResuming > 5){// thời điểm xem tiếp quá 5s
closeAds = “preroll”;
}
} else {// midroll
let duration = this.player.duration();
if (!duration){
duration = 0;
}
if (adsTimeResuming > 0 && duration > 0 && (
(this.midTime && adsTimeResuming > this.midTime)
|| adsTimeResuming > duration / 2
)
){
closeAds = “midroll”;
}
}
if (closeAds != “”){
this.closeAd();
console.log(“player:event:” + e.type + ” => cancel ” + closeAds + ” – closeAd”);
if (this.player.paused()) {// cố khởi chạy tiếp nếu đang bị dừng
if (this.autoplayRequiresMute){// bắt buộc phải mute -> tắt tiếng để play đc luôn
this.player.muted(true);
}
this.player.play();
}
}
}
}.bind(videozplayer_6de8e1));
/*RESUME_WATCHING_EVENTS-END*/
videozplayer_6de8e1.player.on(“onPrerollError”, function(name) {
var objVideos = videojs(vidId+”_html5_api”);
});
videozplayer_6de8e1.player.on(“AE_completed”, function(name) {
// console.log(“AE_completed AE_completed :”+current_vol_zplayer_6de8e1);
var is_vd_mute = videozplayer_6de8e1.player.muted();
if (is_vd_mute == true) {
//videozplayer_6de8e1.player.volume(0);
setTimeout(function(){
videozplayer_6de8e1.player.muted(1);
// console.log(“AE_completed AE_completed set MUTED”);
},400);
}
});
videozplayer_6de8e1.player.on(“onPlay”, function(name) {
// console.log(“onPlay AE_started AE_started :”+current_vol_zplayer_6de8e1);
var is_vd_mute = videozplayer_6de8e1.player.muted();
if (is_vd_mute == true) {
if (current_vol_zplayer_6de8e1 > 0) {
// console.log(“AE SET VOLUME 1111111”);
videozplayer_6de8e1.player.volume(current_vol_zplayer_6de8e1);
}
videozplayer_6de8e1.player.muted(1);
// console.log(“AE MUTE LOAD PLAYER ACTION SET MUTE 111111: “);
}
// console.log(“AE THIS VOLUME is muted :”+videozplayer_6de8e1.player.muted());
// console.log(“AE THIS VOLUME: “+videozplayer_6de8e1.player.volume());
// begin 5/10/2017 TuyenNT xu_ly_gan_ga_video_theo_loai_giai_dau_frontend_pc
send_tracking_video(‘NOI_DUNG_NHAY_CAM_AI’, ‘Null’, 1705732, 46, ‘daily_news’, ‘pc’, ‘play’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
// end 5/10/2017 TuyenNT xu_ly_gan_ga_video_theo_loai_giai_dau_frontend_pc
//Begin 14-07-2017 : Thangnb tracking_google_tag_manager_video
//End 14-07-2017 : Thangnb tracking_google_tag_manager_video
send_tracking_video(”, ‘none’, 0, 0, ”, ‘pc’, ”, ‘no’, ‘no’, 3, ‘video_noi_dung’);
});
// Begin 12-12-2018 trungcq XLCYCMHENG_33549_xu_ly_scroll_to_top
videozplayer_6de8e1.player.on(“playerMinimized”, function(name) {
// console.log(“Listener playerMinimized: “);
if ($(“#arrowPageUp”).length) {
$(“#arrowPageUp”).css(“bottom”,”157px”);
$(“#backpage”).css(“bottom”,”200px”);
}
});
videozplayer_6de8e1.player.on(“playerUnMinimized”, function(name) {
// console.log(“Listener playerUnMinimized: “);
if ($(“#arrowPageUp”).length) {
$(“#arrowPageUp”).css(“bottom”,”20px”);
}
});
videozplayer_6de8e1.player.on(“miniPlayerClosed”, function(name) {
// console.log(“Listener miniPlayerClosed: “);
if ($(“#arrowPageUp”).length) {
$(“#arrowPageUp”).css(“bottom”,”20px”);
}
});
var v_videoviewership_log_zplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_videoviewership”);
videozplayer_6de8e1.player.on(“content_first_quarter”, function(){
// Gọi GA load video
if(v_videoviewership_log_zplayer_6de8e1){
send_tracking_video(”, ”, 1705732, 46, ”, ‘pc’, ‘first_quartile’, ”, ”, 5);
}
});
videozplayer_6de8e1.player.on(“content_second_quarter”, function(){
// Gọi GA load video
if(v_videoviewership_log_zplayer_6de8e1){
// Tao thẻ div để chưa link GA
$(“
“).insertBefore(“#zplayer_6de8e1_ga_videoviewership”);
if(document.getElementById(“link_ga_midpoint_zplayer_6de8e1″)){
send_tracking_video(”, ”, 1705732, 46, ”, ‘pc’, ‘midpoint’, ”, ”, 5);
}
}
});
videozplayer_6de8e1.player.on(“content_third_quarter”, function(){
// Gọi GA load video
if(v_videoviewership_log_zplayer_6de8e1){
// Tao thẻ div để chưa link GA
$(“
“).insertBefore(“#zplayer_6de8e1_ga_videoviewership”);
if(document.getElementById(“link_ga_third_zplayer_6de8e1″)){
send_tracking_video(”, ”, 1705732, 46, ”, ‘pc’, ‘third_quarter’, ”, ”, 5);
}
}
});
videozplayer_6de8e1.player.on(“content_complete”, function(){
// Gọi GA load video
if(v_videoviewership_log_zplayer_6de8e1){
// Tao thẻ div để chưa link GA
$(“
“).insertBefore(“#zplayer_6de8e1_ga_videoviewership”);
if(document.getElementById(“link_ga_complete_zplayer_6de8e1″)){
send_tracking_video(”, ”, 1705732, 46, ”, ‘pc’, ‘complete’, ”, ”, 5);
}
}
});
videozplayer_6de8e1.player.on(“miniPlayerClosed”, function(){
// Gọi GA load video
if(v_videoviewership_log_zplayer_6de8e1){
// Tao thẻ div để chưa link GA
$(“
“).insertBefore(“#zplayer_6de8e1_ga_videoviewership”);
if(document.getElementById(“link_ga_mini_close_zplayer_6de8e1″)){
send_tracking_video(”, ”, 1705732, 46, ”, ‘pc’, ‘click_close’, ”, ”, 5);
}
}
});
// End 12-12-2018 trungcq XLCYCMHENG_33549_xu_ly_scroll_to_top
var v_event_tracking_impression_prerollzplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_preroll”);
// các trường hợp mã lỗi của trình duyệt trả về
videozplayer_6de8e1.player.on(“AE_impression”, function(name) {
// Gọi GA load video
if(v_event_tracking_impression_prerollzplayer_6de8e1){
// Tao thẻ div để chưa link GA
$(“
“).insertBefore(“#zplayer_6de8e1_ga_preroll”);
if(document.getElementById(“link_ga_tracking_impression_preroll_zplayer_6de8e1”)){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 46, ‘daily_news’, ‘pc’, ‘impression’, ‘no’, ‘no’, 2, ‘video_noi_dung’);});
}
}
});
var v_event_tracking_click_prerollzplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_preroll”);
// các trường hợp mã lỗi của trình duyệt trả về
videozplayer_6de8e1.player.on(“AE_clicked”, function(name) {
// Gọi GA load video
if(v_event_tracking_click_prerollzplayer_6de8e1){
// Tao thẻ div để chưa link GA
$(“
“).insertBefore(“#zplayer_6de8e1_ga_preroll”);
if(document.getElementById(“link_ga_tracking_click_preroll_zplayer_6de8e1”)){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 46, ‘daily_news’, ‘pc’, ‘ads_click’, ‘no’, ‘no’, 2, ‘video_noi_dung’);});
}
}
});
var v_err_log_1zplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_error1”);
// các trường hợp mã lỗi của trình duyệt trả về
videozplayer_6de8e1.player.on(“MEDIA_ERROR_1″, function (name) {
// Gọi GA load video
if(v_err_log_1zplayer_6de8e1){
send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘error_ERROR_1’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
}
});
var v_err_log_2zplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_error2”);
videozplayer_6de8e1.player.on(“MEDIA_ERROR_2″, function (name) {
// Gọi GA load video
if(v_err_log_2zplayer_6de8e1){
send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘error_ERROR_2’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
}
});
var v_err_log_3zplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_error3”);
videozplayer_6de8e1.player.on(“MEDIA_ERROR_3″, function (name) {
// Gọi GA load video
if(v_err_log_3zplayer_6de8e1){
send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘error_ERROR_3’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
}
});
var v_err_log_4zplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_error4”);
videozplayer_6de8e1.player.on(“MEDIA_ERROR_4″, function (name) {
// Gọi GA load video
if(v_err_log_4zplayer_6de8e1){
send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘error_ERROR_4’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
}
});
var v_err_log_5zplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_error5”);
videozplayer_6de8e1.player.on(“MEDIA_ERROR_5″, function (name) {
// Gọi GA load video
if(v_err_log_5zplayer_6de8e1){
send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘error_ERROR_5’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_1”, function(){
console.log(“track_slow_playlist_next_1”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e11 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e11”);
if(v_track_slow_playlist_zplayer_6de8e11){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_2”, function(){
console.log(“track_slow_playlist_next_2”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e12 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e12”);
if(v_track_slow_playlist_zplayer_6de8e12){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_3”, function(){
console.log(“track_slow_playlist_next_3”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e13 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e13”);
if(v_track_slow_playlist_zplayer_6de8e13){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_4”, function(){
console.log(“track_slow_playlist_next_4”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e14 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e14”);
if(v_track_slow_playlist_zplayer_6de8e14){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_5”, function(){
console.log(“track_slow_playlist_next_5”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e15 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e15”);
if(v_track_slow_playlist_zplayer_6de8e15){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_6”, function(){
console.log(“track_slow_playlist_next_6”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e16 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e16”);
if(v_track_slow_playlist_zplayer_6de8e16){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_7”, function(){
console.log(“track_slow_playlist_next_7”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e17 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e17”);
if(v_track_slow_playlist_zplayer_6de8e17){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_8”, function(){
console.log(“track_slow_playlist_next_8”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e18 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e18”);
if(v_track_slow_playlist_zplayer_6de8e18){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_9”, function(){
console.log(“track_slow_playlist_next_9”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e19 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e19”);
if(v_track_slow_playlist_zplayer_6de8e19){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“track_slow_playlist_next_10”, function(){
console.log(“track_slow_playlist_next_10”);
$(“
“).insertBefore(“#zplayer_6de8e1_ga_media_slow_waiting”);
var v_track_slow_playlist_zplayer_6de8e110 = document.getElementById(“link_slow_playlist_next_zplayer_6de8e110”);
if(v_track_slow_playlist_zplayer_6de8e110){
window.addEventListener(“load”, function(){send_tracking_video(”, ‘none’, 1705732, 0, ”, ‘pc’, ‘slow_playlist_next’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
}
});
videozplayer_6de8e1.player.on(“timeupdated”, function () {
if (count_time_update_zplayer_6de8e1 < 50) {
count_time_update_zplayer_6de8e1++;
// console.log(“AE TIME UPDATE: “+count_time_update_zplayer_6de8e1);
}
if(v_load_recommend_boxzplayer_6de8e1 && typeof(v_thoi_luong_hien_thi) != “undefined” && v_thoi_luong_hien_thi != “”){
try{
var v_time_current = videozplayer_6de8e1.player.currentTime();
if(v_time_current > 0){
if(v_time_current >= v_thoi_luong_hien_thi){
function getJsonRecomment(url,callback){
if(url == “”){
return “”;
}
dynamicIdLive = new Date().valueOf();
url = url+dynamicIdLive;
var xhr = new XMLHttpRequest();
// Get url
xhr.open(“GET”, url, true);
// Kiểu phản hồi
xhr.responseType = “json”;
xhr.timeout = 50000; // Set timeout to 2 seconds
xhr.ontimeout = function () {console.log(url+” – timeout”);}
// Load data
xhr.onload = function() {
var status = xhr.status;
if (status == 200) {
callback(xhr.response);
}else{
console.log(“B3: status != 200”);
}
};
xhr.send();
}
if(typeof v_url_json_data_recomment != “undefined”){
getJsonRecomment(v_url_json_data_recomment,function(v_object_recomend){
if(typeof v_object_recomend != “undefined” && parseInt(v_object_recomend.length) > 0){
var recomment_arr_video_ngay_hien_tai = _getStorageJson24h(“recomment_video_ngay_hien_tai_data_news_id”);
var recomment_video_ngay_hom_qua_data_news_id = _getStorageJson24h(“recomment_video_ngay_hom_qua_data_news_id”);
// Lặp để loại bỏ những bài đang xem
var arr_recomend_video = new Array();
var k=0;
var v_so_luong_tin_hien_thi = parseInt(v_object_recomend[0][“c_tong_so_luong_tin_hien_thi”]);
for(j=0;j 0){
if(v_recomment_news_id== parseInt(v_object_recomend[j][“c_new_id”])){
continue;
}
if(typeof(recomment_arr_video_ngay_hien_tai) != “undefined” && recomment_arr_video_ngay_hien_tai.indexOf(parseInt(v_object_recomend[j][“c_new_id”])) >= 0){
continue;
}
if(typeof(recomment_video_ngay_hom_qua_data_news_id) != “undefined” && recomment_video_ngay_hom_qua_data_news_id.indexOf(parseInt(v_object_recomend[j][“c_new_id”])) >= 0){
continue;
}
}
arr_recomend_video[k] = v_object_recomend[j];
k++;
if(k >= v_so_luong_tin_hien_thi){
break;
}
}
var v_total_page_recommend =0;
v_total_page_recommend = parseInt(Math.ceil(parseInt(arr_recomend_video.length)/parseInt(v_object_recomend[0][“c_number_items”])));
// Tao HTML video recommend
arr_recomend_video[0][“c_tracking_onclick”] = “”;
arr_recomend_video[0][“c_tracking_onload”] = “”;
arr_recomend_video[0][“c_tracking_onload_gatag”] = “”;
var v_html_recomend = tao_html_recommend_video_tu_object(arr_recomend_video,”zplayer_6de8e1″);
// Gắn HTML vào chuỗi
if(v_html_recomend !=””){
// Nếu tồn tại video highlight
if ($(“#vjs-marker-tableinfo-zplayer_6de8e1”).length) {
$(“#vjs-marker-tableinfo-zplayer_6de8e1”).after(v_html_recomend);
} else {
if ($(“#zplayer_6de8e1_ga_preroll”).length) {
$(“#zplayer_6de8e1_ga_preroll”).before(v_html_recomend);
}
}
// Hiển thị dạng slide
if ($(“#box_recommend_zplayer_6de8e1”).length) {
$(“#box_recommend_zplayer_6de8e1”).show(1000);
setTimeout(function(){
create_slide_page_number_recommend_video_json(“swiper_recommend_v2018zplayer_6de8e1”, “swpier_container_zplayer_6de8e1″,”swiper_active_slide_zplayer_6de8e1”, “pagination-zplayer_6de8e1″,”wrapper_zplayer_6de8e1”,v_total_page_recommend, “swiper-slide slide_zplayer_6de8e1”, “prvVid_recommendzplayer_6de8e1”, “nxtVid_recommendzplayer_6de8e1”);
$(“#box_recommend_zplayer_6de8e1”).css(“height”, “”);
}, 900);
}
}
}
});
}
v_load_recommend_boxzplayer_6de8e1 = false;
}
}
}catch(e){
console.log([“Errors”, e]);
}
}
});
videozplayer_6de8e1.player.on(“MEDIA_SLOW_WAITING”, function (evt, data) {
//console.log(data.waitTime);
var v_slow_waiting_zplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_media_slow_waiting”);
if(v_slow_waiting_zplayer_6de8e1){
//đổi ms về s
v_so_giay_load = parseInt(data.waitTime/1000);
send_tracking_video(”, ”, 1705732, ”, ”, ”, ‘media_slow_waiting’, ”, ”, 6, v_so_giay_load);
}
//console.log(“listener MEDIA_SLOW_WAITING: “);
});
videozplayer_6de8e1.player.on(“MEDIA_SLOW_METADATA”, function (evt, data) {
//console.log(data.waitTime);
var v_slow_metadata_zplayer_6de8e1 = document.getElementById(“zplayer_6de8e1_ga_media_slow_metadata”);
if(v_slow_metadata_zplayer_6de8e1){
//đổi ms về s
v_so_giay_load_metadata = parseInt(data.waitTime/1000);
send_tracking_video(”, ”, 1705732, ”, ”, ”, ‘media_slow_metadata’, ”, ”, 6, v_so_giay_load_metadata);
}
//console.log(“listener MEDIA_SLOW_METADATA: “);
});
videozplayer_6de8e1.player.on(‘onPrerollStart’, function(name){
//console.log(‘ON PREROLL START’);
/* begin 4/10/2017 TuyenNT xu_ly_gan_ga_video_theo_loai_giai_dau_frontend_pc */
send_tracking_video(‘NOI_DUNG_NHAY_CAM_AI’, ‘Null’, 1705732, 46, ‘daily_news’, ‘pc’, ‘preroll_impression’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
/* end 4/10/2017 TuyenNT xu_ly_gan_ga_video_theo_loai_giai_dau_frontend_pc */
});videozplayer_6de8e1.player.on(‘onOverlayStart’, function(name){
//console.log(‘ON OVERLAY START’);
/* begin 4/10/2017 TuyenNT xu_ly_gan_ga_video_theo_loai_giai_dau_frontend_pc */
send_tracking_video(‘NOI_DUNG_NHAY_CAM_AI’, ‘Null’, 1705732, 46, ‘daily_news’, ‘pc’, ‘overlay_impression’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
/* end 4/10/2017 TuyenNT xu_ly_gan_ga_video_theo_loai_giai_dau_frontend_pc */
});videozplayer_6de8e1.player.on(‘onPostRollStart’, function(name){
//console.log(‘ON POSTROLL START’);
/* begin 4/10/2017 TuyenNT xu_ly_gan_ga_video_theo_loai_giai_dau_frontend_pc */
send_tracking_video(‘NOI_DUNG_NHAY_CAM_AI’, ‘Null’, 1705732, 46, ‘daily_news’, ‘pc’, ‘postroll_impression’, ‘no’, ‘no’, 1, ‘video_noi_dung’);
/* end 4/10/2017 TuyenNT xu_ly_gan_ga_video_theo_loai_giai_dau_frontend_pc */
});
videozplayer_6de8e1.player.on([
“play”,
“playing”,
“adstart”,
“adplaying”,
], function (evt, data) {
if (typeof stop_video_news_live == “function”){
stop_video_news_live(“___”);
}
});
videozplayer_6de8e1.player.one([
“play”,
], function (e) {
let vastUri = this.vastUri;
let vastUriPost = this.vastUriPost;
let vastUriMid = this.vastUriMid;
// Neu co cau hinh autoplay nhung trình duyet k cho phep auto play thi gan tham so bang vpmute = 0
if(this.viewportAutoPlay == true && this.willAutoplay === false){
if(vastUri != “”){
this.vastUri = vastUri + “&vpmute=0”;
}
if(vastUriPost != “”){
this.vastUriPost = vastUriPost + “&vpmute=0”;
}
if(vastUriMid != “”){
this.vastUriMid = vastUriMid + “&vpmute=0”;
}
}
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.on([
“contentchanged”,
], function (e) {
this.player.one([
“playing”,
], function (e) {
var currentItem = this.isPlaylist ? this.player.playlist.currentItem() : 0;
// đợi player xử lý 1s mới bắt đầu check xem có chạy được không
setTimeout(function(){
// đã thay đổi item –> bỏ qua
var chk_currentItem = this.isPlaylist ? this.player.playlist.currentItem() : 0;
if (chk_currentItem != currentItem){
return;
}
var has_timeupdate = false;
this.player.one([
“timeupdate”,
], function (e) {
has_timeupdate = true;
});
setTimeout(function(){
if (has_timeupdate){
return;
}
if (this.player.paused()){
return;
}
this.dbglog(“timeupdate_missing –> try to restart”);
this.player.pause();
setTimeout(function(){
this.player.play();
}.bind(this), 100);
}.bind(this), 300);
}.bind(this), 1000);
}.bind(this));
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.on(“onStop”, function(name) {
//console.log(“listener onStop: “);
});
videozplayer_6de8e1.player.on(“onFullscreen”, function(name) {
// 20250808 – XLCYCMHENG-44473 – xử lý bỏ neo khi mở chế độ fullscreen
// đang ở chế độ neo
if (this.hasClass(“mini-player”)){
this.removeClasses([“mini-player”, “pc-mini-player”]);
this.minPlayerHideCloseBtn();
this.unminimizeOnFullscreen = true;
}
}.bind(videozplayer_6de8e1));
videozplayer_6de8e1.player.on(“onFullscreenOff”, function(name) {
// 20250808 – XLCYCMHENG-44473 – xử lý neo lại khi thoát chế độ fullscreen
// từng bỏ neo khi mở chế độ fullscreen
if (typeof this.unminimizeOnFullscreen != “undefined” && this.unminimizeOnFullscreen){
this.addClasses([“mini-player”, “pc-mini-player”]);
this.minPlayerDisplayCloseBtn();
this.unminimizeOnFullscreen = false;
}
}.bind(videozplayer_6de8e1));
}
videoAdsInitzplayer_6de8e1 = true;
}
// Ga video load luôn được chạy
window.addEventListener(“load”, function(){});window.addEventListener(“load”, function(){send_tracking_video(‘NOI_DUNG_NHAY_CAM_AI’, ‘Null’, 1705732, 46, ‘daily_news’, ‘pc’, ‘view’, ‘no’, ‘no’, 1, ‘video_noi_dung’);});
function inViewport( element ){
// Get the elements position relative to the viewport
var bb = element.getBoundingClientRect();
// Check if the element is outside the viewport
// Then invert the returned value because you want to know the opposite
return !(bb.top > innerHeight || bb.bottom < 0);
}
var zplayer_6de8e1VpElm = document.getElementById( “zplayer_6de8e1” );
var viszplayer_6de8e1 = (function () {
var stateKey, eventKey, keys = {
hidden: “visibilitychange”,
webkitHidden: “webkitvisibilitychange”,
mozHidden: “mozvisibilitychange”,
msHidden: “msvisibilitychange”
};
for (stateKey in keys) {
if (stateKey in document) {
eventKey = keys[stateKey];
break;
}
}
return function (c) {
if (c) document.addEventListener(eventKey, c);
return !document[stateKey];
}
})();
var videoAds1Elmzplayer_6de8e1 = document.getElementById(“v-24hContainer_zplayer_6de8e1”);
document.addEventListener(“DOMContentLoaded”, function () {
if(videoAds1Elmzplayer_6de8e1){
var videoAdsInitzplayer_6de8e1 = false;
var checkTabActivezplayer_6de8e1 = setInterval(function () {
if (inViewport(videoAds1Elmzplayer_6de8e1) && viszplayer_6de8e1() && !videoAdsInitzplayer_6de8e1 && typeof(window.videojs) !== “undefined” && (typeof(google) !== “undefined” || adBlockCheckedStatus) && videoObj) {
initvideozplayer_6de8e1();
clearInterval(checkTabActivezplayer_6de8e1);
}
// 20230817 fix lỗi lần đầu vào đợi onload check chặn quảng cáo quá lâu
// XLCYCMHENG-42783 – async lib ima3 -> tăng thời gian chờ load ima3
else if (typeof videoObjRoot != “undefined” && videoObjRoot){
if (typeof videoAdsInitzplayer_6de8e1_fix_AdBlockCheck == “undefined”){
setTimeout(function(){
if (typeof adBlockCheckedStatus != “undefined” && !adBlockCheckedStatus){
adBlockCheckedStatus = true;
adBlockEnabled = false;
}
}, 2000);
videoAdsInitzplayer_6de8e1_fix_AdBlockCheck = true;
}
}
}, 100);
}
}, false);
//]]>
//



