Reputation: 765
I am new to muaz-khan/RecordRTC
, first time using it, copy/pasted the default implementation below and it already throwing error.
Why is this code snippet showing this error?
import { useState, useEffect } from "react";
import RecordRTC, { RecordRTCPromisesHandler } from "recordrtc";
export const useRecorderPermission = (
recordingType
) => {
const [recorder, setRecorder] = useState(null);
useEffect(() => {
getPermissionInitializeRecorder();
}, []);
const getPermissionInitializeRecorder = async () => {
let stream = await (navigator).mediaDevices.getUserMedia({
video: true,
audio: true,
});
let recorder = new RecordRTCPromisesHandler(stream, {
type: recordingType,
});
setRecorder(recorder);
};
return recorder;
};
https://prnt.sc/DpbBXr_9Fp0F
Upvotes: 2
Views: 205