I want to send a video stream from an iOS device (version 11 and above) to a server (from a client using html5 on iOS).
For other browsers I get the stream from navigator.getUserMedia
, and pass it to the server using mediaRecorder and a WebSocket:
this.mediaRecorder = new MediaRecorder(this._stream);
this.mediaRecorder.start(50);
this.mediaRecorder.ondataavailable = function(e) {
app.socket.emit("frameRequest", e.data);
}
however, MediaRecorder is not supported on iOS. Is there an alternative to sending the stream from iOS devices?
MediaRecorder API is Not Supported on Safari 13, which means that any user who'd be accessing your page through Safari 13 can see it perfectly. Browser incompatibility may be due to any other web technology apart from MediaRecorder API.
Go to Settings → Safari → Advanced → Experimental Features. Enable MediaRecorder.
Media Recorder records both audio and video recordings and save them into many different formats of your liking with just a few simple taps! All recordings will automatically appear on the Files app.
The MediaRecorder API enables you to record audio and video from a web app. It's available now in Firefox and in Chrome for Android and desktop.
The MediaRecorder interface of the MediaStream Recording API provides functionality to easily record media. It is created using the MediaRecorder() constructor. EventTarget MediaRecorder.
There are a handful of polyfills that add MediaRecorder API support to browsers that don't support it natively, including iOS Safari. My current favorite is Opus Media Recorder.
One problem I'm running into is that it only supports recording in Ogg or Wav formats, however iOS doesn't support playback of Ogg - only Wav, AAC, or MP3. Unfortunately, Wav and AAC files are too big. So, I am taking the approach of recording in Wav and transcoding to MP3 in the browser using lamejs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With