I have a topic that will be dedicated to indexing videos. I added the videos as .webm (due to the secure browser we're using, and the sensitive information, we can't post our videos on YouTube). Adding the videos was easy enough but we wanted the "thumbnail" (really just the paused image of the video) to sit at 3 seconds in rather than at 0:00. I did some research and found JavaScript might be useful here.
On the topic that these videos will be indexed, I added the script:
Code: Select all
<script type="text/javascript">/*<![CDATA[*/$(document).ready(function() {
v = document.querySelector('video');
v.currentTime += 3;
});/*]]>*/</script>
Any ideas? Is there some other format I'm supposed to be using or another place I should put it?
EDIT: I believe I found my newb mistake. Need to use queryselectorall instead of queryselector. It's super late here so I'll be trying it out in the morning.
EDIT 2: After doing a bit more research on Java Script, I learned about some basic capital rules. My script that ended up performing the job (just in case anyone else who's new to JS has this problem):
Code: Select all
$(document).ready(function() {
var videoArray = document.querySelectorAll('video');
videoArray.forEach(function(videoElement) {
videoElement.currentTime += 3
});
});