Skip to content

Commit

Permalink
Merge pull request #613 from redSpoutnik/reset-subtitle-sync
Browse files Browse the repository at this point in the history
reset subtitle offset on next episode play

(cherry picked from commit b67e317)
Signed-off-by: Joshua Boniface <[email protected]>
  • Loading branch information
dkanada authored and joshuaboniface committed Dec 6, 2019
1 parent 298d8d7 commit bc66fad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/htmlvideoplayer/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
var currentAssRenderer;
var customTrackIndex = -1;

var showTrackOffset = false;
var showTrackOffset;
var currentTrackOffset;

var videoSubtitlesElem;
Expand Down Expand Up @@ -280,6 +280,8 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa

self._currentTime = null;

self.resetSubtitleOffset();

return createMediaElement(options).then(function (elem) {

return updateVideoUrl(options, options.mediaSource).then(function () {
Expand Down Expand Up @@ -560,6 +562,11 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
setCurrentTrackElement(index);
};

self.resetSubtitleOffset = function() {
currentTrackOffset = 0;
showTrackOffset = false;
}

self.enableShowingSubtitleOffset = function() {
showTrackOffset = true;
}
Expand Down

0 comments on commit bc66fad

Please sign in to comment.