html可以直接调用手机相册吗
答案:3 悬赏:80
解决时间 2021-02-19 21:59
- 提问者网友:独菊痴梦
- 2021-02-19 10:48
html可以直接调用手机相册吗
最佳答案
- 二级知识专家网友:时光不老我们不分离
- 2021-02-19 11:42
需要加载cordova.js<br>方法:<br><br>document.addeventlistener("deviceready", ondeviceready, false);<br>function ondeviceready() {<br>picturesource = navigator.camera.picturesourcetype;<br>destinationtype = navigator.camera.destinationtype;<br>}<br>//相册<br>function fromcamera() <br>{<br>var source = picturesource.photolibrary;<br>navigator.camera.getpicture(function (imagedata) {<br>setimg(imagedata);<br>}, function (message) {<br>if (source == picturesource.camera)<br>alert('加载照相机出错!' + message);<br>else<br>alert('加载相册出错!' + message);<br>}, {<br>quality: 50,<br>destinationtype: destinationtype.file_uri,<br>sourcetype: source<br>});<br>}<br>//拍照<br>function editimgpz() <br>{<br>navigator.camera.getpicture(function (imagedata) {<br>setimg(imagedata);<br>}, function (message) {<br>alert(message);<br>}, {<br>quality: 50,<br>destinationtype: navigator.camera.destinationtype.file_uri,<br>sourcetype: camera.picturesourcetype.camera,<br>allowedit: true,<br>encodingtype: camera.encodingtype.jpeg,<br>popoveroptions: camerapopoveroptions,<br>savetophotoalbum: true<br>});<br>}
全部回答
- 1楼网友:统治我的世界
- 2021-02-19 14:04
- 2楼网友:一身浪痞味
- 2021-02-19 13:19
可以使用进行相册的访问或是拍照。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯