ioshtml5-video

Recording Video HTML5 not working in Safari and iOS mobile app


I am trying to use the HTML5 video - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video to access camera on the device.

I am following this example - https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API/Recording_a_media_element to record the video.

It works perfectly in Chrome browser but does not seem to be working on Safari and iOS mobile app. On debugging both captureStream() and mozCaptureStream() functions are undefined.

Any suggestions on how to fix this?

PS: Is this a known issue - https://bugs.webkit.org/show_bug.cgi?id=181663. Are there any workarounds? Thanks!


Solution

  • "It works perfectly in Chrome browser but does not seem to be working on Safari and iOS mobile app. On debugging both captureStream() and mozCaptureStream() functions are undefined."

    1. Your link is recording into Google's own webM video which is a format not supported by Apple. The Safari browser cannot encode pixels as VP8 or VP9 to use inside webM container. Apple has an MPEG video license so Safari should record MP4 format.

      update: Safari actually records as Fragmented MP4 format (ISOBMFF).

    2. mozCaptureStream() is specific to Mozilla Firefox. Safari won't know/accept it.

    3. captureStream() is not fully suppported on Safari. The missing part is the recording part.

    Possible workarounds: