1// This is a javascript file for both mp4video.html and webmvideo.html.
2
3var videoAtStart = false;
4var testvideo = document.getElementById('testvideo');
5
6function playAndReload() {
7  // Reload video after playing for several seconds.
8  testvideo.addEventListener("timeupdate", function() {
9      if (testvideo.currentTime > 3) {
10        location.reload();
11  }});
12
13  testvideo.play();
14  videoAtStart = false;
15}
16
17function contentLoaded() {
18  testvideo.addEventListener("loadeddata", function() {
19      if (testvideo.currentTime == 0) videoAtStart = true; });
20}
21
22document.addEventListener("DOMContentLoaded", contentLoaded);
23