Updated handleRecordingStarted and fixed typo
This commit is contained in:
parent
16d259ccc4
commit
d270fd3d34
|
|
@ -94,7 +94,7 @@ export const RecordingModal = () => {
|
|||
{!enableRecording ? (
|
||||
<Well variant="error">
|
||||
Recording is not enabled for this room (or your browser does not
|
||||
support it.) Please enabled recording when creating the room or via
|
||||
support it.) Please enable recording when creating the room or via
|
||||
the Daily dashboard.
|
||||
</Well>
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -177,13 +177,25 @@ export const RecordingProvider = ({ children }) => {
|
|||
*/
|
||||
const handleRecordingStarted = useCallback(
|
||||
(event) => {
|
||||
console.log('RECORDING');
|
||||
console.log(event);
|
||||
|
||||
if (recordingState === RECORDING_RECORDING) return;
|
||||
setRecordingState(RECORDING_RECORDING);
|
||||
if (event.local) {
|
||||
// Recording started locally, either through UI or programmatically
|
||||
setIsRecordingLocally(true);
|
||||
if (!recordingStartedDate) setRecordingStartedDate(new Date());
|
||||
if (event.type === 'output-byte-stream') {
|
||||
const { readable, writable } = new TransformStream({
|
||||
transform: (chunk, ctrl) => {
|
||||
chunk.arrayBuffer().then((b) => ctrl.enqueue(new Uint8Array(b)));
|
||||
},
|
||||
});
|
||||
window.writer = writable.getWriter();
|
||||
readable.pipeTo(window.streamSaver.createWriteStream('test-vid.mp4'));
|
||||
}
|
||||
}
|
||||
setRecordingState(RECORDING_RECORDING);
|
||||
},
|
||||
[recordingState, recordingStartedDate]
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue