1try { 2 const videoToShow = document 3 .getElementById("ProductVideos") 4 .getAttribute("data-videotoshow"); 5 if (videoToShow != "" && videoToShow != "no_video") { 6 fetch(`/content/video_container_files/how-to/${videoToShow}.html`) 7 .then(function(response) { 8 if (!response.ok) { 9 throw Error; 10 } 11 return response.text(); 12 }) 13 .then(function(body) { 14 document.querySelector("#ProductVideos").innerHTML = body; 15 }) 16 .then(() => { 17 const videoLinks = document.querySelectorAll("#ProductVideos .video"); 18 const videoPlayer = document.getElementById("player"); 19 videoLinks.forEach(link => { 20 link.addEventListener("click", e => { 21 e.preventDefault(); 22 const videoId = link.getAttribute("data-video-id"); 23 videoPlayer.setAttribute( 24 "src", 25 "//www.youtube.com/embed/" + videoId 26 ); 27 videoPlayer.setAttribute( 28 "data-src", 29 "//www.youtube.com/embed/" + videoId 30 ); 31 }); 32 }); 33 }) 34 .catch(e => {}); 35 } 36} catch (e) {}
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.