| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more | 8 * See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more |
| 9 * information on getUserMedia. | 9 * information on getUserMedia. |
| 10 */ | 10 */ |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 * @param {string} id is a case-sensitive string representing the unique ID of | 33 * @param {string} id is a case-sensitive string representing the unique ID of |
| 34 * the element being sought. | 34 * the element being sought. |
| 35 * @return {string} id returns the element object specified as a parameter | 35 * @return {string} id returns the element object specified as a parameter |
| 36 */ | 36 */ |
| 37 $ = function(id) { | 37 $ = function(id) { |
| 38 return document.getElementById(id); | 38 return document.getElementById(id); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 /** | 41 /** |
| 42 * This function asks permission to use the webcam and mic from the browser. It | 42 * This function asks permission to use the webcam and mic from the browser. It |
| 43 * will return ok-requested to PyAuto. This does not mean the request was | 43 * will return ok-requested to the test. This does not mean the request was |
| 44 * approved though. The test will then have to click past the dialog that | 44 * approved though. The test will then have to click past the dialog that |
| 45 * appears in Chrome, which will run either the OK or failed callback as a | 45 * appears in Chrome, which will run either the OK or failed callback as a |
| 46 * a result. To see which callback was called, use obtainGetUserMediaResult(). | 46 * a result. To see which callback was called, use obtainGetUserMediaResult(). |
| 47 * | 47 * |
| 48 * @param {string} constraints Defines what to be requested, with mandatory | 48 * @param {string} constraints Defines what to be requested, with mandatory |
| 49 * and optional constraints defined. The contents of this parameter depends | 49 * and optional constraints defined. The contents of this parameter depends |
| 50 * on the WebRTC version. This should be JavaScript code that we eval(). | 50 * on the WebRTC version. This should be JavaScript code that we eval(). |
| 51 */ | 51 */ |
| 52 function doGetUserMedia(constraints) { | 52 function doGetUserMedia(constraints) { |
| 53 if (!getUserMedia) { | 53 if (!getUserMedia) { |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 /** | 288 /** |
| 289 * @private | 289 * @private |
| 290 * @param {NavigatorUserMediaError} error Error containing details. | 290 * @param {NavigatorUserMediaError} error Error containing details. |
| 291 */ | 291 */ |
| 292 function getUserMediaFailedCallback_(error) { | 292 function getUserMediaFailedCallback_(error) { |
| 293 debug('GetUserMedia FAILED: Maybe the camera is in use by another process?'); | 293 debug('GetUserMedia FAILED: Maybe the camera is in use by another process?'); |
| 294 gRequestWebcamAndMicrophoneResult = 'failed-with-error-' + error.name; | 294 gRequestWebcamAndMicrophoneResult = 'failed-with-error-' + error.name; |
| 295 debug(gRequestWebcamAndMicrophoneResult); | 295 debug(gRequestWebcamAndMicrophoneResult); |
| 296 } | 296 } |
| OLD | NEW |