Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Unified Diff: ui/file_manager/video_player/js/media_controls.js

Issue 667513003: Show reload button only when the slider is at the end. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/video_player/js/media_controls.js
diff --git a/ui/file_manager/video_player/js/media_controls.js b/ui/file_manager/video_player/js/media_controls.js
index efe023140fe66457741f3cc7843dd8f02c96ba10..5bbbd9eca439db8895c7f892efb4ce2d84d2598e 100644
--- a/ui/file_manager/video_player/js/media_controls.js
+++ b/ui/file_manager/video_player/js/media_controls.js
@@ -489,15 +489,15 @@ MediaControls.prototype.onPlayStateChanged = function() {};
* @private
*/
MediaControls.prototype.updatePlayButtonState_ = function(playing) {
- if (playing) {
+ if (this.media_.ended && this.progressSlider_.isAtEnd()) {
this.playButton_.setAttribute('state',
- MediaControls.ButtonStateType.PLAYING);
- } else if (!this.media_.ended) {
+ MediaControls.ButtonStateType.ENDED);
+ } else if (playing) {
this.playButton_.setAttribute('state',
- MediaControls.ButtonStateType.DEFAULT);
+ MediaControls.ButtonStateType.PLAYING);
} else {
this.playButton_.setAttribute('state',
- MediaControls.ButtonStateType.ENDED);
+ MediaControls.ButtonStateType.DEFAULT);
}
};
@@ -708,6 +708,14 @@ MediaControls.Slider.prototype.onInputDrag_ = function(on) {
};
/**
+ * Check if the slider position is at the end of the control.
+ * @return {boolean} True if the slider position is at the end.
+ */
+MediaControls.Slider.prototype.isAtEnd = function() {
+ return this.input_.value === this.input_.max;
+};
+
+/**
* Create a customized slider with animated thumb movement.
*
* @param {HTMLElement} container The containing div element.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698