feat: added dinamic addition of videos to dom

This commit is contained in:
Aliaksei Karzhou
2024-07-16 23:38:53 +03:00
parent e51337ed63
commit 2f3396d8b3
4 changed files with 21 additions and 72 deletions

View File

@@ -7,8 +7,21 @@ reviewsSlideVideos.forEach((videoEl) => {
reviewsSlideVideos.forEach((video) => {
if (video === event.currentTarget) {
video.classList.add('active');
video.innerHTML = `
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/XIMLoLxmTDw?si=wFzm5etjCkaNdMl5"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
></iframe>
`;
} else {
video.classList.remove('active');
video.innerHTML = '';
}
});
});