some help for a video start button code

some help for a video start button code

by Bop Giessen -
Number of replies: 0

Hi,

since autoplay is unreliable, as a non-programmer, I have tried to write some code for starting a video by pushing a button. This is the only allowed control the viewer has (so no pause or stop options) on the description page in my quiz

But it does not work.....

So if someone could help me out, that would be great...


<button onclick="playVid()" type="button">Play Video</button>

<br>

 

<video id="myVideo" width="320" height="176">

  <source src="https: ***.mp4" >

 </video>

 

<script>

var vid = document.getElementById("myVideo");

 function playVid() {

  vid.play();

}

 </script>


Average of ratings: -