Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: ui/file_manager/audio_player/js/audio_player.js

Issue 2305623003: Support to repeat one song in Audio Player. (Closed)
Patch Set: Add a test for 3 repeat mode. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 this.player_ = 46 this.player_ =
47 /** @type {AudioPlayerElement} */ (document.querySelector('audio-player')); 47 /** @type {AudioPlayerElement} */ (document.querySelector('audio-player'));
48 this.player_.tracks = []; 48 this.player_.tracks = [];
49 49
50 // Restore the saved state from local storage, and update the local storage 50 // Restore the saved state from local storage, and update the local storage
51 // if the states are changed. 51 // if the states are changed.
52 var STORAGE_PREFIX = 'audioplayer-'; 52 var STORAGE_PREFIX = 'audioplayer-';
53 var KEYS_TO_SAVE_STATES = 53 var KEYS_TO_SAVE_STATES =
54 ['shuffle', 54 ['shuffle',
55 'repeat', 55 'repeat-mode',
56 'volume', 56 'volume',
57 'playlist-expanded', 57 'playlist-expanded',
58 'track-info-expanded']; 58 'track-info-expanded'];
59 var storageKeys = KEYS_TO_SAVE_STATES.map(a => STORAGE_PREFIX + a); 59 var storageKeys = KEYS_TO_SAVE_STATES.map(a => STORAGE_PREFIX + a);
60 chrome.storage.local.get(storageKeys, function(results) { 60 chrome.storage.local.get(storageKeys, function(results) {
61 // Update the UI by loaded state. 61 // Update the UI by loaded state.
62 for (var storageKey in results) { 62 for (var storageKey in results) {
63 var key = storageKey.substr(STORAGE_PREFIX.length); 63 var key = storageKey.substr(STORAGE_PREFIX.length);
64 this.player_[Polymer.CaseMap.dashToCamelCase(key)] = results[storageKey]; 64 this.player_[Polymer.CaseMap.dashToCamelCase(key)] = results[storageKey];
65 } 65 }
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 // TODO(yoshiki): Handle error in better way. 608 // TODO(yoshiki): Handle error in better way.
609 this.title = metadata.mediaTitle || this.getDefaultTitle(); 609 this.title = metadata.mediaTitle || this.getDefaultTitle();
610 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); 610 this.artist = error || metadata.mediaArtist || this.getDefaultArtist();
611 this.artworkUrl = metadata.contentThumbnailUrl || ""; 611 this.artworkUrl = metadata.contentThumbnailUrl || "";
612 }; 612 };
613 613
614 // Starts loading the audio player. 614 // Starts loading the audio player.
615 window.addEventListener('DOMContentLoaded', function(e) { 615 window.addEventListener('DOMContentLoaded', function(e) {
616 AudioPlayer.load(); 616 AudioPlayer.load();
617 }); 617 });
OLDNEW
« no previous file with comments | « ui/file_manager/audio_player/elements/repeat_button.js ('k') | ui/file_manager/audio_player/js/compiled_resources.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698