alternative to mediaRecorder on iOS
Asked Answered
T

1

7

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?

Technetium answered 18/1, 2018 at 11:54 Comment(0)
E
2

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.

Ectype answered 19/10, 2018 at 23:27 Comment(2)
Anything that does video?Cusk
@Cusk i was thinking this, if theoretically the video is loaded from the same domain theoretically one can implement a video-recording mechanism from scratch by analyzing the bits of the raw file itself, perhaps with ffmpeg.jsEscent

© 2022 - 2024 — McMap. All rights reserved.