video.src is NOT video.srcObject
And yes, they will conflict ;)!
video.src accepts the source URL
video.srcObject accepts the original video.srcObject OBJECT (currently only MediaStream safely supported since 2019, maybe in the future you can place Blob right here, but not now ...)
So it depends on what you really want to do:
A) Show what is being recorded
You should have a MediaStream object (what you do) and just put it in video.srcObject
navigator.getUserMedia({ video: true, audio: true }, function (localMediaStream) { var video = document.querySelector('video'); video.src = '';
B) Show existing video / just recorded video
video.srcObject = null; // make sure srcObject is empty and does not overlay our src video.src = window.URL.createObjectURL(THE_BLOB_OBJECT);
THE_BLOB_OBJECT - you already have a file created using the File API, or, as a rule, if you have any recorder, let's say that the variable recorder usually has getBlob() or something similar, such as a recorder.getBlob() I highly recommend using some existing recorder library for this, but there is an official MediaRecorder API to complete it - https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder.
So, you see that you just combined 2 things together, you just need to separate them and make sure that they do not conflict :)
source share