1let players = []; 2let trailerVidPlayer = ""; 3let introPlayer = ""; 4let playerGallery = ""; 5SITE.isDeeplink == "true" ? (isDeeplink = true) : (isDeeplink = false); 6 7function createDomElementDiv(playerinfo) { 8 const newDiv = document.createElement("div"); 9 newDiv.id = playerinfo.playerid; 10 document.getElementsByClassName("video-holder-two")[0].appendChild(newDiv); 11} 12 13function ageRestrictedVideo(playerinfo) { 14 let playerDiv = ""; 15 playerDiv = document.getElementById(playerinfo.playerid); 16 if (playerDiv === null) { 17 createDomElementDiv(playerinfo); 18 playerDiv = document.getElementById(playerinfo.playerid); 19 } 20 playerDiv.innerHTML = 21 '<div class="ytbvideo"><a href="https://youtu.be/' + 22 playerinfo.ytid + 23 '" target="_blank"><img src="' + 24 playerinfo.thumb + 25 '" class="img-fluid video_thumb"></a></div>'; 26} 27 28function destroyYt() { 29 return new Promise((resolve, reject) => { 30 if (trailerVidPlayer) { 31 let ytDestroyed = ""; 32 ytDestroyed = trailerVidPlayer.destroy(); 33 trailerVidPlayer = ""; 34 resolve(ytDestroyed); 35 } else { 36 reject(false); 37 } 38 }); 39} 40function YoutubePlayerFunction(playerinfo) { 41 if (playerinfo.playerType === "yt") { 42 var youtubehost = ""; 43 SITE.ot === "true" 44 ? (youtubehost = "") 45 : (youtubehost = "https://www.youtube.com"); 46 if (SITE.ot === "true") { 47 try { 48 var val = OnetrustActiveGroups; 49 if (val.indexOf(",tc,") > -1) { 50 youtubehost = "https://www.youtube.com"; 51 } else { 52 youtubehost = "https://www.youtube-nocookie.com"; 53 } 54 } catch (e) {} 55 } 56 return new YT.Player(playerinfo.playerid, { 57 videoId: playerinfo.ytid, 58 host: youtubehost, 59 playerVars: { 60 autoplay: 0, 61 enablejsapi: 1, 62 version: 3, 63 rel: 0, 64 }, 65 events: { 66 onReady: onYTPlayerReady, 67 onStateChange: onYTPlayerStateChange, 68 }, 69 }); 70 } else { 71 let id=""; 72 playerinfo.playerid == 'youtubeVideointro' ? id = 'htmlvideoIntro' : id = 'htmlvideo'; 73 try{videojs.getPlayer(id).dispose();}catch(e){} 74 let htmlvideotag = 75 '<video id="'+id+'" poster="' + 76 playerinfo.mp4Thumb + 77 '" width="100%" height="100%" class="video-js vjs-default-skin vjs-nofull vjs-big-play-centered" controls playsinline controlslist="nofullscreen nodownload" style="cursor:pointer;" preload="auto" data-setup=""> <source src="' + 78 playerinfo.mp4Path + 79 '" type="video/mp4"> Your browser does not support the video tag.</video>'; 80 let playerContainer = document.getElementById(playerinfo.playerid); 81 playerContainer.innerHTML = htmlvideotag; 82 videojs(id); 83 84 } 85} 86 87function playPause(video) { 88 if(video.paused){ 89 video.play(); 90 }else{ 91 video.pause();} 92} 93 94function createPlayer(playerinfo) { 95 if (playerinfo.agerestricted === "true" || playerinfo.playerType === "mp4") { 96 let promiseYt = destroyYt(); 97 if (playerinfo.playerType === "mp4") { 98 promiseYt 99 .then(() => { 100 YoutubePlayerFunction(playerinfo); 101 }) 102 .catch(() => { 103 YoutubePlayerFunction(playerinfo); 104 }); 105 } else { 106 try { 107 promiseYt 108 .then(() => { 109 ageRestrictedVideo(playerinfo); 110 }) 111 .catch(() => { 112 ageRestrictedVideo(playerinfo); 113 }); 114 } catch (e) {} 115 } 116 } else { 117 if (trailerVidPlayer && trailerVidPlayer.loadVideoById) { 118 trailerVidPlayer.loadVideoById(playerinfo.ytid); 119 } else { 120 trailerVidPlayer = YoutubePlayerFunction(playerinfo); 121 } 122 } 123} 124function onYouTubeIframeAPIReady() { 125 createPlayerFromObject(); 126} 127 128function createPlayerFromObject() { 129 //console.log("Testing YT API....."); 130 isYTenable = true; 131 try { 132 playerList.length > 0 ? createPlayer(playerList[0]) : ""; 133 if (introVideoArray.length > 0 && isDeeplink === false) { 134 if ( 135 introVideoArray[0].agerestricted == "true" && 136 introVideoArray[0].playerType !== "mp4" 137 ) { 138 let playerDiv = ""; 139 playerDiv = document.getElementById(introVideoArray[0].playerid); 140 playerDiv.innerHTML = 141 '<div class="ytbvideo"><a href="https://youtu.be/' + 142 introVideoArray[0].ytid + 143 '" target="_blank"><img src="' + 144 introVideoArray[0].thumb + 145 '" class="img-fluid video_thumb"></a></div>'; 146 } else { 147 console.log(introVideoArray[0]) 148 introPlayer = YoutubePlayerFunction(introVideoArray[0]); 149 console.log(introPlayer) 150 } 151 } 152 } catch (e) {} 153} 154 155function onYTPlayerReady(event) {} 156 157function onYTPlayerStateChange(event) {} 158 159function pauseYtOnClick() { 160 pauseYoutubeVideo(); 161} 162 163function pauseYtOnClick(id) { 164 pauseYoutubeVideo(); 165} 166 167function pauseYoutubeVideo() { 168 try { 169 trailerVidPlayer.pauseVideo(); 170 } catch (e) {} 171 try { 172 introPlayer ? introPlayer.pauseVideo() : ""; 173 } catch (e) {} 174} 175 176function pauseHtmlVideo() { 177 //htmlPlayer 178 try { 179 //Intro Player 180 let modalId = document 181 .getElementById("modalTrailer") 182 .querySelector("video"); 183 modalId.pause(); 184 } catch (e) {} 185 186 try { 187 //Video Gallery Player 188 playerGallery = ""; 189 playerGallery = !playerGallery 190 ? document 191 .getElementsByClassName("video-holder-two")[0] 192 .querySelector("video") 193 : playerGallery; 194 playerGallery.pause(); 195 } catch (e) {} 196} // End pauseHtmlVideo 197 198function playYoutubeVideo() { 199 //players.play(); 200} 201 202try { 203 closeBtn.addEventListener("click", pauseYoutubeVideo); 204} catch (e) {} 205 206//create Thumb 207let ThumbList = ""; 208let classLists = ""; 209let thumbdiv = document.getElementsByClassName("video-thumb")[0]; 210let thumbListDiv = thumbdiv.children; 211for (let i = 0; i < playerList.length; i++) { 212 i == 0 ? (classLists = "active") : (classLists = ""); 213 if (playerList[i].playerType === "mp4") { 214 ThumbList += 215 '<li><a class="trailer-Links ' + 216 classLists + 217 '" data-agerestricted="'+ playerList[i].agerestricted+'" data-type="' + 218 playerList[i].playerType + 219 '" data-vidid="' + 220 playerList[i].mp4Path + 221 '"><img src="' + 222 playerList[i].mp4Thumb + 223 '" class="img-fluid" alt="' + 224 playerList[i].text + 225 '"/></a><div class="middle video-thumb-click" data-agerestricted="'+ playerList[i].agerestricted+'" data-type="' + 226 playerList[i].playerType + 227 '" data-vidid="' + 228 playerList[i].mp4Path + 229 '"><div class="text">'+ 230 playerList[i].text +'</div></div></li>'; 231 } else { 232 ThumbList += 233 '<li><a class="trailer-Links ' + 234 classLists + 235 '" data-agerestricted="'+ playerList[i].agerestricted+'" data-type="' + 236 playerList[i].playerType + 237 '" data-vidid="' + 238 playerList[i].ytid + 239 '"><img src="https://img.youtube.com/vi/' + 240 playerList[i].ytid + 241 '/mqdefault.jpg" class="img-fluid" alt="' + 242 playerList[i].text + 243 '"/></a><div class="middle video-thumb-click" data-agerestricted="'+ playerList[i].agerestricted+'" data-type="' + 244 playerList[i].playerType + 245 '" data-vidid="' + 246 playerList[i].ytid + 247 '"><div class="text">'+ 248 playerList[i].text +'</div></div></li>'; 249 } 250} 251//<p class="video-title">'+playerList[i].text+'</p> 252playerList.length > 1 253 ? (thumbListDiv[0].innerHTML = ThumbList) 254 : (thumbListDiv[0].innerHTML = ""); 255 256let trailerLinks = $(".video-thumb-click"); 257 258let eventName = ""; 259if(isMobile || isIPadPro || isAndroidTablet || isiPad || isTablet){ 260 eventName = "touchstart"; 261}else{ 262 eventName = "click"; 263} 264 265trailerLinks.on(eventName, function () { 266 $(".video-thumb li a").removeClass("active"); 267 $(this).parent().find('.trailer-Links').addClass("active"); 268 269 for (let i = 0; i < playerList.length; i++) { 270 if ($(this).attr("data-type") === "mp4") { 271 playerList[i].mp4Path === $(this).attr("data-vidid") 272 ? createPlayer(playerList[i]) 273 : ""; 274 } else { 275 if(playerList[i].ytid === $(this).attr("data-vidid")){ 276 if($(this).attr("data-agerestricted") == 'true'){ 277 let openLink = 'https://www.youtube.com/watch?v='+$(this).attr("data-vidid"); 278 window.open(openLink, "_blank"); 279 } 280 createPlayer(playerList[i]); 281 } 282 } 283 } 284}); 285 286// var videoPlaying = null; 287// const onPlay = function() { 288// if (videoPlaying && videoPlaying != this) { 289// videoPlaying.pause() 290// console.log(`Player Pause : ${this}`); 291// } 292// videoPlaying = this 293// } 294// // try{ 295// function introEvents(){ 296// let introDiv = _id('youtubeVideointro'); 297// let flag = 'false'; 298// introDiv.addEventListener(eventName, ()=>{
299// let videoChild = introDiv.querySelector('video'); 300// videoChild.addEventListener("playing",function(){ 301// flag = 'true'; 302// }); 303 304// if(flag == 'true'){ 305// videoChild.pause(); 306// flag = 'false'; 307// }else{ 308// videoChild.play(); 309// flag = 'true'; 310// } 311// }) 312// } 313 314// }catch(e){ 315// console.log('Vodeo Player Event Error'); 316// }
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.