I have an input of type file which allows my users to upload video files which will be of type File. In my application there also exists the react-player component which takes a URL prop that can be of type array or MediaStream according to its documentation. having done some research I found the following way to convert the File to a URL to be compatible with the react-player however it is depreciated so I do not wish to use it.
URL.createObjectURL(file)
This returns a URL for a blob or file object. I see that this has been replaced with passing a MediaStream to video.srcObject() but I am unaware how to convert a File to type MediaStream and srcObject() seems like a hacky way to access react-player which exposes its URL for the same purpose and also takes a MediaStream. To summarise how do I get a video uploaded with a file type input to be previewed in a react-player component?