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:
parent
bd66416b75
commit
23ab370ab6
@ -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))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user