code: function setStreamType(constraints, stream) {
      if (constraints.mandatory && constraints.mandatory.chromeMediaSource) {
          stream.isScreen = true;
      } else if (constraints.mozMediaSource || constraints.mediaSource) {
          stream.isScreen = true;
      } else if (constraints.video) {
          stream.isVideo = true;
      } else if (constraints.audio) {
          stream.isAudio = true;
      }
  }
docs: getUserMediaHandler.js