async function handleStop(e) {
  let blob = new Blob(recordedChunks, {
    type: 'video/webm; codecs=vp9'
  });

  let buffer = Buffer.from(await blob.arrayBuffer());

  const { filePath } = await dialog.showSaveDialog({
    buttonLabel: 'Save video',
    defaultPath: `vid-${Date.now()}.webm`
  });

  if (filePath) {
    writeFile(filePath, buffer, () => console.log('video saved successfully!'));
  }

}
// Saves the video file on stop
Saves the video file on stop
Saves the video file on stop
async function handleStop(e) {
  let blob = new Blob(recordedChunks, {
    type: 'video/webm; codecs=vp9'
  });
  let buffer = Buffer.from(await blob.arrayBuffer());
  const { filePath } = await dialog.showSaveDialog({
    buttonLabel: 'Save video',
    defaultPath: `vid-${Date.now()}.webm`
  });
  if (filePath) {
    writeFile(filePath, buffer, () => console.log('video saved successfully!'));
  }
}
async function handleStop ( e ) { let blob = new Blob ( recordedChunks , { type : 'video/webm; codecs=vp9' } ) ; let buffer = Buffer . from ( await blob . arrayBuffer ( ) ) ; const { filePath } = await dialog . showSaveDialog ( { buttonLabel : 'Save video' , defaultPath : ` ${ Date . now ( ) } ` } ) ; if ( filePath ) { writeFile ( filePath , buffer , ( ) => console . log ( 'video saved successfully!' ) ) ; } }
Saves the video file on stop
Saves the video file on stop