diff --git a/src/playlist-controller.js b/src/playlist-controller.js index 76106be1a..c37425f52 100644 --- a/src/playlist-controller.js +++ b/src/playlist-controller.js @@ -937,27 +937,25 @@ export class PlaylistController extends videojs.EventTarget { this.onEndOfStream(); }); - // In DASH, there is the possibility of the video segment and the audio segment + // There is the possibility of the video segment and the audio segment // at a current time to be on different timelines. When this occurs, the player // forwards playback to a point where these two segment types are back on the same // timeline. This time will be just after the end of the audio segment that is on // a previous timeline. - if (this.sourceType_ === 'dash') { - this.timelineChangeController_.on('audioTimelineBehind', () => { - const segmentInfo = this.audioSegmentLoader_.pendingSegment_; + this.timelineChangeController_.on('audioTimelineBehind', () => { + const segmentInfo = this.audioSegmentLoader_.pendingSegment_; - if (!segmentInfo || !segmentInfo.segment || !segmentInfo.segment.syncInfo) { - return; - } + if (!segmentInfo || !segmentInfo.segment || !segmentInfo.segment.syncInfo) { + return; + } - // Update the current time to just after the faulty audio segment. - // This moves playback to a spot where both audio and video segments - // are on the same timeline. - const newTime = segmentInfo.segment.syncInfo.end + 0.01; + // Update the current time to just after the faulty audio segment. + // This moves playback to a spot where both audio and video segments + // are on the same timeline. + const newTime = segmentInfo.segment.syncInfo.end + 0.01; - this.tech_.setCurrentTime(newTime); - }); - } + this.tech_.setCurrentTime(newTime); + }); this.mainSegmentLoader_.on('earlyabort', (event) => { // never try to early abort with the new ABR algorithm diff --git a/src/segment-loader.js b/src/segment-loader.js index b98321d6a..877209e78 100644 --- a/src/segment-loader.js +++ b/src/segment-loader.js @@ -475,8 +475,7 @@ const checkAndFixTimelines = (segmentLoader) => { }); if (waitingForTimelineChange && shouldFixBadTimelineChanges(segmentLoader.timelineChangeController_)) { - // Audio being behind should only happen on DASH sources. - if (segmentLoader.sourceType_ === 'dash' && isAudioTimelineBehind(segmentLoader)) { + if (isAudioTimelineBehind(segmentLoader)) { segmentLoader.timelineChangeController_.trigger('audioTimelineBehind'); return; } diff --git a/test/segment-loader.test.js b/test/segment-loader.test.js index dafdbd506..0d90b2259 100644 --- a/test/segment-loader.test.js +++ b/test/segment-loader.test.js @@ -1789,7 +1789,7 @@ QUnit.module('SegmentLoader', function(hooks) { }); }); - QUnit.test('triggers event when DASH audio timeline is behind main', function(assert) { + QUnit.test('triggers event when audio timeline is behind main', function(assert) { loader.dispose(); loader = new SegmentLoader(LoaderCommonSettings.call(this, { loaderType: 'audio',