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>
4

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.