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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 this.errorString_ = ''; | 59 this.errorString_ = ''; |
60 this.offlineString_ = ''; | 60 this.offlineString_ = ''; |
61 chrome.fileManagerPrivate.getStrings(function(strings) { | 61 chrome.fileManagerPrivate.getStrings(function(strings) { |
62 container.ownerDocument.title = strings['AUDIO_PLAYER_TITLE']; | 62 container.ownerDocument.title = strings['AUDIO_PLAYER_TITLE']; |
63 this.errorString_ = strings['AUDIO_ERROR']; | 63 this.errorString_ = strings['AUDIO_ERROR']; |
64 this.offlineString_ = strings['AUDIO_OFFLINE']; | 64 this.offlineString_ = strings['AUDIO_OFFLINE']; |
65 AudioPlayer.TrackInfo.DEFAULT_ARTIST = | 65 AudioPlayer.TrackInfo.DEFAULT_ARTIST = |
66 strings['AUDIO_PLAYER_DEFAULT_ARTIST']; | 66 strings['AUDIO_PLAYER_DEFAULT_ARTIST']; |
67 // Pass translated labels to the AudioPlayerElement. | 67 // Pass translated labels to the AudioPlayerElement. |
68 this.player_.ariaLabels = { | 68 this.player_.ariaLabels = { |
69 volumeSlider: strings['AUDIO_PLAYER_OPEN_VOLUME_SLIDER_BUTTON_LABEL'], | |
70 shuffle: strings['AUDIO_PLAYER_SHUFFLE_BUTTON_LABEL'], | 69 shuffle: strings['AUDIO_PLAYER_SHUFFLE_BUTTON_LABEL'], |
71 repeat: strings['AUDIO_PLAYER_REPEAT_BUTTON_LABEL'], | 70 repeat: strings['AUDIO_PLAYER_REPEAT_BUTTON_LABEL'], |
72 previous: strings['MEDIA_PLAYER_PREVIOUS_BUTTON_LABEL'], | 71 previous: strings['MEDIA_PLAYER_PREVIOUS_BUTTON_LABEL'], |
73 play: strings['MEDIA_PLAYER_PLAY_BUTTON_LABEL'], | 72 play: strings['MEDIA_PLAYER_PLAY_BUTTON_LABEL'], |
74 pause: strings['MEDIA_PLAYER_PAUSE_BUTTON_LABEL'], | 73 pause: strings['MEDIA_PLAYER_PAUSE_BUTTON_LABEL'], |
75 next: strings['MEDIA_PLAYER_NEXT_BUTTON_LABEL'], | 74 next: strings['MEDIA_PLAYER_NEXT_BUTTON_LABEL'], |
76 volume: strings['AUDIO_PLAYER_OPEN_VOLUME_SLIDER_BUTTON_LABEL'], | |
77 playList: strings['AUDIO_PLAYER_OPEN_PLAY_LIST_BUTTON_LABEL'], | 75 playList: strings['AUDIO_PLAYER_OPEN_PLAY_LIST_BUTTON_LABEL'], |
78 seekSlider: strings['MEDIA_PLAYER_SEEK_SLIDER_LABEL'] | 76 seekSlider: strings['MEDIA_PLAYER_SEEK_SLIDER_LABEL'], |
| 77 mute: strings['MEDIA_PLAYER_MUTE_BUTTON_LABEL'], |
| 78 unmute: strings['MEDIA_PLAYER_UNMUTE_BUTTON_LABEL'], |
| 79 volumeSlider: strings['MEDIA_PLAYER_VOLUME_SLIDER_LABEL'] |
79 }; | 80 }; |
80 }.bind(this)); | 81 }.bind(this)); |
81 | 82 |
82 this.volumeManager_.addEventListener('externally-unmounted', | 83 this.volumeManager_.addEventListener('externally-unmounted', |
83 this.onExternallyUnmounted_.bind(this)); | 84 this.onExternallyUnmounted_.bind(this)); |
84 | 85 |
85 window.addEventListener('resize', this.onResize_.bind(this)); | 86 window.addEventListener('resize', this.onResize_.bind(this)); |
86 document.addEventListener('keydown', this.onKeyDown_.bind(this)); | 87 document.addEventListener('keydown', this.onKeyDown_.bind(this)); |
87 | 88 |
88 // Show the window after DOM is processed. | 89 // Show the window after DOM is processed. |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 // TODO(yoshiki): Handle error in better way. | 467 // TODO(yoshiki): Handle error in better way. |
467 // TODO(yoshiki): implement artwork (metadata.thumbnail) | 468 // TODO(yoshiki): implement artwork (metadata.thumbnail) |
468 this.title = metadata.mediaTitle || this.getDefaultTitle(); | 469 this.title = metadata.mediaTitle || this.getDefaultTitle(); |
469 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); | 470 this.artist = error || metadata.mediaArtist || this.getDefaultArtist(); |
470 }; | 471 }; |
471 | 472 |
472 // Starts loading the audio player. | 473 // Starts loading the audio player. |
473 window.addEventListener('DOMContentLoaded', function(e) { | 474 window.addEventListener('DOMContentLoaded', function(e) { |
474 AudioPlayer.load(); | 475 AudioPlayer.load(); |
475 }); | 476 }); |
OLD | NEW |