rico345100 / react-multimedia-capture

react-multimedia-capture is Multimedia capturing module via React, using HTML5 MediaDevice and MediaRecorder API
49 stars 14 forks source link

error in safari: ReferenceError: Can't find variable: MediaRecorder #16

Open appjitsu opened 4 years ago

appjitsu commented 4 years ago

my safari version is 13.0.3 (14608.3.10.10.1) https://caniuse.com/#feat=mediarecorder - supposedly MediaRecorder is supported

ReferenceError: Can't find variable: MediaRecorder initMediaRecorder initMediaRecorder handleSuccess promiseReactionJob

const VIDEO = {
  video: {
    width: VIDEO_WIDTH,
    height: VIDEO_HEIGHT
  }
};

const VIDEO_SETTINGS = {
  audio: false,
  ...VIDEO
};

const handleStart = (stream) => {
    const { isRecordingVideo } = this.props;
    this.setTimeDurationVideo();
    this.setStreamToVideo(stream);
    isRecordingVideo(true);
  }

const handleStop = (blob) => {
    const { isRecordingVideo } = this.props;
    const { current: video } = this.videoTagRef;
    this.clearTimeDurationVideo();
    this.handleStreamClose();
    isRecordingVideo(false);
    video.src = '';
    this.setState({ blob, url: URL.createObjectURL(blob) });
  }

<MediaCapturer
    timeSlice={10}
    constraints={RECORDING_SETTINGS}
    onStart={this.handleStart}
    onStop={this.handleStop}
    onError={this.clearTimeDurationVideo}
    onStreamClosed={this.handleStreamClose}
    render={({ start, stop }) => {
        !this.state.stop && this.setState({ stop });
        !this.state.start && this.setState({ start });

        return (
           <div></div>
        );
    }}
/>
andraderaul commented 4 years ago

same issue for me