code: function(recordingDuration, callback) {
              if (typeof recordingDuration === 'undefined') {
                  throw 'recordingDuration is required.';
              }
  
              if (typeof recordingDuration !== 'number') {
                  throw 'recordingDuration must be a number.';
              }
  
              self.recordingDuration = recordingDuration;
              self.onRecordingStopped = callback || function() {};
  
              return {
                  onRecordingStopped: function(callback) {
                      self.onRecordingStopped = callback;
                  }
              };
          }
docs: Ask RecordRTC to auto-stop the recording after 5 minutes.
  @method
  @memberof RecordRTC
  @instance
  @example
  var fiveMinutes = 5 * 1000 * 60;
  recorder.setRecordingDuration(fiveMinutes, function() {
  var blob = this.getBlob();
  video.src = this.toURL();
  });
  
  // or otherwise
  recorder.setRecordingDuration(fiveMinutes).onRecordingStopped(function() {
  var blob = this.getBlob();
  video.src = this.toURL();
  });