Permalink
Browse files

Update the new API

  • Loading branch information...
1 parent 891a3f5 commit 59b7fa130f251ff8abfd388f92212c05f4ea666b @ltribolet ltribolet committed May 9, 2012
Showing with 12 additions and 4 deletions.
  1. +12 −4 js/webrtc.js
View
@@ -95,11 +95,19 @@ openChannel = function() {
* @return {void}
*/
getUserMedia = function() {
- try {
- navigator.webkitGetUserMedia("video,audio", onUserMediaSuccess, onUserMediaError);
- console.log("Requested access to local media.");
+ try {
+ navigator.webkitGetUserMedia({audio:true, video:true}, onUserMediaSuccess,
+ onUserMediaError);
+ console.log("Requested access to local media with new syntax.");
} catch (e) {
- console.log("getUserMedia error.");
+ try {
+ navigator.webkitGetUserMedia("video,audio", onUserMediaSuccess,
+ onUserMediaError);
+ console.log("Requested access to local media with old syntax.");
+ } catch (e) {
+ alert("webkitGetUserMedia() failed. Is the MediaStream flag enabled in about:flags?");
+ console.log("webkitGetUserMedia failed with exception: " + e.message);
+ }
}
}

0 comments on commit 59b7fa1

Please sign in to comment.