Skip to content

Commit

Permalink
do not throw error if level details is not defined (video-dev#1754)
Browse files Browse the repository at this point in the history
  • Loading branch information
senaev authored and johnBartos committed Jun 27, 2018
1 parent 8283b34 commit 42ccf7c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/controller/abr-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,13 @@ class AbrController extends EventHandler {

_findBestLevel (currentLevel, currentFragDuration, currentBw, minAutoLevel, maxAutoLevel, maxFetchDuration, bwFactor, bwUpFactor, levels) {
for (let i = maxAutoLevel; i >= minAutoLevel; i--) {
let levelInfo = levels[i],
levelDetails = levelInfo.details,
let levelInfo = levels[i];

if (!levelInfo) {
continue;
}

let levelDetails = levelInfo.details,
avgDuration = levelDetails ? levelDetails.totalduration / levelDetails.fragments.length : currentFragDuration,
live = levelDetails ? levelDetails.live : false,
adjustedbw;
Expand Down

0 comments on commit 42ccf7c

Please sign in to comment.