| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @fileoverview Handles media automation events. Note that to perform any of | 6 * @fileoverview Handles media automation events. Note that to perform any of |
| 7 * the actions below such as ducking, and suspension of media sessions, the | 7 * the actions below such as ducking, and suspension of media sessions, the |
| 8 * --enable-audio-focus flag must be passed at the command line. | 8 * --enable-audio-focus flag must be passed at the command line. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 this.mediaRoots_ = new Set(); | 29 this.mediaRoots_ = new Set(); |
| 30 | 30 |
| 31 /** @type {Date} @private */ | 31 /** @type {Date} @private */ |
| 32 this.lastTtsEvent_ = new Date(); | 32 this.lastTtsEvent_ = new Date(); |
| 33 | 33 |
| 34 cvox.ChromeVox.tts.addCapturingEventListener(this); | 34 cvox.ChromeVox.tts.addCapturingEventListener(this); |
| 35 | 35 |
| 36 chrome.automation.getDesktop(function(node) { | 36 chrome.automation.getDesktop(function(node) { |
| 37 BaseAutomationHandler.call(this, node); | 37 BaseAutomationHandler.call(this, node); |
| 38 | 38 |
| 39 this.addListener_(EventType.MEDIA_STARTED_PLAYING, | 39 this.addListener_( |
| 40 this.onMediaStartedPlaying); | 40 EventType.MEDIA_STARTED_PLAYING, this.onMediaStartedPlaying); |
| 41 this.addListener_(EventType.MEDIA_STOPPED_PLAYING, | 41 this.addListener_( |
| 42 this.onMediaStoppedPlaying); | 42 EventType.MEDIA_STOPPED_PLAYING, this.onMediaStoppedPlaying); |
| 43 }.bind(this)); | 43 }.bind(this)); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 /** @type {number} */ | 46 /** @type {number} */ |
| 47 MediaAutomationHandler.MIN_WAITTIME_MS = 1000; | 47 MediaAutomationHandler.MIN_WAITTIME_MS = 1000; |
| 48 | 48 |
| 49 MediaAutomationHandler.prototype = { | 49 MediaAutomationHandler.prototype = { |
| 50 __proto__: BaseAutomationHandler.prototype, | 50 __proto__: BaseAutomationHandler.prototype, |
| 51 | 51 |
| 52 /** @override */ | 52 /** @override */ |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 root.resumeMedia(); | 113 root.resumeMedia(); |
| 114 } | 114 } |
| 115 item = it.next(); | 115 item = it.next(); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 }); // goog.scope | 120 }); // goog.scope |
| 121 | 121 |
| 122 new MediaAutomationHandler(); | 122 new MediaAutomationHandler(); |
| OLD | NEW |