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({ | 5 Polymer({ |
6 is: 'audio-player', | 6 is: 'audio-player', |
7 | 7 |
8 listeners: { | 8 listeners: { |
9 'toggle-pause-event': 'onTogglePauseEvent_', | 9 'toggle-pause-event': 'onTogglePauseEvent_', |
10 'small-forward-skip-event': 'onSmallForwardSkipEvent_', | 10 'small-forward-skip-event': 'onSmallForwardSkipEvent_', |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 this.wasPlayingOnDragStart_ = false; | 421 this.wasPlayingOnDragStart_ = false; |
422 } | 422 } |
423 } | 423 } |
424 }, | 424 }, |
425 | 425 |
426 /** | 426 /** |
427 * Invoked when the 'keydown' event is fired. | 427 * Invoked when the 'keydown' event is fired. |
428 * @param {Event} event The event object. | 428 * @param {Event} event The event object. |
429 */ | 429 */ |
430 onKeyDown_: function(event) { | 430 onKeyDown_: function(event) { |
431 switch (event.keyIdentifier) { | 431 switch (event.key) { |
432 case 'MediaNextTrack': | 432 case 'MediaTrackNext': |
433 this.onControllerNextClicked(); | 433 this.onControllerNextClicked(); |
434 break; | 434 break; |
435 case 'MediaPlayPause': | 435 case 'MediaPlayPause': |
436 this.playing = !this.playing; | 436 this.playing = !this.playing; |
437 break; | 437 break; |
438 case 'MediaPreviousTrack': | 438 case 'MediaTrackPrevious': |
439 this.onControllerPreviousClicked(); | 439 this.onControllerPreviousClicked(); |
440 break; | 440 break; |
441 case 'MediaStop': | 441 case 'MediaStop': |
442 // TODO: Define "Stop" behavior. | 442 // TODO: Define "Stop" behavior. |
443 break; | 443 break; |
444 } | 444 } |
445 }, | 445 }, |
446 | 446 |
447 /** | 447 /** |
448 * Computes volume value for audio element. (should be in [0.0, 1.0]) | 448 * Computes volume value for audio element. (should be in [0.0, 1.0]) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 }, | 486 }, |
487 | 487 |
488 /** | 488 /** |
489 * Big skip backword. | 489 * Big skip backword. |
490 * @private | 490 * @private |
491 */ | 491 */ |
492 onBigBackwordSkipEvent_: function(event) { | 492 onBigBackwordSkipEvent_: function(event) { |
493 this.$.audioController.bigSkip(false); | 493 this.$.audioController.bigSkip(false); |
494 }, | 494 }, |
495 }); | 495 }); |
OLD | NEW |