How to use the recordrtc function in recordrtc

To help you get started, we’ve selected a few recordrtc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github surveyjs / widgets / src / microphone.js View on Github external
var successCallback = function(stream) {
        var options = {
          type: "audio",
          mimeType: "audio/webm",
          audioBitsPerSecond: 44100,
          sampleRate: 44100,
          bufferSize: 16384,
          numberOfAudioChannels: 1
        };
        console.log("successCallback");
        question.survey.mystream = stream;
        question.survey.recordRTC = RecordRTC(
          question.survey.mystream,
          options
        );
        if (typeof question.survey.recordRTC != "undefined") {
          console.log("startRecording");
          question.survey.recordRTC.startRecording();
        }
      };
github kasprownik / electron-screencapture / index.js View on Github external
const startRecording = ({canvas, video, x, y, width, height, availTop}) => {
  const recorder = RecordRTC(canvas, {type: 'canvas'});
  const ctx = canvas.getContext('2d');
  const stopLoop = getLoop(() => drawFrame({ctx, video, x, y, width, height, availTop}));

  recorder.startRecording();

  return {
    stop() {
      return new Promise(resolve => {
        stopLoop();
        recorder.stopRecording(() => {
          recorder.getDataURL(url => resolve({url, width, height}));
        });
      });
    },
    pause() {
      recorder.pauseRecording();
github quanglam2807 / translatium / src / state / pages / home / speech / actions.js View on Github external
navigator.getUserMedia({ audio: true, video: false }, (stream) => {
        recorder = new RecordRTC(stream, {
          recorderType: RecordRTC.StereoAudioRecorder,
          type: 'audio',
          audioType: 'audio/wav',
          mimeType: 'audio/wav',
          sampleRate: 44100,
          numberOfAudioChannels: 1,
        });

        recorder.setRecordingDuration(DURATION).onRecordingStopped(() => {
          dispatch(stopRecording());
        });

        recorder.startRecording();
      }, () => {
        dispatch(openAlert('cannotActivateMicrophone'));
github szwang / recordrtc-react / src / RecordPage.react.js View on Github external
captureUserMedia((stream) => {
      this.setState({ mediaStream: stream });

      this.state.recordVideo = RecordRTC(stream, {
        type: 'video'
      });

      this.state.recordVideo.startRecording();
    });

recordrtc

RecordRTC is a server-less (entire client-side) JavaScript library that can be used to record WebRTC audio/video media streams. It supports cross-browser audio/video recording.

MIT
Latest version published 3 years ago

Package Health Score

66 / 100
Full package analysis