Open asadrazashah opened 4 years ago
Any update about this?
The recorder component accepts constraint as a prop that can be used to add different resolutions .
You can set video resolution with constraints.
constraints={{
audio: true,
video: {
width: 1280,
height: 720,
},
}}
More details here: https://developer.mozilla.org/fr/docs/Web/API/MediaDevices/getUserMedia
On android devices it seems the constraints does not take any effect.
<VideoRecorder
countdownTime={0}
timeLimit={secondsPerQuestion * maxQuestions * 1000}
constraints={{ audio: false, video: { width: 1280, height: 720 } }}
className="react-player absolute top-0 left-0 w-full h-full"
onRecordingComplete={(videoBlob) => {
console.log("videoBlob", videoBlob);
// do something
}}
onRecordingError={(err) => {
console.log("err", err);
}}
onStartRecording={() => {
// do something
}}
onStopRecording={() => {
// so something
}}
/>
the output video file on Android device ignore the constraints and the video is:
on iOS and desktops, it works as expected. anyone know how to make it work on Android?
You can set video resolution with constraints.
constraints={{ audio: true, video: { width: 1280, height: 720, }, }}
More details here: https://developer.mozilla.org/fr/docs/Web/API/MediaDevices/getUserMedia
worked for me after set width
and height
, even on Android
Options for aspect ratio and video resolution ?