diff --git a/client/src/components/WebcamCapture.js b/client/src/components/WebcamCapture.js index 4fdda1a..53e297b 100644 --- a/client/src/components/WebcamCapture.js +++ b/client/src/components/WebcamCapture.js @@ -53,7 +53,9 @@ const WebcamStreamCapture = ({ ({ data }) => { if (!data || data.size === 0) return const blob = new Blob([data], { - type: 'video/webm', + type: MediaRecorder.isTypeSupported('video/mp4') + ? 'video/mp4' + : 'video/webm', }) onStopCapture(blob) }, @@ -64,7 +66,9 @@ const WebcamStreamCapture = ({ const constraints = getConstraints() stream = await navigator.mediaDevices.getUserMedia(constraints) mediaRecorderRef.current = new MediaRecorder(webcamRef.current.stream, { - mimeType: 'video/webm', + mimeType: MediaRecorder.isTypeSupported('video/mp4') + ? 'video/mp4' + : 'video/webm', }) mediaRecorderRef.current.addEventListener('dataavailable', onDataAvailable) onCaptureReady() diff --git a/package.json b/package.json index ebeca62..df537f7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "dev": "concurrently \"npm run server/server.js\" \"npm run client\"", - "start": "concurrently \"node server/server.js\" \"npm run client\"", + "start": "BROWSER=none concurrently \"node server/server.js\" \"npm run client\"", "server": "nodemon server/server.js", "client": "node start-client.js", "heroku-postbuild": "cd client && npm install --only=dev && npm install && npm run build",