I have a page with a autoplaying background video. On this page, there is a link to open a video lightbox. I would like the background video to pause once the link to open the lightbox is clicked, but I can't seem to figure it out. I can get the background video to pause when I click it but not when I click the link for the lightbox. I am using fullpage.js and html5lightbox.
HTML:
<div class="section" id="section1" data-anchor="1stPage">
<video autoplay loop muted id="bgVideo" >
<source src="_media/web_intro.mp4" type="video/mp4">
<source src="" type="video/ogg">
</video>
<div id="introText">
<h1>Movie-style storytelling for business</h1>
<h2>Here to save you from yet another deck</h2>
<div id="box">
<a href="_media/trailer.mp4" data-ogg="_media/trailer.theora.ogv" class="html5lightbox"><i>highlight reel</i></a>
</div>
</div>
</div>
SCRIPT:
$('#bgVideo').click(function(){this.paused?this.play():this.pause();});