var WEBRTC = require('../');

WEBRTC.setDebug(true);

function onSuccess(stream) {
  console.log('Got VideoStream');
}

function onError(error) {
  throw error;
}

var constraints = {
/*
  audio: {
    optional: [
      {
        googEchoCancellation: true,
        googEchoCancellation2: true,
        googDAEchoCancellation: true,
        googAutoGainControl: true,
        googAutoGainControl2: true,
        googNoiseSuppression: true,
        googNoiseSuppression2: true,
        googHighpassFilter: true,
        googTypingNoiseDetection: true,
        googAudioMirroring: true,
      },
    ],
  },
*/
  video: {
    optional: [
      {
        minAspectRatio: 1.333,
        maxAspectRatio: 1.778,
        maxWidth: 1920,
        minWidth: 320,
        maxHeight: 1080,
        minHeight: 180,
        maxFrameRate: 60,
        minFrameRate: 30,
      },
    ],
  },
/*
  optional: [
    {
      DtlsSrtpKeyAgreement: true,
    },
  ],
  mandatory: {
    OfferToReceiveAudio: true,
    OfferToReceiveVideo: true,
  },
*/
};

WEBRTC.getUserMedia(constraints, onSuccess, onError);

@@ -1,15 +1,15 @@
 var W
-EB
+eb
 RTC = re
@@ -23,19 +23,21 @@
 ../');%0A%0A
-WEB
+//Web
 RTC.setD
@@ -84,82 +84,297 @@
 %7B%0A  
-console.log('Got VideoStream');%0A%7D%0A%0Afunction onError(error) %7B%0A  throw error
+var capturer = new WebRTC.MediaSource('mediastream/capturer', %7B%0A    stream: stream%0A  %7D);%0A  %0A  capturer.ondata = function(frame) %7B%0A    console.log(frame);%0A    console.log(frame.data.byteLength);%0A  %7D;%0A  %0A  setTimeout(function() %7B%0A    console.log('Closing...');%0A    capturer.end();%0A  %7D, 5000)
 ;%0A%7D%0A
@@ -394,19 +394,16 @@
 nts = %7B%0A
-/*%0A
   audio:
@@ -813,18 +813,33 @@
 %5D,%0A  %7D,%0A
+  video: true,%0A/
 *
-/
 %0A  video
@@ -1260,10 +1260,10 @@
 ;%0A%0AW
-EB
+eb
 RTC.
@@ -1301,16 +1301,6 @@
 cess
-, onError
 );
-%0A

Update videoStream