navigator.mediaDevices.getUserMedia().then(stream=>{
//a recorder is created
var mediaRecorder = new MediaRecorder(stream);
//started it
mediaRecorder.start();
//an array is created that receives all the data
var recordedChunks = [];
//fill it
mediaRecorder.ondataavailable = function(e){recordedChunks.push(e.data)};
//when stopped downloads the recording
mediaRecorder.onstop=function(){
var blob = new Blob(recordedChunks, {
'type': 'video/mp4'
});
var url = URL.createObjectURL(blob);
var a = document.createElement('a');
document.body.appendChild(a);
a.style = 'display: none';
a.href = url;
a.download = 'test.webm';
a.click();
window.URL.revokeObjectURL(url);
}
}.catch()
This code works for me, but when the video is downloaded it is downloaded without the details (left image: a video downloaded from youtube; right image: a video downloaded using mediaRecorder) https://i.stack.imgur.com/IxmYD.png
And the other problem is that the necessary actions cannot be done in the videos (speed up, go to a specific time) since it does not have an end time https://i.stack.imgur.com/yF7qx.png
What could I do to give it the required details - formats?
Here is a page that also has the same problems when downloading the recording from your webcam https://webrtc.github.io/samples/src/content/getusermedia/record/