0

I ran into this problem in Safari where it appears that WebRTC is not fully supported. So when I call

navigator.webkitGetuserMedia()

I get an undefined error.

So my question to the community is what is the best way to write a Meteor app that captures Video on a mobile device and saves it on the said device.

If you have done this, I would appreciate it very much if you could share with me and the community how you went about this.

1 Answers1

0

Specific Answer

The modern API is: navigator.mediaDevices.getUserMedia(constraints). See the docs here.

In the past, I've been unsuccessful with getUserMedia on iOS, but according to this post it can be done on iOS 11.

As for saving it, you can write to the browser's file system, but that API is only supported in Chrome. If you want to write to the camera roll, you'd need native code in the mix.

General Advice

I've spent several years of my life dealing with recording, uploading, and processing video using meteor. If you are doing anything more than trivial web recording, these observations may save you some time:

  • Chrome (on everything but iOS) has the best API for web recording. If you can require chrome for recording, that's ideal. Firefox is a close second, only because it doesn't support the file system API.
  • If you need to record and upload long videos on iOS, build a native app. Don't consider any kind of hybrid - that's a serious trap. The number of corner cases and things you need to check is pretty astounding, and the only way to get over those hurdles is with native code.
Community
  • 1
  • 1
David Weldon
  • 63,632
  • 11
  • 148
  • 146
  • David. Thanks for your help. Yeah. I'm feeling the pain of iOS dev via Cordova. I'm about to scratch what I have done and start from zero. Makes me nervous because I don't have much time. – Andres Sosa Oct 25 '18 at 04:49
  • Yeah I'd recommend that if you or someone on your team has iOS development experience. We had a cordova-based app for about 1.5 years, but we found we had to write about 80% of it native anyway and the remaining 20% was a somewhat janky UI. On top of that the build process was incredibly brittle. We switched over to native earlier this year, and the experience (both for us and our users) has been greatly improved. BTW if you still need to connect your app to meteor, you can use a package like `simple:rest`. – David Weldon Oct 25 '18 at 16:48
  • Thanks again David. – Andres Sosa Oct 25 '18 at 21:28