Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: getusermedia.js

Issue 12824011: Updated Chrome Test pages (Closed) Base URL: https://src.chromium.org/svn/trunk/src/chrome/test/data/webrtc/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: getusermedia.js
===================================================================
--- getusermedia.js (revision 188159)
+++ getusermedia.js (working copy)
@@ -39,8 +39,8 @@
* and optional constraints defined. The contents of this parameter depends
* on the WebRTC version. This should be JavaScript code that we eval().
*/
-function getUserMedia(constraints) {
- if (!navigator.webkitGetUserMedia) {
+function doGetUserMedia(constraints) {
+ if (!getUserMedia) {
returnToTest('Browser does not support WebRTC.');
return;
}
@@ -50,15 +50,15 @@
} catch (exception) {
throw failTest('Not valid JavaScript expression: ' + constraints);
}
- debug('Requesting getUserMedia: constraints: ' + constraints);
- navigator.webkitGetUserMedia(evaluatedConstraints,
- getUserMediaOkCallback_,
- getUserMediaFailedCallback_);
+ debug('Requesting doGetUserMedia: constraints: ' + constraints);
+ getUserMedia(evaluatedConstraints,
+ getUserMediaOkCallback_,
kjellander_chromium 2013/03/15 09:14:06 Fix indentation.
elham1 2013/03/21 22:36:27 Done.
+ getUserMediaFailedCallback_);
returnToTest('ok-requested');
}
/**
- * Must be called after calling getUserMedia. Returns not-called-yet if we have
+ * Must be called after calling doGetUserMedia. Returns not-called-yet if we have
kjellander_chromium 2013/03/15 09:14:06 80 chars line limit.
elham1 2013/03/21 22:36:27 Done.
* not yet been called back by WebRTC. Otherwise it returns either ok-got-stream
* or failed-with-error-x (where x is the error code from the error callback)
* depending on which callback got called by WebRTC.
@@ -131,8 +131,7 @@
function getUserMediaOkCallback_(stream) {
gLocalStream = stream;
var videoTag = $('local-view');
- videoTag.src = webkitURL.createObjectURL(stream);
-
+ attachMediaStream(videoTag, stream);
// Due to crbug.com/110938 the size is 0 when onloadedmetadata fires.
// videoTag.onloadedmetadata = updateVideoTagSize_('local-view');
// Use setTimeout as a workaround for now.
@@ -160,7 +159,7 @@
* @param {NavigatorUserMediaError} error Error containing details.
*/
function getUserMediaFailedCallback_(error) {
- debug('GetUserMedia FAILED: Maybe the camera is in use by another process?');
+ debug('doGetUserMedia FAILED: Maybe the camera is in use by another process?');
gRequestWebcamAndMicrophoneResult = 'failed-with-error-' + error.code;
}

Powered by Google App Engine
This is Rietveld 408576698