OLD | NEW |
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 /** | 5 /** |
6 * Overrided metadata worker's path. | 6 * Overrided metadata worker's path. |
7 * @type {string} | 7 * @type {string} |
8 */ | 8 */ |
9 ContentMetadataProvider.WORKER_SCRIPT = '/js/metadata_worker.js'; | 9 ContentMetadataProvider.WORKER_SCRIPT = '/js/metadata_worker.js'; |
10 | 10 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 /** | 202 /** |
203 * Displays track's metadata. | 203 * Displays track's metadata. |
204 * @param {number} track Track number. | 204 * @param {number} track Track number. |
205 * @param {Object} metadata Metadata object. | 205 * @param {Object} metadata Metadata object. |
206 * @param {string=} opt_error Error message. | 206 * @param {string=} opt_error Error message. |
207 * @private | 207 * @private |
208 */ | 208 */ |
209 AudioPlayer.prototype.displayMetadata_ = function(track, metadata, opt_error) { | 209 AudioPlayer.prototype.displayMetadata_ = function(track, metadata, opt_error) { |
210 this.player_.tracks[track].setMetadata(metadata, opt_error); | 210 this.player_.tracks[track].setMetadata(metadata, opt_error); |
| 211 this.player_.notifyTrackMetadataUpdated(track); |
211 }; | 212 }; |
212 | 213 |
213 /** | 214 /** |
214 * Closes audio player when a volume containing the selected item is unmounted. | 215 * Closes audio player when a volume containing the selected item is unmounted. |
215 * @param {Event} event The unmount event. | 216 * @param {Event} event The unmount event. |
216 * @private | 217 * @private |
217 */ | 218 */ |
218 AudioPlayer.prototype.onExternallyUnmounted_ = function(event) { | 219 AudioPlayer.prototype.onExternallyUnmounted_ = function(event) { |
219 if (!this.selectedEntry_) | 220 if (!this.selectedEntry_) |
220 return; | 221 return; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 // TODO(yoshiki): Handle error in better way. | 495 // TODO(yoshiki): Handle error in better way. |
495 // TODO(yoshiki): implement artwork (metadata.thumbnail) | 496 // TODO(yoshiki): implement artwork (metadata.thumbnail) |
496 this.title = metadata.mediaTitle || this.getDefaultTitle(); | 497 this.title = metadata.mediaTitle || this.getDefaultTitle(); |
497 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); | 498 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); |
498 }; | 499 }; |
499 | 500 |
500 // Starts loading the audio player. | 501 // Starts loading the audio player. |
501 window.addEventListener('DOMContentLoaded', function(e) { | 502 window.addEventListener('DOMContentLoaded', function(e) { |
502 AudioPlayer.load(); | 503 AudioPlayer.load(); |
503 }); | 504 }); |
OLD | NEW |