Skip to content

Commit

Permalink
Merged in the code from controls.html.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbwatson committed Mar 27, 2012
1 parent 2dcfde1 commit a61213e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 182 deletions.
21 changes: 0 additions & 21 deletions src/main/webapp/alpha/canvas.html

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/webapp/alpha/vid.js

This file was deleted.

132 changes: 0 additions & 132 deletions src/main/webapp/controls.html

This file was deleted.

7 changes: 3 additions & 4 deletions src/main/webapp/index.html
Expand Up @@ -10,9 +10,9 @@
<h1 class="title floatLeft marginRightLarge">Demo Video</h1>
<div class="controls floatRight marginRightLarge">
<ul>
<li><input type="button" value="Play" /></li>
<li><input type="range" min="0" max="100" value="0" step="1" /></li>
<li><span id="range">0</span></li>
<li><input type="button" value="||" id="play"/></li>
<li><input type="range" id="slider" min="0" max="100" value="0" step="1" onchange="setTime(this.value)"/></li>
<li><span id="range">0 %</span></li>
</ul>
</div>
</div>
Expand All @@ -25,7 +25,6 @@ <h1 class="title floatLeft marginRightLarge">Demo Video</h1>
<canvas id="secondary" class="videoSnippet"></canvas>
</div>
</div>

</div>

<video controls>
Expand Down
26 changes: 26 additions & 0 deletions src/main/webapp/scripts/html5player.js
Expand Up @@ -45,6 +45,32 @@ steal( '../lib/jquery',
ctx.putImageData(imgData, 0, 0);
};

$video.bind('timeupdate', function () {
showValue(Math.round(100 * (video.currentTime / video.duration)));
});

function showValue(newValue) {
$('#range')[0].innerHTML = newValue + " %";
$('#slider')[0].value = newValue;
}

function setTime(newValue) {
$('#range')[0].innerHTML = newValue;
video.currentTime = Math.round(video.duration * newValue / 100);
showValue(newValue);
}

function playControl() {
if (video.paused == false) {
video.pause();
$('#play')[0].value = '>';
} else {
video.play();
$('#play')[0].value = '||';
}
}
$('#play').click(playControl);


initializeCanvases = function () {
var renderFrame;
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/style/main.css
Expand Up @@ -205,4 +205,5 @@ video { display: none; }

.bigText {
font-size: large;
}
}

0 comments on commit a61213e

Please sign in to comment.