do client side seeking

This commit is contained in:
Sanj 2011-03-14 04:40:24 +05:30
parent 6d34d2195c
commit 9219da65ae
2 changed files with 11 additions and 2 deletions

View File

@ -108,12 +108,21 @@ function setupPadmaLink(videoObj, data) {
var annotHeight = $(window).height() - 320;
$('.annotationText').css({'height': annotHeight + "px"});
var videoElem = $('video');
videoElem.bind("loadedmetadata", function() {
$(this).get(0).currentTime = parseInt(npt2ms(linkData.tcIn) / 1000);
$(this).get(0).play();
});
videoElem.bind("play", function() {
var that = this
var displayLayers = padmaConfig.default_layers;
videoObj.interval = setInterval(function() {
var currentTime = parseInt(that.currentTime * 1000);
var time_ms = currentTime + npt2ms(linkData.tcIn);
if (currentTime > npt2ms(linkData.tcOut)) {
videoElem.get(0).pause();
videoElem.trigger("ended");
return;
}
var time_ms = currentTime; // + npt2ms(linkData.tcIn);
var allLayers = videoObj.getLayersAtTimecode(time_ms);
if (videoObj.currentLayers == allLayers) {
return;

View File

@ -92,7 +92,7 @@ $(function() {
<a title="Right-click and Save Link As to download video" target="_blank" href="<%= linkData.url %>">&darr;</a>
</span>
</div>
<video src="<%= video.getLayerVideo(linkData.tcIn, linkData.tcOut) %>" width="320" poster="<%= video.getFrame(linkData.tcIn) %>" controls="controls" autoplay="autoplay"></video>
<video src="<%= video.video.urls['320'] %>" width="320" poster="<%= video.getFrame(linkData.tcIn) %>" controls="controls" autoplay="autoplay"></video>
<div class="annotationWrapper">