I have a navigation (menu) bar with 10 videos and i want each video with its footnote shows up in one click. Now, with one click, each video comes up but i don't know how to handle different footnotes?
here is my html:
<div id="menu">
<uL>
<li>Choose a Country:</li>
<li><a href="javascript:changeSource1();">US</a></li>
<li><a href="javascript:changeSource2();">Canada</a></li>
</ul>
</div>
<div id="content">
<div class="video-player">
<video id="videos" controls>
<source id="mp4" src="Video/(name of the video).mp4" type="video/mp4" />
<source id="ogv" src="Video/(name of the video).ogv" type="video/ogg" />
</video>
</div>
<div id="video-text">
<p id="popcorn-text">Ipsum Lorem...Aenean consectetur ornare pharetra. Praesent et urna eu justo convallis sollicitudin. Nulla porttitor mi euismod neque vulputate sodales. </p>
</div>
</div>
and here is my POPCORNJS code which works only for video:
<script>
function changeSource1()
{
document.getElementById("mp4").src= "Video/(name of the video).mp4";
document.getElementById("ogv").src= "Video/(name of the video).ogv";
document.getElementById("videos").load();
}
</script>
how can I have multi-function with popcornjs code (like showing different footnotes for each video)? thanks, N
You can have as many Popcorn instances as you want, so here it makes sense to have one for each video. And each instance of Popcorn will have its own set of footnotes.We'll start with an array, and set up each video dynamically.
Now, set up the popcorn instances, load up the data, and add a click event handler for switching.
That should just about do it.
One issue is that this won't work on an iPad, because Mobile Safari freaks out if you give it more than one video on a page. In that case, just create one video element, and in the click handler, set the src attribute (mp4 only) and call
.load()
. You can still have multiple Popcorn instances on the same video tag, but when you "deactivate" an instance, just call.disable('footnote')
to keep it from showing the footnotes on the wrong video and runenable
on the active one.