现在HTML5可以调用摄像头录像吗

现在HTML5可以调用摄像头录像吗,第1张

可以的

<input type="file" accept="video/*capture=camcorder">

<input type="file" accept="audio/*capture=microphone">

<input type="file" accept="image/*capture=camera">直接调用相机

<input type="file" accept="image/*" />调用相机 图片或者相册

还是要根据手机的类型来说,有些手机只能调相机,有些手机只能调相册,或者两者都行。

html5中的video这个标签是引入视频的,通过navigator.getUserMedia去获取摄像头的视频流,所以要在事件里用关闭的代码都不能执行关闭摄像头,只有关闭网页,摄像头才关闭。html5打开摄像头代码:SmartHome-Camera/**/functioninit(t){

在手机端调用手机摄像头和相册

<input type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput">

如果只想调用相册或者选择文件

<input type="file" name="file" accept="image/*" >

如果想调用摄像头

<input type="file" name="file" capture="camera">


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/7675801.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-08
下一篇2023-04-08

发表评论

登录后才能评论

评论列表(0条)

    保存