html5media使用api,html - Detect HTML5 Media Capture API Support - Stack Overflow

User's browser supports the API, so two upload buttons are displayed, one activating the camera and one activating the image gallery.

There's no way (at the moment) to create 2 separate HTML buttons: one for (just) the library & one for (just) the camera (

I've covered all the possible HTML Media Capture options in this article)

Use

and you'll be prompted to choose between capturing a photo or selecting an existing one:

xRO3g.png

User's browser doesn't support the API, so just one upload buttons is displayed, hopefully activating the gallery if their browser supports the accept parameter

Support is as follows:

Android 2.2+ and iOS6.0+ support the above code

Android 3.0+ supports capture and takes the user straight to the camera

iOS6 through 10 do NOT support capture (prompt is always shown)

desktop browsers do NOT support HTML Media Capture

Detecting support resumes to detecting the above browsers.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值