docs: function enableCapture(el, config) {
  
    function cap(callback) {
      var stream = media({
        constraints: config.toConstraints({
          sources: sources
        })
      });
  
      // render the stream to the target element
      stream.render(el);
  
      // capture and report errors
      stream.on('error', function(err) {
        console.log(
          'Error attempting to capture media, requested constraints',
          stream.constraints
        );
      });
  
      // emit a capture event through the element
      stream.on('capture', function(stream) {
        // dispatch the capture event
        el.dispatchEvent(new CustomEvent('capture', {
          detail: { stream: stream }
        }));
  
        // trigger the callback if one supplied
        if (typeof callback == 'function') {
          callback(stream);
        }
      });
    }
  
    return function(callback) {
      // if we already have sources, or cannot get source information
      // then skip straight to capture
      if (sources || (! canGetSources)) {
        return cap(callback);
      }
  
      // get and update sources
      MediaStreamTrack.getSources(function(s) {
        // update the sources
        sources = s;
  
        // capture
        cap(callback)
      });
    };
  }