| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Polymer('audio-player', { | 5 Polymer('audio-player', { |
| 6 /** | 6 /** |
| 7 * Child Elements | 7 * Child Elements |
| 8 */ | 8 */ |
| 9 audioController: null, | 9 audioController: null, |
| 10 audioElement: null, | 10 audioElement: null, |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 // If there is only a single file in the list, 'currentTrackInde' is not | 233 // If there is only a single file in the list, 'currentTrackInde' is not |
| 234 // changed and the handler is not invoked. Instead, plays here. | 234 // changed and the handler is not invoked. Instead, plays here. |
| 235 // TODO(yoshiki): clean up the code around here. | 235 // TODO(yoshiki): clean up the code around here. |
| 236 if (isNextTrackAvailable && | 236 if (isNextTrackAvailable && |
| 237 this.trackList.currentTrackIndex == nextTrackIndex) { | 237 this.trackList.currentTrackIndex == nextTrackIndex) { |
| 238 this.audioElement.play(); | 238 this.audioElement.play(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 this.trackList.currentTrackIndex = nextTrackIndex; | 241 this.trackList.currentTrackIndex = nextTrackIndex; |
| 242 | |
| 243 Platform.performMicrotaskCheckpoint(); | |
| 244 }, | 242 }, |
| 245 | 243 |
| 246 /** | 244 /** |
| 247 * Timeout ID of auto advance. Used internally in scheduleAutoAdvance_() and | 245 * Timeout ID of auto advance. Used internally in scheduleAutoAdvance_() and |
| 248 * cancelAutoAdvance_(). | 246 * cancelAutoAdvance_(). |
| 249 * @type {number} | 247 * @type {number} |
| 250 * @private | 248 * @private |
| 251 */ | 249 */ |
| 252 autoAdvanceTimer_: null, | 250 autoAdvanceTimer_: null, |
| 253 | 251 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 break; | 369 break; |
| 372 case 'MediaPreviousTrack': | 370 case 'MediaPreviousTrack': |
| 373 this.onControllerPreviousClicked(); | 371 this.onControllerPreviousClicked(); |
| 374 break; | 372 break; |
| 375 case 'MediaStop': | 373 case 'MediaStop': |
| 376 // TODO: Define "Stop" behavior. | 374 // TODO: Define "Stop" behavior. |
| 377 break; | 375 break; |
| 378 } | 376 } |
| 379 }, | 377 }, |
| 380 }); | 378 }); |
| OLD | NEW |