Skip to content

Commit

Permalink
Added fail fast in case liveMaxLatencyDurationCount <= liveSyncDurati…
Browse files Browse the repository at this point in the history
…onCount,

as player would not stop seeking
  • Loading branch information
Axel Delmas committed Oct 15, 2015
1 parent 2d10797 commit b4091fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ decreasing this value is likely to cause playback stalls.
maximum delay allowed from edge of live, expressed in multiple of ```EXT-X-TARGETDURATION```.
if set to 10, the player will seek back to ```liveSyncDurationCount``` whenever the next fragment to be loaded is older than N-10, N being the last fragment of the live playlist.
If set, this value must be stricly superior to ```liveSyncDurationCount```
a value too close from ```liveSyncDurationCount``` is likely to cause playback stalls.
#### ```enableWorker```
Expand Down
5 changes: 5 additions & 0 deletions src/hls.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ class Hls {
if (prop in config) { continue; }
config[prop] = configDefault[prop];
}

if (config.liveMaxLatencyDurationCount !== undefined && config.liveMaxLatencyDurationCount <= config.liveSyncDurationCount) {
throw new Error('Illegal hls.js configuration: "liveMaxLatencyDurationCount" must be strictly superior to "liveSyncDurationCount" in player configuration');
}

enableLogs(config.debug);
this.config = config;
// observer setup
Expand Down

0 comments on commit b4091fa

Please sign in to comment.