9
I added a video right when starting the site and I wanted it to be on autoplay.
I know that if I put it on the page on Html5 it would run as well as I did the test. But as it is inside this box and using js, it does not start.
The code of the js script I’m using is this:
<script>
$(document).ready(function(){
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
$.colorbox({href:"comunicado.php"});
$('#video_player').prop('autoplay', true);
});
</script>
and in the html video I’ve set so:
<video width="99%" height="500" controls="controls" autoplay="autoplay">
<source id="video_player" src="comercial.mp4" type="video/mp4">
</video>
I tried several ways, but as I am not an expert I do not know what is happening. I would love your help!
remember that the browser has restrictions for videos configured with "auto play", for example they are set to mute by default
– Vinicius Dutra