如何检测HTML Media Capture *的浏览器支持?
How can I detect browser support for HTML Media Capture* ?
传统的测试方式支持某个属性似乎无法在某些设备上运行(在iPad和Google Nexus上测试):
The traditional way of testing if an attribute is supported doesn't seem to work on some devices (tested on iPad and Google Nexus):
var elm = document.createElement(input); if (capture in elm) { return true; }有一个对Modernizr的测试,但它没有'似乎是可靠的(它使用相同的原理): github/Modernizr/Modernizr / pull / 909
__
(*)有关HTML Media Capture的更多信息:
(*) More info on HTML Media Capture:
www.w3/TR / html-media-capture / http:/ /www.html5rocks/en/tutorials/getusermedia/intro/#toc-round1
推荐答案我希望我错了,但似乎我们无法进行此检测...
I hope I'm wrong, but it seems we won't be able to make this detection...
(与Streaming / GetUserMedia API不同)的org / TR / html-media-capture /rel =nofollow>最后一篇论文发布于去年(2014年),从未发布过退出了草稿...
The last paper about this HTML MEDIA Capture API (which is different than the Streaming/GetUserMedia API), as been posted last year (2014), and never gone out of the drafts...
这评论从2012年开始请求在Firefox中实现此功能明确指出:
This comment from 2012 on a request to implement this feature in Firefox clearly states that :
[T]这里没有真正需要实现的。它应该是免费的Android Intent系统。我们应该调用ACTION_IMAGE_CAPTURE / ACTION_VIDEO_CAPTURE的意图。
[T]here is no real need to implement that. It should come for free with Android Intent system. We should just call in intent for ACTION_IMAGE_CAPTURE/ACTION_VIDEO_CAPTURE.
这意味着此功能直接来自操作系统,而我们作为开发人员将无法知道这是否会是否可用...
Which means that this feature comes from the OS directly, and that we as developers won't have any way to know if this will be available or not...
因此,检测此功能的唯一方法似乎是针对已知支持设备的UserAgent匹配......
So the only way to detect this feature seems to be a UserAgent match against known supporting devices...
更多推荐
检测浏览器对HTML Media Capture的支持
发布评论