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

Side by Side Diff: ui/file_manager/video_player/js/media_controls.js

Issue 578823002: Video Player: Show the status icon on display when the status is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 unified diff | Download patch
« no previous file with comments | « ui/file_manager/video_player/js/cast/cast_video_element.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * @fileoverview MediaControls class implements media playback controls 8 * @fileoverview MediaControls class implements media playback controls
9 * that exist outside of the audio/video HTML element. 9 * that exist outside of the audio/video HTML element.
10 */ 10 */
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 /** 254 /**
255 * @param {boolean} on True if dragging. 255 * @param {boolean} on True if dragging.
256 * @private 256 * @private
257 */ 257 */
258 MediaControls.prototype.onProgressDrag_ = function(on) { 258 MediaControls.prototype.onProgressDrag_ = function(on) {
259 if (!this.media_) 259 if (!this.media_)
260 return; // Media is detached. 260 return; // Media is detached.
261 261
262 if (on) { 262 if (on) {
263 this.resumeAfterDrag_ = this.isPlaying(); 263 this.resumeAfterDrag_ = this.isPlaying();
264 this.media_.pause(); 264 this.media_.pause(true /* seeking */);
265 } else { 265 } else {
266 if (this.resumeAfterDrag_) { 266 if (this.resumeAfterDrag_) {
267 if (this.media_.ended) 267 if (this.media_.ended)
268 this.onMediaPlay_(false); 268 this.onMediaPlay_(false);
269 else 269 else
270 this.media_.play(); 270 this.media_.play(true /* seeking */);
271 } 271 }
272 this.updatePlayButtonState_(this.isPlaying()); 272 this.updatePlayButtonState_(this.isPlaying());
273 } 273 }
274 }; 274 };
275 275
276 /* 276 /*
277 * Volume controls 277 * Volume controls
278 */ 278 */
279 279
280 /** 280 /**
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 AudioControls.prototype.onAdvanceClick_ = function(forward) { 1227 AudioControls.prototype.onAdvanceClick_ = function(forward) {
1228 if (!forward && 1228 if (!forward &&
1229 (this.getMedia().currentTime > AudioControls.TRACK_RESTART_THRESHOLD)) { 1229 (this.getMedia().currentTime > AudioControls.TRACK_RESTART_THRESHOLD)) {
1230 // We are far enough from the beginning of the current track. 1230 // We are far enough from the beginning of the current track.
1231 // Restart it instead of than skipping to the previous one. 1231 // Restart it instead of than skipping to the previous one.
1232 this.getMedia().currentTime = 0; 1232 this.getMedia().currentTime = 0;
1233 } else { 1233 } else {
1234 this.advanceTrack_(forward); 1234 this.advanceTrack_(forward);
1235 } 1235 }
1236 }; 1236 };
OLDNEW
« no previous file with comments | « ui/file_manager/video_player/js/cast/cast_video_element.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698