Sunday, 27 June 2021

Show a video recorded in WebRTC in video object in Safari

When using WebRTC to record a video directly from user webcam, you get a BLOB object with the video.

video.src = window.URL.createObjectURL(blob);

When trying to apply the blob to the video element (for example with the code above or other alternatives like webkitURL, etc... as shown here https://stackoverflow.com/a/59934597/311188), it fails in Safari.

It shows the video controls, but it shows 0 seconds, and play does nothing.

Somebody created an example to achieve this, but it uses File (https://bl.ocks.org/unRob/3bd07a012597aa959c92) and File is not allowed in Safari

And I have been searching for how to create a File in Safari, but it does not work.

How can I put a blob directly in a video element so user can PLAY and PREVIEW what he has just recorded ?



from Show a video recorded in WebRTC in video object in Safari

No comments:

Post a Comment