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

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

Issue 1581573004: Audio Player: Notify track metadata update to track-list element explicitly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | ui/file_manager/audio_player/js/audio_player.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 342
343 this.$.trackList.tracks = tracks; 343 this.$.trackList.tracks = tracks;
344 var currentTrack = this.$.trackList.getCurrentTrack(); 344 var currentTrack = this.$.trackList.getCurrentTrack();
345 if (currentTrack && currentTrack.url != this.$.audio.src) { 345 if (currentTrack && currentTrack.url != this.$.audio.src) {
346 this.$.audio.src = currentTrack.url; 346 this.$.audio.src = currentTrack.url;
347 this.$.audio.play(); 347 this.$.audio.play();
348 } 348 }
349 }, 349 },
350 350
351 /** 351 /**
352 * Notifis the track-list element that the metadata for specified track is
353 * updated.
354 * @param {number} index The index of the track whose metadata is updated.
355 */
356 notifyTrackMetadataUpdated: function(index) {
yoshiki 2016/01/14 11:10:27 nit: should we check if the argument is valid just
fukino 2016/01/14 11:32:35 Added a check for index range. Done.
357 this.$.trackList.notifyPath('tracks.' + index + '.title',
358 this.tracks[index].title);
359 this.$.trackList.notifyPath('tracks.' + index + '.artist',
360 this.tracks[index].artist);
361 },
362
363 /**
352 * Invoked when the audio player is being unloaded. 364 * Invoked when the audio player is being unloaded.
353 */ 365 */
354 onPageUnload: function() { 366 onPageUnload: function() {
355 this.$.audio.src = ''; // Hack to prevent crashing. 367 this.$.audio.src = ''; // Hack to prevent crashing.
356 }, 368 },
357 369
358 /** 370 /**
359 * Invoked when dragging state of seek bar on control panel is changed. 371 * Invoked when dragging state of seek bar on control panel is changed.
360 * During the user is dragging it, audio playback is paused temporalily. 372 * During the user is dragging it, audio playback is paused temporalily.
361 */ 373 */
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 408
397 /** 409 /**
398 * Computes volume value for audio element. (should be in [0.0, 1.0]) 410 * Computes volume value for audio element. (should be in [0.0, 1.0])
399 * @param {number} volume Volume which is set in the UI. ([0, 100]) 411 * @param {number} volume Volume which is set in the UI. ([0, 100])
400 * @return {number} 412 * @return {number}
401 */ 413 */
402 computeAudioVolume_: function(volume) { 414 computeAudioVolume_: function(volume) {
403 return volume / 100; 415 return volume / 100;
404 } 416 }
405 }); 417 });
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/audio_player/js/audio_player.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698