do client side seeking
This commit is contained in:
parent
6d34d2195c
commit
9219da65ae
|
@ -108,12 +108,21 @@ function setupPadmaLink(videoObj, data) {
|
||||||
var annotHeight = $(window).height() - 320;
|
var annotHeight = $(window).height() - 320;
|
||||||
$('.annotationText').css({'height': annotHeight + "px"});
|
$('.annotationText').css({'height': annotHeight + "px"});
|
||||||
var videoElem = $('video');
|
var videoElem = $('video');
|
||||||
|
videoElem.bind("loadedmetadata", function() {
|
||||||
|
$(this).get(0).currentTime = parseInt(npt2ms(linkData.tcIn) / 1000);
|
||||||
|
$(this).get(0).play();
|
||||||
|
});
|
||||||
videoElem.bind("play", function() {
|
videoElem.bind("play", function() {
|
||||||
var that = this
|
var that = this
|
||||||
var displayLayers = padmaConfig.default_layers;
|
var displayLayers = padmaConfig.default_layers;
|
||||||
videoObj.interval = setInterval(function() {
|
videoObj.interval = setInterval(function() {
|
||||||
var currentTime = parseInt(that.currentTime * 1000);
|
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);
|
var allLayers = videoObj.getLayersAtTimecode(time_ms);
|
||||||
if (videoObj.currentLayers == allLayers) {
|
if (videoObj.currentLayers == allLayers) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -92,7 +92,7 @@ $(function() {
|
||||||
<a title="Right-click and Save Link As to download video" target="_blank" href="<%= linkData.url %>">↓</a>
|
<a title="Right-click and Save Link As to download video" target="_blank" href="<%= linkData.url %>">↓</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</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">
|
<div class="annotationWrapper">
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user