Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

Commit

Permalink
Video player: Interpret paper-slider's ratio property properly.
Browse files Browse the repository at this point in the history
paper-slider v2.0.2 has a breaking change.
PolymerElements/paper-slider#194
|ratio| property used to return a value in [0, 1], but now it returns a value in
[0, 100].
Making video player to catch up this change by dividing |ratio| property by 100.

Bug: 752283
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Iad994a2dd7f8a6e5b77698a0deec0812c70fb045
Reviewed-on: https://chromium-review.googlesource.com/646153
Reviewed-by: Yoshiki Iguchi <[email protected]>
Commit-Queue: Naoki Fukino <[email protected]>
Cr-Commit-Position: refs/heads/master@{#499126}
  • Loading branch information
Naoki Fukino authored and Commit Bot committed Sep 1, 2017
1 parent 5b5b7cb commit 81d2a76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/file_manager/video_player/js/media_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ MediaControls.prototype.initTimeControls = function(opt_parent) {
this.progressSlider_.setAttribute('aria-label',
str('MEDIA_PLAYER_SEEK_SLIDER_LABEL'));
this.progressSlider_.addEventListener('change', function(event) {
this.onProgressChange_(this.progressSlider_.ratio);
this.onProgressChange_(this.progressSlider_.ratio / 100);
}.bind(this));
this.progressSlider_.addEventListener(
'immediate-value-change',
Expand Down Expand Up @@ -452,7 +452,7 @@ MediaControls.prototype.skip_ = function(sec) {
this.progressSlider_.value = Math.max(Math.min(
this.progressSlider_.value + stepsToSkip,
this.progressSlider_.max), 0);
this.onProgressChange_(this.progressSlider_.ratio);
this.onProgressChange_(this.progressSlider_.ratio / 100);
}
};

Expand Down Expand Up @@ -582,7 +582,7 @@ MediaControls.prototype.initVolumeControls = function(opt_parent) {
this.volume_.setAttribute('aria-label',
str('MEDIA_PLAYER_VOLUME_SLIDER_LABEL'));
this.volume_.addEventListener('change', function(event) {
this.onVolumeChange_(this.volume_.ratio);
this.onVolumeChange_(this.volume_.ratio / 100);
}.bind(this));
this.volume_.addEventListener('immediate-value-change', function(event) {
this.onVolumeDrag_();
Expand Down

0 comments on commit 81d2a76

Please sign in to comment.