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. |