Unverified Commit 4ad90e46 authored by boklm's avatar boklm
Browse files

play_videos.html: add result to a test_result element

Set "OK" in a test_result element when the test finished.
parent 0291fd39
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
</head> </head>
<body> <body>
<div id="videos" /> <div id="videos" />
<div id="finished" />
<script> <script>
const videos = [ const videos = [
...@@ -22,10 +21,14 @@ for (var i = 0; i < videos.length; i++) { ...@@ -22,10 +21,14 @@ for (var i = 0; i < videos.length; i++) {
v.src = videos[i]; v.src = videos[i];
v.controls = 1; v.controls = 1;
v.addEventListener("ended", function() { v.addEventListener("ended", function() {
if (next[this.id]) if (next[this.id]) {
document.getElementById(next[this.id]).play(); document.getElementById(next[this.id]).play();
else } else {
document.getElementById("finished").innerHTML = 'finished'; var result = document.createElement('div');
result.innerHTML = 'OK';
result.setAttribute("id", "test_result");
document.getElementsByTagName("body")[0].appendChild(result);
}
}, true); }, true);
if (i + 1 < videos.length) if (i + 1 < videos.length)
next[v.id] = 'videos_' + (i + 1).toString(); next[v.id] = 'videos_' + (i + 1).toString();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment