docs: function (scope) {
      var controller = this;
      var autoPlay = scope.autoPlay;
      if (autoPlay === undefined) autoPlay = true;
  
      var pauseOnHand = scope.pauseOnHand;
      if (pauseOnHand === undefined) pauseOnHand = true;
  
      var resumeOnHandLost = scope.resumeOnHandLost;
      if (resumeOnHandLost === undefined) resumeOnHandLost = true;
  
      var timeBetweenLoops = scope.timeBetweenLoops;
      if (timeBetweenLoops === undefined) timeBetweenLoops = 50;
  
      var requiredProtocolVersion = scope.requiredProtocolVersion;
  
      var pauseHotkey = scope.pauseHotkey;
      if (pauseHotkey === undefined) pauseHotkey = 32; // spacebar
  
      var loop = scope.loop;
      if (loop === undefined) loop = true;
  
      var overlay = scope.overlay;
      // A better fix would be to set an onload handler for this, rather than disable the overlay.
      if (overlay === undefined && document.body) {
        overlay = document.createElement('div');
        document.body.appendChild(overlay);
        overlay.style.width = '100%';
        overlay.style.position = 'absolute';
        overlay.style.top = '0';
        overlay.style.left = '-' + window.getComputedStyle(document.body).getPropertyValue('margin');
        overlay.style.padding = '10px';
        overlay.style.textAlign = 'center';
        overlay.style.fontSize = '18px';
        overlay.style.opacity = '0.8';
        overlay.style.display = 'none';
        overlay.style.zIndex = '10';
        overlay.id = 'connect-leap';
        overlay.style.cursor = 'pointer';
        overlay.addEventListener("click", function () {
          this.style.display = 'none';
          return false;
        }, false);
  
      }
  
  
      scope.player = new Player(this, {
        recording: scope.recording,
        loop: loop,
        pauseHotkey: pauseHotkey,
        timeBetweenLoops: timeBetweenLoops
      });
  
      // By doing this, we allow player methods to be accessible on the scope
      // this is the controller
      scope.player.overlay = overlay;
      scope.player.pauseOnHand = pauseOnHand;
      scope.player.resumeOnHandLost = resumeOnHandLost;
      scope.player.requiredProtocolVersion = requiredProtocolVersion;
      scope.player.autoPlay = autoPlay;
  
      var setupStreamingEvents = function () {
        if (scope.player.pauseOnHand && controller.connection.opts.requestProtocolVersion < scope.requiredProtocolVersion) {
          console.log('Protocol Version too old (' + controller.connection.opts.requestProtocolVersion + '), disabling device interaction.');
          scope.player.pauseOnHand = false;
          return
        }
  
        if (autoPlay) {
          controller.on('streamingStarted', function () {
            if (scope.player.state == 'recording') {
              scope.player.pause();
              scope.player.setGraphic('wave');
            } else {
              if (pauseOnHand) {
                scope.player.setGraphic('wave');
              } else {
                scope.player.setGraphic();
              }
            }
          });
  
          controller.on('streamingStopped', function () {
            scope.player.play();
          });
        }
        controller.on('streamingStopped', function () {
          scope.player.setGraphic('connect');
        });
      }
  
      // ready happens before streamingStarted, allowing us to check the version before responding to streamingStart/Stop
      // we can't call this any earlier, or protcol version won't be available
      if (!!this.connection.connected) {
        setupStreamingEvents()
      } else {
        this.on('ready', setupStreamingEvents)
      }
  
      return {}
    }