1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-29 02:57:21 +02:00

Added a player option to offset the subtitles/captions timing. closes #1212

This commit is contained in:
Brad Chase 2014-05-19 13:40:04 -07:00 committed by Steve Heffernan
parent bd66416b75
commit 23ab370ab6
2 changed files with 4 additions and 2 deletions

View File

@ -25,6 +25,7 @@ CHANGELOG
* Fixed saucelabs integration to run on commits in TravisCI ([view](https://github.com/videojs/video.js/pull/1214))
* Added a clearer error message when a tech is undefined ([view](https://github.com/videojs/video.js/pull/1210))
* Added a cog icon to the font icons ([view](https://github.com/videojs/video.js/pull/1211))
* Added a player option to offset the subtitles/captions timing ([view](https://github.com/videojs/video.js/pull/1212))
--------------------

View File

@ -551,8 +551,9 @@ vjs.TextTrack.prototype.parseCueTime = function(timeText) {
vjs.TextTrack.prototype.update = function(){
if (this.cues_.length > 0) {
// Get curent player time
var time = this.player_.currentTime();
// Get current player time, adjust for track offset
var offset = this.player_.options()['trackTimeOffset'] || 0;
var time = this.player_.currentTime() + offset;
// Check if the new time is outside the time box created by the the last update.
if (this.prevChange === undefined || time < this.prevChange || this.nextChange <= time) {