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

Side by Side Diff: ui/file_manager/audio_player/elements/audio_player.js

Issue 1435223003: Revert of AudioPlayer: Start playing a track when play icon on the track list is clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 Polymer({ 5 Polymer({
6 is: 'audio-player', 6 is: 'audio-player',
7 7
8 properties: { 8 properties: {
9 /** 9 /**
10 * Flag whether the audio is playing or paused. True if playing, or false 10 * Flag whether the audio is playing or paused. True if playing, or false
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 * This handler is registered in this.ready(). 277 * This handler is registered in this.ready().
278 * @private 278 * @private
279 */ 279 */
280 onAudioStatusUpdate_: function() { 280 onAudioStatusUpdate_: function() {
281 this.time = (this.lastAudioUpdateTime_ = this.$.audio.currentTime * 1000); 281 this.time = (this.lastAudioUpdateTime_ = this.$.audio.currentTime * 1000);
282 this.duration = this.$.audio.duration * 1000; 282 this.duration = this.$.audio.duration * 1000;
283 this.playing = !this.$.audio.paused; 283 this.playing = !this.$.audio.paused;
284 }, 284 },
285 285
286 /** 286 /**
287 * Invoked when receivig a request to start playing the current music.
288 */
289 onPlayCurrentTrack: function() {
290 this.$.audio.play();
291 },
292
293 /**
294 * Invoked when receiving a request to replay the current music from the track 287 * Invoked when receiving a request to replay the current music from the track
295 * list element. 288 * list element.
296 */ 289 */
297 onReplayCurrentTrack: function() { 290 onReplayCurrentTrack: function() {
298 // Changes the current time back to the beginning, regardless of the current 291 // Changes the current time back to the beginning, regardless of the current
299 // status (playing or paused). 292 // status (playing or paused).
300 this.$.audio.currentTime = 0; 293 this.$.audio.currentTime = 0;
301 this.time = 0; 294 this.time = 0;
302 }, 295 },
303 296
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 461
469 /** 462 /**
470 * Computes volume value for audio element. (should be in [0.0, 1.0]) 463 * Computes volume value for audio element. (should be in [0.0, 1.0])
471 * @param {number} volume Volume which is set in the UI. ([0, 100]) 464 * @param {number} volume Volume which is set in the UI. ([0, 100])
472 * @return {number} 465 * @return {number}
473 */ 466 */
474 computeAudioVolume_: function(volume) { 467 computeAudioVolume_: function(volume) {
475 return volume / 100; 468 return volume / 100;
476 } 469 }
477 }); 470 });
OLDNEW
« no previous file with comments | « ui/file_manager/audio_player/elements/audio_player.html ('k') | ui/file_manager/audio_player/elements/track_list.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698