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

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

Issue 573233002: Video Player: Prevent showing the status icon on unnecessary timing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve reliability of short-interval clicks Created 6 years, 3 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 | « ui/file_manager/video_player/css/media_controls.css ('k') | 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 8d63495b2e60d3e47deef5da9cfb806d94d8ee51..aa45bfdd35fedcc058d5f44b5e14eb21adb6c965 100644
--- a/ui/file_manager/video_player/js/media_controls.js
+++ b/ui/file_manager/video_player/js/media_controls.js
@@ -1013,9 +1013,22 @@ VideoControls.prototype = { __proto__: MediaControls.prototype };
* @private
*/
VideoControls.prototype.showIconFeedback_ = function() {
- this.stateIcon_.removeAttribute('state');
+ var stateIcon = this.stateIcon_;
+ stateIcon.removeAttribute('state');
+
setTimeout(function() {
- this.stateIcon_.setAttribute('state', this.isPlaying() ? 'play' : 'pause');
+ var newState = this.isPlaying() ? 'play' : 'pause';
+
+ var onAnimationEnd = function(state, event) {
+ if (stateIcon.getAttribute('state') === state)
+ stateIcon.removeAttribute('state');
+
+ stateIcon.removeEventListener('webkitAnimationEnd', onAnimationEnd);
+ }.bind(null, newState);
+ stateIcon.addEventListener('webkitAnimationEnd', onAnimationEnd);
+
+ // Shows the icon with animation.
+ stateIcon.setAttribute('state', newState);
}.bind(this), 0);
};
« no previous file with comments | « ui/file_manager/video_player/css/media_controls.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698