Skip to content

Commit

Permalink
fix undefined error
Browse files Browse the repository at this point in the history
related to video-dev#1636
  • Loading branch information
mangui committed Mar 27, 2018
1 parent b5fa8ae commit 3ed0651
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/controller/stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1473,9 +1473,10 @@ class StreamController extends TaskLoop {
use mediaBuffered instead of media (so that we will check against video.buffered ranges in case of alt audio track)
*/
const media = this.mediaBuffer ? this.mediaBuffer : this.media;
// filter fragments potentially evicted from buffer. this is to avoid memleak on live streams
this.fragmentTracker.detectEvictedFragments(Fragment.ElementaryStreamTypes.VIDEO, media.buffered);

if (media) {
// filter fragments potentially evicted from buffer. this is to avoid memleak on live streams
this.fragmentTracker.detectEvictedFragments(Fragment.ElementaryStreamTypes.VIDEO, media.buffered);
}
// move to IDLE once flush complete. this should trigger new fragment loading
this.state = State.IDLE;
// reset reference to frag
Expand Down

0 comments on commit 3ed0651

Please sign in to comment.