diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-15 21:24:32 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-15 21:24:32 (GMT) |
commit | 6796914f4e11beb9f2dd5bc877e11194461f382e (patch) | |
tree | 246cb27d2e4be9f7a9915ca871410022fb6f690e | |
parent | 8f9d869e8242312c65419d85bc23f4a6748edd0f (diff) | |
download | soup-transcoding-proxy-6796914f4e11beb9f2dd5bc877e11194461f382e.zip soup-transcoding-proxy-6796914f4e11beb9f2dd5bc877e11194461f382e.tar.gz |
HTML/JS code for experimental browser latency reduction
-rw-r--r-- | stp-playback.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/stp-playback.html b/stp-playback.html new file mode 100644 index 0000000..00b1eb0 --- /dev/null +++ b/stp-playback.html @@ -0,0 +1,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> |