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

Unified Diff: chrome/browser/resources/file_manager/audio_player/elements/audio_player.js

Issue 221623004: [AudioPleyer] Fix repeat even when there is a single file in the list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/audio_player/elements/audio_player.js
diff --git a/chrome/browser/resources/file_manager/audio_player/elements/audio_player.js b/chrome/browser/resources/file_manager/audio_player/elements/audio_player.js
index 0694030f7abb54c6ccc6766acc1eaa12e298a68d..12449cbfc2c9f07558ee4420f14ed1cc4650de89 100644
--- a/chrome/browser/resources/file_manager/audio_player/elements/audio_player.js
+++ b/chrome/browser/resources/file_manager/audio_player/elements/audio_player.js
@@ -205,6 +205,15 @@ Polymer('audio-player', {
(this.trackList.getNextTrackIndex(forward, repeat) !== -1);
this.audioController.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.audioElement.play();
+ }
+
this.trackList.currentTrackIndex = nextTrackIndex;
Platform.performMicrotaskCheckpoint();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698