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 * @param {HTMLElement} container Container element. | 6 * @param {HTMLElement} container Container element. |
7 * @constructor | 7 * @constructor |
8 */ | 8 */ |
9 function AudioPlayer(container) { | 9 function AudioPlayer(container) { |
10 this.container_ = container; | 10 this.container_ = container; |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 */ | 574 */ |
575 function FullWindowAudioControls(container, advanceTrack, onError) { | 575 function FullWindowAudioControls(container, advanceTrack, onError) { |
576 AudioControls.apply(this, arguments); | 576 AudioControls.apply(this, arguments); |
577 | 577 |
578 document.addEventListener('keydown', function(e) { | 578 document.addEventListener('keydown', function(e) { |
579 if (e.keyIdentifier == 'U+0020') { | 579 if (e.keyIdentifier == 'U+0020') { |
580 this.togglePlayState(); | 580 this.togglePlayState(); |
581 e.preventDefault(); | 581 e.preventDefault(); |
582 } | 582 } |
583 }.bind(this)); | 583 }.bind(this)); |
| 584 |
| 585 util.disableBrowserShortcutKeys(document); |
584 } | 586 } |
585 | 587 |
586 FullWindowAudioControls.prototype = { __proto__: AudioControls.prototype }; | 588 FullWindowAudioControls.prototype = { __proto__: AudioControls.prototype }; |
587 | 589 |
588 /** | 590 /** |
589 * Enable play state restore from the location hash. | 591 * Enable play state restore from the location hash. |
590 * @param {string} src Source URL. | 592 * @param {string} src Source URL. |
591 * @param {boolean} restore True if need to restore the play state. | 593 * @param {boolean} restore True if need to restore the play state. |
592 */ | 594 */ |
593 FullWindowAudioControls.prototype.load = function(src, restore) { | 595 FullWindowAudioControls.prototype.load = function(src, restore) { |
(...skipping 13 matching lines...) Expand all Loading... |
607 * Restore the state after page/app reload. | 609 * Restore the state after page/app reload. |
608 */ | 610 */ |
609 FullWindowAudioControls.prototype.restorePlayState = function() { | 611 FullWindowAudioControls.prototype.restorePlayState = function() { |
610 if (this.restoreWhenLoaded_) { | 612 if (this.restoreWhenLoaded_) { |
611 this.restoreWhenLoaded_ = false; // This should only work once. | 613 this.restoreWhenLoaded_ = false; // This should only work once. |
612 if (this.decodeState()) | 614 if (this.decodeState()) |
613 return; | 615 return; |
614 } | 616 } |
615 this.play(); | 617 this.play(); |
616 }; | 618 }; |
OLD | NEW |