I am trying to get my video to play at a certain point depending on what time the day it is. For example, if it was 16:12:54 p.m my video will start playing from 16:12:54. If it was 16:13:00 p.m the video will start at 16:13:00 and so forth. For now it only plays at a certain time of the day. Many thanks.
function checkTimeAndPlay() {
var date = new Date();
if (date.getHours() == 12 && date.getMinutes() == 0) {
document.getElementById('video_id').play();
} else {
setTimeout("checkTimeAndPlay", 1000);
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>