Video on loop
by anmol sandal
HTML
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<video id="myVideo" height="600" width="300" poster="http://content.bitsontherun.com/thumbs/bkaovAYt-320.jpg" autoplay="" loop="" muted="" controls="0">
<source src="http://content.bitsontherun.com/videos/bkaovAYt-52qL9xLP.mp4">
<source src="http://content.bitsontherun.com/videos/bkaovAYt-27m5HpIu.webm">
<p class="warning">Your browser does not support HTML5 video.</p>
</video>
JavaScript
//For Firefox we have to handle it in JavaScript
var vids = $("video");
$.each(vids, function(){
this.controls = false;
});
//Loop though all Video tags and set Controls as false
$("video").click(function() {
//console.log(this);
if (this.paused) {
this.play();
} else {
this.pause();
}
});