react-native-vision-camera
react-native-vision-camera copied to clipboard
✨ Return mime (content type) from video recordings
What
I noticed that the Video File object does not include the mime type. Including it in the VideFile would benefit those using the video to send over networks.
Alternatives/Workarounds
I am going to use https://www.npmjs.com/package/react-native-mime-types in order to get the mime from the file
import * as mime from "react-native-mime-types";
camera.current.startRecording({
flash: flash,
onRecordingError: (error) => {
onStoppedRecording();
},
onRecordingFinished: (video) => {
const videoSource = {
path: video.path,
mimeType: mime.lookup(video.path),
};
onMediaCaptured(video, "video");
onStoppedRecording();
},
});