Skip to content

Commit

Permalink
refactor: init timeRanges with empty object
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Mar 2, 2018
1 parent 44aa769 commit f45f692
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/helper/fragment-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class FragmentTracker extends EventHandler {
this.bufferPadding = 0.2;

this.fragments = Object.create(null);
this.timeRanges = null;
this.timeRanges = Object.create(null);

this.config = hls.config;
}
Expand Down Expand Up @@ -103,11 +103,6 @@ export class FragmentTracker extends EventHandler {
let fragmentEntity = this.fragments[fragKey];
fragmentEntity.buffered = true;

// May be null
if (!this.timeRanges) {
return
}

Object.keys(this.timeRanges).forEach(elementaryStream => {
if(fragment.hasElementaryStream(elementaryStream) === true) {
let timeRange = this.timeRanges[elementaryStream];
Expand Down

0 comments on commit f45f692

Please sign in to comment.