-
I am building an app in Ionic which makes use of the IOSRTC plugin for using the WebRTC APIs. I try to record and store videos. With the MediaDevices.getUserMedia() method I successfully can stream video to a video element. The next step is to save and store the video stream with the MediaRecorder method.
It seems that this method is available and can be used in my Ionic app (iPhone / IOS15). However when the MediaRecorder is recording and the
In the Safari browser on my laptop the (I don't know if this question belongs here) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
TLDR: use Cordova's Media Capture Plugin. Unfortunalty iosRTC WebRTC implementation does not support MediaRecorder and passing a MediaStream from iosRTC to MediaRecorder will simply not works. Alternativly if you want video only, you can implement video capture using "videoElement.render.save" like that: var canvasEl;
function TestMediaRenderCatpure(videoEl) {
canvasEl = document.createElement('canvas');
var ctx = canvasEl.getContext("2d");
canvasEl.width = "100";
canvasEl.height = "100";
canvasEl.style.position = 'absolute';
canvasEl.style.left = 0;
canvasEl.style.bottom = 0;
appContainer.appendChild(canvasEl);
var image = new Image();
image.onload = function() {
ctx.drawImage(image, 0, 0);
};
videoEl.render.save(function (data) {
image.src = "data:image/jpg;base64," + data;
});
} Then use captureStream on Canvas to get "Native" MediaStream and pass it to MediaRecorder video recording. |
Beta Was this translation helpful? Give feedback.
TLDR: use Cordova's Media Capture Plugin.
Unfortunalty iosRTC WebRTC implementation does not support MediaRecorder and passing a MediaStream from iosRTC to MediaRecorder will simply not works.
iOS WebRTC implementation is custom (It's a giant Polyfill basicly) and would require to implement a SHIM for MediaRecorder to works with iosRTC MediaStream.
Alternativly if you want video only, you can implement video capture using "videoElement.render.save" like that: