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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // Run asynchronously after an event of model change is delivered. | 61 // Run asynchronously after an event of model change is delivered. |
62 setTimeout(function() { | 62 setTimeout(function() { |
63 this.errorString_ = ''; | 63 this.errorString_ = ''; |
64 this.offlineString_ = ''; | 64 this.offlineString_ = ''; |
65 chrome.fileManagerPrivate.getStrings(function(strings) { | 65 chrome.fileManagerPrivate.getStrings(function(strings) { |
66 container.ownerDocument.title = strings['AUDIO_PLAYER_TITLE']; | 66 container.ownerDocument.title = strings['AUDIO_PLAYER_TITLE']; |
67 this.errorString_ = strings['AUDIO_ERROR']; | 67 this.errorString_ = strings['AUDIO_ERROR']; |
68 this.offlineString_ = strings['AUDIO_OFFLINE']; | 68 this.offlineString_ = strings['AUDIO_OFFLINE']; |
69 AudioPlayer.TrackInfo.DEFAULT_ARTIST = | 69 AudioPlayer.TrackInfo.DEFAULT_ARTIST = |
70 strings['AUDIO_PLAYER_DEFAULT_ARTIST']; | 70 strings['AUDIO_PLAYER_DEFAULT_ARTIST']; |
71 // Pass translated labels to the AudioPlayerElement. | |
72 this.player_.ariaLabels = { | |
73 volumeSlider: strings['AUDIO_PLAYER_OPEN_VOLUME_SLIDER_BUTTON_LABEL'], | |
74 shuffle: strings['AUDIO_PLAYER_SHUFFLE_BUTTON_LABEL'], | |
75 repeat: strings['AUDIO_PLAYER_REPEAT_BUTTON_LABEL'], | |
76 previous: strings['MEDIA_PLAYER_PREVIOUS_BUTTON_LABEL'], | |
77 play: strings['MEDIA_PLAYER_PLAY_BUTTON_LABEL'], | |
78 pause: strings['MEDIA_PLAYER_PAUSE_BUTTON_LABEL'], | |
79 next: strings['MEDIA_PLAYER_NEXT_BUTTON_LABEL'], | |
80 volume: strings['AUDIO_PLAYER_OPEN_VOLUME_SLIDER_BUTTON_LABEL'], | |
81 playList: strings['AUDIO_PLAYER_OPEN_PLAY_LIST_BUTTON_LABEL'], | |
82 seekSlider: strings['MEDIA_PLAYER_SEEK_SLIDER_LABEL'] | |
83 }; | |
84 }.bind(this)); | 71 }.bind(this)); |
85 | 72 |
86 this.volumeManager_.addEventListener('externally-unmounted', | 73 this.volumeManager_.addEventListener('externally-unmounted', |
87 this.onExternallyUnmounted_.bind(this)); | 74 this.onExternallyUnmounted_.bind(this)); |
88 | 75 |
89 window.addEventListener('resize', this.onResize_.bind(this)); | 76 window.addEventListener('resize', this.onResize_.bind(this)); |
90 document.addEventListener('keydown', this.onKeyDown_.bind(this)); | 77 document.addEventListener('keydown', this.onKeyDown_.bind(this)); |
91 | 78 |
92 // Show the window after DOM is processed. | 79 // Show the window after DOM is processed. |
93 var currentWindow = chrome.app.window.current(); | 80 var currentWindow = chrome.app.window.current(); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 // TODO(yoshiki): Handle error in better way. | 495 // TODO(yoshiki): Handle error in better way. |
509 // TODO(yoshiki): implement artwork (metadata.thumbnail) | 496 // TODO(yoshiki): implement artwork (metadata.thumbnail) |
510 this.title = metadata.mediaTitle || this.getDefaultTitle(); | 497 this.title = metadata.mediaTitle || this.getDefaultTitle(); |
511 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); | 498 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); |
512 }; | 499 }; |
513 | 500 |
514 // Starts loading the audio player. | 501 // Starts loading the audio player. |
515 window.addEventListener('DOMContentLoaded', function(e) { | 502 window.addEventListener('DOMContentLoaded', function(e) { |
516 AudioPlayer.load(); | 503 AudioPlayer.load(); |
517 }); | 504 }); |
OLD | NEW |