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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * TODO(mtomasz): Rewrite the entire audio player. | 8 * TODO(mtomasz): Rewrite the entire audio player. |
9 * | 9 * |
10 * @param {HTMLElement} container Container element. | 10 * @param {HTMLElement} container Container element. |
11 * @constructor | 11 * @constructor |
12 */ | 12 */ |
13 function AudioPlayer(container) { | 13 function AudioPlayer(container) { |
14 this.container_ = container; | 14 this.container_ = container; |
15 this.metadataCache_ = MetadataCache.createFull(); | |
16 this.currentTrack_ = -1; | 15 this.currentTrack_ = -1; |
17 this.playlistGeneration_ = 0; | 16 this.playlistGeneration_ = 0; |
18 this.selectedEntry_ = null; | 17 this.selectedEntry_ = null; |
19 this.volumeManager_ = new VolumeManagerWrapper( | 18 this.volumeManager_ = new VolumeManagerWrapper( |
20 VolumeManagerWrapper.DriveEnabledStatus.DRIVE_ENABLED); | 19 VolumeManagerWrapper.DriveEnabledStatus.DRIVE_ENABLED); |
| 20 this.metadataCache_ = MetadataCache.createFull(this.volumeManager_); |
21 | 21 |
22 this.container_.classList.add('collapsed'); | 22 this.container_.classList.add('collapsed'); |
23 | 23 |
24 function createChild(opt_className, opt_tag) { | 24 function createChild(opt_className, opt_tag) { |
25 var child = container.ownerDocument.createElement(opt_tag || 'div'); | 25 var child = container.ownerDocument.createElement(opt_tag || 'div'); |
26 if (opt_className) | 26 if (opt_className) |
27 child.className = opt_className; | 27 child.className = opt_className; |
28 container.appendChild(child); | 28 container.appendChild(child); |
29 return child; | 29 return child; |
30 } | 30 } |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 * Restore the state after page/app reload. | 619 * Restore the state after page/app reload. |
620 */ | 620 */ |
621 FullWindowAudioControls.prototype.restorePlayState = function() { | 621 FullWindowAudioControls.prototype.restorePlayState = function() { |
622 if (this.restoreWhenLoaded_) { | 622 if (this.restoreWhenLoaded_) { |
623 this.restoreWhenLoaded_ = false; // This should only work once. | 623 this.restoreWhenLoaded_ = false; // This should only work once. |
624 if (this.decodeState()) | 624 if (this.decodeState()) |
625 return; | 625 return; |
626 } | 626 } |
627 this.play(); | 627 this.play(); |
628 }; | 628 }; |
OLD | NEW |