Skip to content

Commit

Permalink
Small changed. Relates to #866.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Feb 8, 2021
1 parent 7baaa73 commit a419fd2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/image/domReader.js
Expand Up @@ -193,19 +193,21 @@ dwv.image.getViewFromDOMVideo = function (
} else {
image.appendFrameBuffer(imgBuffer);
}
// increment index
++frameIndex;
}

var nextTime = 0;

/**
* Handle seeked event
*/
function onseeked(/*event*/) {
// store
storeFrame();
// increment index
++frameIndex;
// set the next time
// (not using currentTime, it seems to get offseted)
var nextTime = frameIndex / frameRate;
nextTime += 1 / frameRate;
if (nextTime <= this.duration) {
this.currentTime = nextTime;
} else {
Expand All @@ -220,6 +222,6 @@ dwv.image.getViewFromDOMVideo = function (
}
}

// trigger the first seeked
video.currentTime = 0;
// trigger the first seek
video.currentTime = nextTime;
};

0 comments on commit a419fd2

Please sign in to comment.