Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

alternative to mediaRecorder on iOS

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?

like image 921
scanner Avatar asked Jan 18 '18 11:01

scanner


People also ask

Does Safari support MediaRecorder?

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.

How do I enable MediaRecorder in Safari?

Go to Settings → Safari → Advanced → Experimental Features. Enable MediaRecorder.

What is MediaRecorder iPhone?

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.

What is MediaRecorder?

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.

What is MediaRecorder API?

The MediaRecorder interface of the MediaStream Recording API provides functionality to easily record media. It is created using the MediaRecorder() constructor. EventTarget MediaRecorder.


1 Answers

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.

like image 144
Derrick Miller Avatar answered Oct 22 '22 05:10

Derrick Miller