Skip to content

Commit

Permalink
update to fix infinity capitalization. only do css logic on valid dur…
Browse files Browse the repository at this point in the history
…ation. set any duration of less than zero to window.Infinity
  • Loading branch information
tomjohnson916 committed Apr 1, 2014
1 parent f940bef commit 2dd8284
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,16 +504,23 @@ vjs.Player.prototype.onDurationChange = function(){
// 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) {

if (duration < 0) {
duration = window.Infinity;
}

this.duration(duration);
}

// Determine if the stream is live and propagate styles down to UI.
if (duration < 0 || duration === window.INFINITY) {
this.addClass('vjs-live');
} else {
this.removeClass('vjs-live');
// Determine if the stream is live and propagate styles down to UI.
if (duration === window.Infinity) {
this.addClass('vjs-live');
} else {
this.removeClass('vjs-live');
}
}

};

/**
Expand Down

0 comments on commit 2dd8284

Please sign in to comment.