changed video tag to img and script logic also
Some checks failed
buildbot/travis_bionic Build done.
Some checks failed
buildbot/travis_bionic Build done.
This commit is contained in:
parent
a2fb88783e
commit
79282eb4ce
31
index.html
31
index.html
|
@ -28,31 +28,36 @@
|
||||||
<!-- Sidebar scroller start -->
|
<!-- Sidebar scroller start -->
|
||||||
<div class="video-list">
|
<div class="video-list">
|
||||||
<div class="vid active">
|
<div class="vid active">
|
||||||
<video controls muted preload="none" poster="00-intro.png">
|
<!-- <video controls muted preload="none" poster="00-intro.png">
|
||||||
<source src="00-intro.mp4" type="video/mp4">
|
<source src="00-intro.mp4" type="video/mp4">
|
||||||
<track default src="00-intro.vtt" kind="captions" srclang="en" label="English">
|
<track default src="00-intro.vtt" kind="captions" srclang="en" label="English">
|
||||||
</video>
|
</video> -->
|
||||||
|
<img src="00-intro.png" alt="00-intro" data-video="00-intro.mp4" data-vtt="00-intro.vtt">
|
||||||
|
|
||||||
<h3 class="title">01. Intro</h3>
|
<h3 class="title">01. Intro</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="vid">
|
<div class="vid">
|
||||||
<video controls muted preload="none" poster="01-analogies.png">
|
<img src="01-analogies.png" alt="01-analogies" data-video="01-analogies.mp4" data-vtt="01-analogies.vtt">
|
||||||
|
<!-- <video controls muted preload="none" poster="01-analogies.png">
|
||||||
<source src="01-analogies.mp4" type="video/mp4">
|
<source src="01-analogies.mp4" type="video/mp4">
|
||||||
<track default src="01-analogies.vtt" kind="captions" srclang="en" label="English">
|
<track default src="01-analogies.vtt" kind="captions" srclang="en" label="English">
|
||||||
</video>
|
</video> -->
|
||||||
<h3 class="title">02. Analogies</h3>
|
<h3 class="title">02. Analogies</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="vid">
|
<div class="vid">
|
||||||
<video controls muted preload="none" poster="02-principles.png">
|
<img src="02-principles.png" alt="02-principles" data-video="02-principles.mp4" data-vtt="02-principles.vtt">
|
||||||
|
<!-- <video controls muted preload="none" poster="02-principles.png">
|
||||||
<source src="02-principles.mp4" type="video/mp4">
|
<source src="02-principles.mp4" type="video/mp4">
|
||||||
<track default src="02-principles.vtt" kind="captions" srclang="en" label="English">
|
<track default src="02-principles.vtt" kind="captions" srclang="en" label="English">
|
||||||
</video>
|
</video> -->
|
||||||
<h3 class="title">03. Principles</h3>
|
<h3 class="title">03. Principles</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="vid">
|
<div class="vid">
|
||||||
<video controls muted preload="none" poster="03-faq.png">
|
<img src="03-faq.png" alt="03-faq" data-video="03-faq.mp4" data-vtt="03-faq.vtt">
|
||||||
|
<!-- <video controls muted preload="none" poster="03-faq.png">
|
||||||
<source src="03-faq.mp4" type="video/mp4">
|
<source src="03-faq.mp4" type="video/mp4">
|
||||||
<track default src="03-faq.vtt" kind="captions" srclang="en" label="English">
|
<track default src="03-faq.vtt" kind="captions" srclang="en" label="English">
|
||||||
</video>
|
</video> -->
|
||||||
<h3 class="title">04. FAQ</h3>
|
<h3 class="title">04. FAQ</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,13 +73,13 @@
|
||||||
video.onclick = () =>{
|
video.onclick = () =>{
|
||||||
listVideo.forEach(vid => vid.classList.remove('active'));
|
listVideo.forEach(vid => vid.classList.remove('active'));
|
||||||
video.classList.add('active');
|
video.classList.add('active');
|
||||||
console.log("video",video)
|
let src = document.getElementsByClassName('active').item('img').children[0].attributes['data-video'].nodeValue;
|
||||||
let src = document.getElementsByClassName('active').item('video').children[0].currentSrc;
|
// let vtt = document.getElementsByClassName('active').item('img').children[0].attributes['data-vtt'].nodeValue;
|
||||||
let poster = document.getElementsByClassName('active').item('video').children[0].attributes.poster.nodeValue;
|
let poster = document.getElementsByClassName('active').item('img').children[0].src;
|
||||||
if(video.classList.contains('active')){
|
if(video.classList.contains('active')){
|
||||||
console.log("here is the src",src)
|
|
||||||
console.log("0-0-0-", poster)
|
|
||||||
mainVideo.src = src;
|
mainVideo.src = src;
|
||||||
|
mainVideo.children[0].attributes['src'].nodeValue = src;
|
||||||
|
// mainVideo.children[1].attributes['src'].nodeValue = vtt;
|
||||||
mainVideo.poster = poster;
|
mainVideo.poster = poster;
|
||||||
let text = video.children[1].innerHTML;
|
let text = video.children[1].innerHTML;
|
||||||
title.innerHTML = text;
|
title.innerHTML = text;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user