I'm fairly new to coding so please excuse my lack of knowledge and misuse of terminology. Basically, I have a few videos that display on my web page. I want them to start at 1 second in. The #t=1 trick doesn't work in IE, unfortunately, so I found the JS code below. I've added this to my body.js file, and it works on the first video where I've assigned the ID to, but then it stops. I understand that I need to use Class instead of ID, as ID can only be run once.
The question is, how do I rewrite the JS code so that it becomes a class, which I can then assign to the video tag as <video class="timedel"...>
.
I hope that's clear, and thank you very much for any assistance.
My JS code:
document.getElementById('timedel').addEventListener('loadedmetadata', function() {
this.currentTime = 1;
}, false);
My HTML code:
<video id="timedel" width="160px" height="120px" controls="true">
Actual: Only the first video starts at 1 second in. Desired: I'd like all videos that reference the JS code to start at 1 second in.