From 79282eb4cee93e5ed533ced456df3a420769fd6b Mon Sep 17 00:00:00 2001 From: Muzahid Date: Wed, 9 Feb 2022 22:07:27 +0530 Subject: [PATCH] changed video tag to img and script logic also --- index.html | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index 5e1cb2c..706bc77 100644 --- a/index.html +++ b/index.html @@ -28,31 +28,36 @@
-
-
-
-
@@ -68,13 +73,13 @@ video.onclick = () =>{ listVideo.forEach(vid => vid.classList.remove('active')); video.classList.add('active'); - console.log("video",video) - let src = document.getElementsByClassName('active').item('video').children[0].currentSrc; - let poster = document.getElementsByClassName('active').item('video').children[0].attributes.poster.nodeValue; + let src = document.getElementsByClassName('active').item('img').children[0].attributes['data-video'].nodeValue; + // let vtt = document.getElementsByClassName('active').item('img').children[0].attributes['data-vtt'].nodeValue; + let poster = document.getElementsByClassName('active').item('img').children[0].src; if(video.classList.contains('active')){ - console.log("here is the src",src) - console.log("0-0-0-", poster) mainVideo.src = src; + mainVideo.children[0].attributes['src'].nodeValue = src; + // mainVideo.children[1].attributes['src'].nodeValue = vtt; mainVideo.poster = poster; let text = video.children[1].innerHTML; title.innerHTML = text;