I had the same error for the MediaStream. The solution is set a stream to the srcObject.
From the docs:
Important: If you still have code that relies on createObjectURL() to attach streams to media elements, you need to update your code to simply set srcObject to the MediaStream directly.