Skip to content

Commit

Permalink
change path of time-ranges in all depending modules + some docs here …
Browse files Browse the repository at this point in the history
…and there
  • Loading branch information
tchakabam committed Feb 3, 2018
1 parent 216936f commit 6b65faf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/controller/audio-stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import BufferHelper from '../helper/buffer-helper';
import Demuxer from '../demux/demuxer';
import Event from '../events';
import * as LevelHelper from '../helper/level-helper';
import TimeRanges from '../utils/timeRanges';
import TimeRanges from '../utils/time-ranges';
import {ErrorTypes, ErrorDetails} from '../errors';
import {logger} from '../utils/logger';
import { findFragWithCC } from '../utils/discontinuities';
Expand Down
27 changes: 14 additions & 13 deletions src/controller/stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Event from '../events';
import {FragmentState} from '../helper/fragment-tracker';
import Fragment from '../loader/fragment';
import * as LevelHelper from '../helper/level-helper';
import TimeRanges from '../utils/timeRanges';
import TimeRanges from '../utils/time-ranges';
import {ErrorTypes, ErrorDetails} from '../errors';
import {logger} from '../utils/logger';
import { alignDiscontinuities } from '../utils/discontinuities';
Expand Down Expand Up @@ -639,13 +639,13 @@ class StreamController extends TaskLoop {
this.flushMainBuffer(0,Number.POSITIVE_INFINITY);
}

/*
on immediate level switch end, after new fragment has been buffered :
- nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)
- resume the playback if needed
*/
/**
* on immediate level switch end, after new fragment has been buffered:
* - nudge video decoder by slightly adjusting video currentTime (if currentTime buffered)
* - resume the playback if needed
*/
immediateLevelSwitchEnd() {
let media = this.media;
const media = this.media;
if (media && media.buffered.length) {
this.immediateSwitch = false;
if(BufferHelper.isBuffered(media,media.currentTime)) {
Expand All @@ -658,13 +658,14 @@ class StreamController extends TaskLoop {
}
}

/**
* try to switch ASAP without breaking video playback:
* in order to ensure smooth but quick level switching,
* we need to find the next flushable buffer range
* we should take into account new segment fetch time
*/
nextLevelSwitch() {
/* try to switch ASAP without breaking video playback :
in order to ensure smooth but quick level switching,
we need to find the next flushable buffer range
we should take into account new segment fetch time
*/
let media = this.media;
const media = this.media;
// ensure that media is defined and that metadata are available (to retrieve currentTime)
if (media && media.readyState) {
let fetchdelay, fragPlayingCurrent, nextBufferedFrag;
Expand Down
4 changes: 4 additions & 0 deletions src/controller/subtitle-track-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class SubtitleTrackController extends EventHandler {
this.tracks = [];
this.trackId = -1;
this.media = undefined;

/**
* @member {boolean} subtitleDisplay Enable/disable subtitle display rendering
*/
this.subtitleDisplay = false;
}

Expand Down

0 comments on commit 6b65faf

Please sign in to comment.