Skip to content

Commit

Permalink
Close GH-861: Bug/callstack gh 860. Fixes #860
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored and heff committed Dec 3, 2013
1 parent 15a0d7d commit 432b60f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,12 @@ vjs.Player.prototype.onEnded = function(){
*/
vjs.Player.prototype.onDurationChange = function(){
// Allows for cacheing value instead of asking player each time.
this.duration(this.techGet('duration'));
// We need to get the techGet response and check for a value so we don't
// accidentally cause the stack to blow up.
var duration = this.techGet('duration');
if (duration) {
this.duration(duration);
}
};

/**
Expand Down Expand Up @@ -681,7 +686,7 @@ vjs.Player.prototype.duration = function(seconds){
this.onDurationChange();
}

return this.cache_.duration;
return this.cache_.duration || 0;
};

// Calculates how much time is left. Not in spec, but useful.
Expand Down

0 comments on commit 432b60f

Please sign in to comment.