检测HTML5媒体捕获API支持 [英] Detect HTML5 Media Capture API Support

查看:224
本文介绍了检测HTML5媒体捕获API支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来检测浏览器是否支持移动网站,我建设HTML5媒体捕获API?我只能似乎找到检测 getUserMedia()支持解决方案。

Is there a way to detect whether a browser supports the HTML5 Media Capture API for a mobile website I'm building? I can only seem to find solutions for detecting getUserMedia() support.

我希望能够present移动用户的两种情况之一:

I would like to be able to present mobile users one of two scenarios:


  • 用户的浏览器支持的API,所以显示两个上传按钮,一个激活摄像头和一个激活的图片库。

  • 用户的浏览器不支持的API,所以只有一个按钮上传显示,希望激活画廊,如果他们的浏览器支持接受参数。

推荐答案

您可以使用 Modernizr的,的 你可以在的支持的功能表,检测他们同时检测<一个href=\"https://github.com/Modernizr/Modernizr/blob/74655c45ad2cd05c002e4802cdd74cba70310f08/feature-detects/forms/capture.js\"相对=nofollow> HTML媒体捕获,也是<一个href=\"https://github.com/Modernizr/Modernizr/blob/74655c45ad2cd05c002e4802cdd74cba70310f08/feature-detects/webrtc/getusermedia.js\"相对=nofollow> getUserMedia

You can use modernizr, on the docs page you can see in the table of features supported and detected that they detect both the HTML Media Capture and also the getUserMedia

这篇关于检测HTML5媒体捕获API支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆