| 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(AllowedPaths.ANY_PATH); | 17 this.volumeManager_ = new VolumeManagerWrapper(AllowedPaths.ANY_PATH, false); |
| 18 this.metadataModel_ = MetadataModel.create(this.volumeManager_); | 18 this.metadataModel_ = MetadataModel.create(this.volumeManager_); |
| 19 this.selectedEntry_ = null; | 19 this.selectedEntry_ = null; |
| 20 this.invalidTracks_ = {}; | 20 this.invalidTracks_ = {}; |
| 21 this.entries_ = []; | 21 this.entries_ = []; |
| 22 this.currentTrackIndex_ = -1; | 22 this.currentTrackIndex_ = -1; |
| 23 this.playlistGeneration_ = 0; | 23 this.playlistGeneration_ = 0; |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * 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 |
| 27 * this.syncPlaylistExpanded(). | 27 * this.syncPlaylistExpanded(). |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 // TODO(yoshiki): Handle error in better way. | 621 // TODO(yoshiki): Handle error in better way. |
| 622 this.title = metadata.mediaTitle || this.getDefaultTitle(); | 622 this.title = metadata.mediaTitle || this.getDefaultTitle(); |
| 623 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); | 623 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); |
| 624 this.artworkUrl = metadata.contentThumbnailUrl || ""; | 624 this.artworkUrl = metadata.contentThumbnailUrl || ""; |
| 625 }; | 625 }; |
| 626 | 626 |
| 627 // Starts loading the audio player. | 627 // Starts loading the audio player. |
| 628 window.addEventListener('DOMContentLoaded', function(e) { | 628 window.addEventListener('DOMContentLoaded', function(e) { |
| 629 AudioPlayer.load(); | 629 AudioPlayer.load(); |
| 630 }); | 630 }); |
| OLD | NEW |