| 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-default-media-session flag must be passed at the command line. | 8 * --enable-default-media-session 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 var e = EventType; | 39 this.addListener_(EventType.MEDIA_STARTED_PLAYING, |
| 40 this.addListener_(e.mediaStartedPlaying, this.onMediaStartedPlaying); | 40 this.onMediaStartedPlaying); |
| 41 this.addListener_(e.mediaStoppedPlaying, this.onMediaStoppedPlaying); | 41 this.addListener_(EventType.MEDIA_STOPPED_PLAYING, |
| 42 this.onMediaStoppedPlaying); |
| 42 }.bind(this)); | 43 }.bind(this)); |
| 43 }; | 44 }; |
| 44 | 45 |
| 45 /** @type {number} */ | 46 /** @type {number} */ |
| 46 MediaAutomationHandler.MIN_WAITTIME_MS = 1000; | 47 MediaAutomationHandler.MIN_WAITTIME_MS = 1000; |
| 47 | 48 |
| 48 MediaAutomationHandler.prototype = { | 49 MediaAutomationHandler.prototype = { |
| 49 __proto__: BaseAutomationHandler.prototype, | 50 __proto__: BaseAutomationHandler.prototype, |
| 50 | 51 |
| 51 /** @override */ | 52 /** @override */ |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 root.resumeMedia(); | 112 root.resumeMedia(); |
| 112 } | 113 } |
| 113 item = it.next(); | 114 item = it.next(); |
| 114 } | 115 } |
| 115 } | 116 } |
| 116 }; | 117 }; |
| 117 | 118 |
| 118 }); // goog.scope | 119 }); // goog.scope |
| 119 | 120 |
| 120 new MediaAutomationHandler(); | 121 new MediaAutomationHandler(); |
| OLD | NEW |