Safari and Recording Audio — HTML Media Capture / getUserMedia()

时光怂恿深爱的人放手 提交于 2019-11-30 10:21:11

Safari on iOS 6+ supports the HTML Media Capture spec but only for videos and photos:

  • <input type="file" accept="image/*" />
  • <input type="file" accept="video/*" />

It does not support audio only capture so the following will not produce the expected outcome:

  • <input type="file" accept="audio/*" />

Android supports all 3 (video, audio, image).

Thus support across Android and iOS is as follows:

With Safari on iOS 10.3 the capture boolean attribute is also supported. It indicates capture directly from the webcam is preferred. When used, the option to choose an existing video or image will not be offered on Safari on iOS 10.3+:

  • <input type="file" accept="image/*" capture />

I've written more on the HTML Media Capture topic at https://addpipe.com/blog/correct-syntax-html-media-capture/

UPDATE: New in Safari 11.0 (iOS 11) – Camera and microphone access. Added support for the Media Capture API. Added ability for websites to access camera and microphone streams from a user's device (user permission is required.)

https://developer.apple.com/library/archive/releasenotes/General/WhatsNewInSafari/Articles/Safari_11_0.html

Brobic Vripiat

Safari still doesn't support getUserMedia properly. It fails on this:

imgCapture = new ImageCapture(stream.getVideoTracks()[0]);

This works in Chrome but Safari has no idea what ImageCapture() is.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!