0

How to add event listener in AngularJS? I'm working on video tag with AngularJS, it's my code:

HTML

<video id="video" width="400" controls>
   <source src="http://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
</video>

<script>
document.addEventListener("visibilitychange", onchange);
function onchange (evt) {
   document.getElementById("video").pause();
}
</script>
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
chozhan
  • 181
  • 2
  • 17

0 Answers0