| 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 |
| 11 /** | 11 /** |
| 12 * @param {Element} container Container element. | 12 * @param {Element} container Container element. |
| 13 * @constructor | 13 * @constructor |
| 14 */ | 14 */ |
| 15 function AudioPlayer(container) { | 15 function AudioPlayer(container) { |
| 16 this.container_ = container; | 16 this.container_ = container; |
| 17 this.volumeManager_ = new VolumeManagerWrapper( | 17 this.volumeManager_ = new VolumeManagerWrapper(AllowedPaths.ANY_PATH); |
| 18 VolumeManagerWrapper.NonNativeVolumeStatus.ENABLED); | |
| 19 this.metadataModel_ = MetadataModel.create(this.volumeManager_); | 18 this.metadataModel_ = MetadataModel.create(this.volumeManager_); |
| 20 this.selectedEntry_ = null; | 19 this.selectedEntry_ = null; |
| 21 this.invalidTracks_ = {}; | 20 this.invalidTracks_ = {}; |
| 22 this.entries_ = []; | 21 this.entries_ = []; |
| 23 this.currentTrackIndex_ = -1; | 22 this.currentTrackIndex_ = -1; |
| 24 this.playlistGeneration_ = 0; | 23 this.playlistGeneration_ = 0; |
| 25 | 24 |
| 26 /** | 25 /** |
| 27 * Whether if the playlist is expanded or not. This value is changed by | 26 * Whether if the playlist is expanded or not. This value is changed by |
| 28 * this.syncPlaylistExpanded(). | 27 * this.syncPlaylistExpanded(). |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 // TODO(yoshiki): Handle error in better way. | 587 // TODO(yoshiki): Handle error in better way. |
| 589 this.title = metadata.mediaTitle || this.getDefaultTitle(); | 588 this.title = metadata.mediaTitle || this.getDefaultTitle(); |
| 590 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); | 589 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); |
| 591 this.artworkUrl = metadata.contentThumbnailUrl || ""; | 590 this.artworkUrl = metadata.contentThumbnailUrl || ""; |
| 592 }; | 591 }; |
| 593 | 592 |
| 594 // Starts loading the audio player. | 593 // Starts loading the audio player. |
| 595 window.addEventListener('DOMContentLoaded', function(e) { | 594 window.addEventListener('DOMContentLoaded', function(e) { |
| 596 AudioPlayer.load(); | 595 AudioPlayer.load(); |
| 597 }); | 596 }); |
| OLD | NEW |