I'm developing a Cordova app for Android and I need to put a video with some cue points controlled by buttons.
In the HTML, I have the code to load the mp4 file and the buttons. With JS I'm trying to add the cue points on a click event, but any number I put in the currentTime property, always starts from the beginning of the video. Instead of start from the point I have put.
The code I have is:
document.getElementById("video").load();
document.getElementById("video").addEventListener('loadedmetadata', function() {
document.getElementById("video").play();
document.getElementById("video").currentTime = seconds;
}, false);
I tried to change the order of the lines, because I read something over there but no results.
EDIT:
Still no results, now I'm with this:
document.getElementById("video").currentTime = seconds;
document.getElementById("video").play();
But does the same as the others.
Anyone can help?
Thanks.