var screenshare = require('..');
var media = require('rtc-media');

screenshare.window(function(err, constraints) {
  media(constraints).render(document.body);
});

var screenshare = require('..');
var media = require('rtc-media');

screenshare.window(function(err, constraints) {
  if (err) {
    return console.error('Could not capture window: ', err);
  }

  console.log('attempting capture with constraints: ', constraints);
  media({ constraints: constraints })
    .on('error', function(err) {
      console.error('Could not capture: ', err);
    })
    .once('capture', function(stream) {
      console.log('Successfully captured stream: ', stream);
    })
    .render(document.body);
});

Add error handling and logging to the example
Add error handling and logging to the example
