| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // TODO(yoshiki): Handle error in better way. | 479 // TODO(yoshiki): Handle error in better way. |
| 479 // TODO(yoshiki): implement artwork (metadata.thumbnail) | 480 // TODO(yoshiki): implement artwork (metadata.thumbnail) |
| 480 this.title = metadata.mediaTitle || this.getDefaultTitle(); | 481 this.title = metadata.mediaTitle || this.getDefaultTitle(); |
| 481 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); | 482 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); |
| 482 }; | 483 }; |
| 483 | 484 |
| 484 // Starts loading the audio player. | 485 // Starts loading the audio player. |
| 485 window.addEventListener('DOMContentLoaded', function(e) { | 486 window.addEventListener('DOMContentLoaded', function(e) { |
| 486 AudioPlayer.load(); | 487 AudioPlayer.load(); |
| 487 }); | 488 }); |
| OLD | NEW |