I have a html5 video loaded on my page which looks like this:
'
<div class="row">
<video controls class="vid-center" poster="<?php echo get_template_directory_uri(); ?>/img/video-bg.png" id="video-id">
<div class="video-overlay">logo and play bitton here logo and play bitton here </div>
<source src="http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag. </video>
</div>
<div class="video-cont"></div>
</section>
<div class="row">
<div class="large-3 small-4 columns">
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-vid1.png" alt=""/>
<h4>Video name 1</h4>
<p>Lorum ipsum neg reyo sum tomenyen</p>
</div>
<div class="large-3 small-4 columns">
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-vid2.png" alt=""/>
<h4>Video name 1</h4>
<p>Lorum ipsum neg reyo sum tomenyen</p>
</div>
<div class="large-3 small-4 columns">
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-vid3.png" alt=""/>
<h4>Video name 1</h4>
<p>Lorum ipsum neg reyo sum tomenyen</p>
</div>
<div class="large-3 hide-for-small-only columns">
<img src="<?php echo get_template_directory_uri(); ?>/img/thumb-vid4.png" alt=""/>
<h4>Video name 1</h4>
<p>Lorum ipsum neg reyo sum tomenyen</p>
</div>
</div>
'
I am trying to create a basic gallery so when a user selects / clicks / presses one of the thumbnail images it will load a new video into the video player i.e change the video source depending on which img / div is clicked. If thumbnail clicked then load the string src into the player and autoplay.
Is this possible to do in JavaScript to change the current video src?
Any help would be greatly appreciated.