lundi 9 mars 2020

There is a way to sync current time with video time using JavaScript / jQuery?

Quest

Im trying to do a "streaming" page of a single video.
People login to a page. All this people are from a single country area then all this people have the same current time. I have a video file that I want to reproduce at (in example) 4 o'clock. If is 4:05 I need the video have 5 minutes of elapsed time (I can explain if I not explain now).

Try

Using something similar to:

function myFunction() {
    document.getElementById("demo").innerHTML = vid.currentTime;
}

To get current video time

And Using something like

var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();

To get the current client time

Question

But how to sync client time and video time?
Greetings




Aucun commentaire:

Enregistrer un commentaire