summaryrefslogtreecommitdiff
path: root/stp-playback.html
blob: 00b1eb0c4f71efa53b89da57fadc3480d3f352d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<!-- vim: set sts=2 sw=2 et : -->
<head>
  <script type="text/javascript">
    function video_ready() {
      var v = document.getElementById("rt-video");
      var buf = v.buffered;
      console.log ("N: " + buf.length + ", Start: " + buf.start(0) + ", End: " + buf.end(0));
      v.currentTime = buf.end(0);
      v.play();
    }

    function setup_video() {
      var v = document.getElementById("rt-video");
      console.log ("Setup video");
      v.addEventListener("loadeddata", video_ready, true);
      v.load();
    }

    window.onload = setup_video;
  </script>
</head>
<body>
  <video id="rt-video" preload="none">
    <source src="http://localhost:8000/somepath" type="video/webm"/>
  </video>
</body>
</html>