Set the start time of a video in hml5

0

I have a simple code in html5:

<video width="800px" height="450px" preload="auto" autoplay>
    <source src="video1.mp4" type="video/mp4">
    <source src="video1.webm" type="video/webm">
    <source src="video1.ogv" type="video/ogv">

    Tu navegador no soporta los vídeos de HTML5
</video>

I need this video to start playing every day at the same time. For example at 14:30 UTC I have not been able to achieve it and I can not find answers on the web. Thanks.

    
asked by Chenka 12.11.2018 в 23:55
source

1 answer

0

I do not understand why but:

setInterval(() => {
var d = new Date();
console.log(d.getHours()+":"+d.getMinutes());
 if( (d.getHours()+":"+d.getMinutes()) == "10:7"){ 
 document.getElementById("video").play();
  }
}, 3000);
<video  width="320" height="176" id="video">
  <source src="https://www.w3schools.com/tags/mov_bbb.mp4" type="video/mp4">
  <source src="https://download.blender.org/peach/trailer/trailer_400p.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>
    
answered by 13.11.2018 в 02:53