1 2 3window.addEventListener('DOMContentLoaded', function(){ 4 var iframes = document.querySelectorAll("iframe"); 5 6 iframes.forEach(iframe => { 7 var videoId = getYoutubeIdFromUrl(iframe.src); 8 console.log(videoId); 9 if(videoId) 10 { 11 iframe.src = 'https://videolocalize.com/wp-content/themes/player/player_iFrame.html?oURL=' + iframe.src; //Replace script hosted URL 12 iframe.scroll = 'no'; 13 iframe.style.padding = 0; 14 iframe.style.margin = 0; 15 iframe.style.aspectRatio = 16/9; 16 17 if(iframe.width > iframe.parentElement.clientWidth){ 18 iframe.width = null; 19 iframe.height = null; 20 iframe.style.width ="100%"; 21 } 22 23 } 24 25 }); 26 27 28 } 29 30); 31 32 33//Get youtube Id 34function getYoutubeIdFromUrl(url) { 35 const regex = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|\?v=|\&v=)|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/; 36 const match = url.match(regex); 37 return match ? match[1] : null; 38}
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.