Skip to content

Commit

Permalink
Udpated playbackRate menu to work in minified version. closes #1223
Browse files Browse the repository at this point in the history
  • Loading branch information
heff committed May 20, 2014
1 parent d01de49 commit 3f9a2ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHANGELOG
=========

## HEAD (Unreleased)
_(none)_
* Udpated playbackRate menu to work in minified version ([view](https://github.com/videojs/video.js/pull/1223))

--------------------

Expand Down
10 changes: 5 additions & 5 deletions src/js/control-bar/playback-rate-menu-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ vjs.PlaybackRateMenuButton.prototype.createEl = function(){
// Menu creation
vjs.PlaybackRateMenuButton.prototype.createMenu = function(){
var menu = new vjs.Menu(this.player());
var rates = this.player().options().playbackRates;
var rates = this.player().options()['playbackRates'];

if (rates) {
for (var i = rates.length - 1; i >= 0; i--) {
menu.addChild(
new vjs.PlaybackRateMenuItem(this.player(), {rate: rates[i] + 'x'})
new vjs.PlaybackRateMenuItem(this.player(), { 'rate': rates[i] + 'x'})
);
};
}
Expand All @@ -58,7 +58,7 @@ vjs.PlaybackRateMenuButton.prototype.updateARIAAttributes = function(){
vjs.PlaybackRateMenuButton.prototype.onClick = function(){
// select next rate option
var currentRate = this.player().playbackRate();
var rates = this.player().options().playbackRates;
var rates = this.player().options()['playbackRates'];
// this will select first one if the last one currently selected
var newRate = rates[0];
for (var i = 0; i <rates.length ; i++) {
Expand All @@ -73,8 +73,8 @@ vjs.PlaybackRateMenuButton.prototype.onClick = function(){
vjs.PlaybackRateMenuButton.prototype.playbackRateSupported = function(){
return this.player().tech
&& this.player().tech.features['playbackRate']
&& this.player().options().playbackRates
&& this.player().options().playbackRates.length > 0
&& this.player().options()['playbackRates']
&& this.player().options()['playbackRates'].length > 0
;
};

Expand Down

0 comments on commit 3f9a2ca

Please sign in to comment.