Chromium Code Reviews| Index: ui/file_manager/audio_player/elements/audio_player.js |
| diff --git a/ui/file_manager/audio_player/elements/audio_player.js b/ui/file_manager/audio_player/elements/audio_player.js |
| index 8a20662957ea56fb193ac4a5a9b62dc734b40231..e8d9e3a04ec0fc5a8619b08a9e39ab0f76492d93 100644 |
| --- a/ui/file_manager/audio_player/elements/audio_player.js |
| +++ b/ui/file_manager/audio_player/elements/audio_player.js |
| @@ -271,15 +271,15 @@ Polymer({ |
| this.playing = isNextTrackAvailable; |
| - // If there is only a single file in the list, 'currentTrackInde' is not |
| - // changed and the handler is not invoked. Instead, plays here. |
| - // TODO(yoshiki): clean up the code around here. |
| - if (isNextTrackAvailable && |
| - this.$.trackList.currentTrackIndex == nextTrackIndex) { |
| - this.$.audio.play(); |
| - } |
| - |
| this.$.trackList.currentTrackIndex = nextTrackIndex; |
| + this.$.audio.currentTime = 0; |
| + // If the next track and current track is the same, |
| + // the event will not be fired. |
| + // So we will fire the event here. |
| + // This happenes if there is only one song. |
| + if (this.$.trackList.currentTrackIndex == nextTrackIndex) { |
|
fukino
2016/02/09 05:13:17
This condition is always true. (by assignment at #
ryoh
2016/02/09 05:44:19
Done.
|
| + this.$.trackList.fire('current-track-index-changed'); |
| + } |
| }, |
| /** |