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 * Test API for Chrome OS Video Player and Audio Player. | 6 * Test API for Chrome OS Video Player and Audio Player. |
7 * | 7 * |
8 * To test the Video Player open a tab with the URL: | 8 * To test the Video Player open a tab with the URL: |
9 * chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/video_player.html | 9 * chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/video_player.html |
10 * | 10 * |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 /** | 87 /** |
88 * Respond with a number, current volume [0..100]. | 88 * Respond with a number, current volume [0..100]. |
89 */ | 89 */ |
90 getVolume: function() { | 90 getVolume: function() { |
91 this.respond_(this.getMedia_().volume * 100); | 91 this.respond_(this.getMedia_().volume * 100); |
92 }, | 92 }, |
93 | 93 |
94 /** | 94 /** |
95 * Change volume. | 95 * Change volume. |
96 * @param {number} volume Volume [0..100] | 96 * @param {number} volume Volume [0..100]. |
97 */ | 97 */ |
98 setVolume: function(volume) { | 98 setVolume: function(volume) { |
99 this.respond_(this.getControls_().onVolumeChange_(volume / 100)); | 99 this.respond_(this.getControls_().onVolumeChange_(volume / 100)); |
100 }, | 100 }, |
101 | 101 |
102 /** | 102 /** |
103 * Respond with a boolean, true if the volume is muted. | 103 * Respond with a boolean, true if the volume is muted. |
104 */ | 104 */ |
105 isMuted: function() { | 105 isMuted: function() { |
106 this.respond_(this.getMedia_().volume == 0); | 106 this.respond_(this.getMedia_().volume == 0); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 * @param {string|boolean|number} value Value to send back. | 181 * @param {string|boolean|number} value Value to send back. |
182 * @private | 182 * @private |
183 */ | 183 */ |
184 respond_: function(value) { | 184 respond_: function(value) { |
185 if (window.domAutomationController) | 185 if (window.domAutomationController) |
186 window.domAutomationController.send(value); | 186 window.domAutomationController.send(value); |
187 else | 187 else |
188 console.log('playerTestAPI response: ' + value); | 188 console.log('playerTestAPI response: ' + value); |
189 } | 189 } |
190 }; | 190 }; |
OLD | NEW |