A live series from Enver Izmailov recorded live in Lviv back in 2012
Enver Izmailov: Live in Lviv 2012
// {
const url = iframe.src;
const id = url.split('/embed/')[1].split('?')[0];
// We assume the first video on a page is the main one for the thumbnail
if (id) videoMap[window.location.href] = id;
});
// 2. Find thumbnails and swap them
document.querySelectorAll('.snippet-thumbnail').forEach(thumb => {
const parentLink = thumb.closest('a');
if (parentLink && parentLink.href) {
// Note: This requires the video to be present on the page.
// If the thumbnail is for a video NOT on the current page,
// this method needs to be adjusted.
const videoId = videoMap[parentLink.href];
if (videoId) {
thumb.style.backgroundImage = "url('https://img.youtube.com/vi/" + videoId + "/hqdefault.jpg')";
}
}
});
});
//]]>