漫不经心,有没有可能用jquery或html在ipad的文件输入上禁用图片库和icloud选择?
当按钮被点击时,我有下面的html代码用于附加的文件:
<input type="file" id="uploadBtn" class="uploadBtn">目前,如果我在ipad上运行代码,当连接的按钮被点击时,它会弹出一个对话框,允许用户拍摄照片,从图片库或从ipad中选择。无论如何,我可以禁用图片库和icloud选择在ipad的文件输入与jquery或html?
发布于 2017-08-18 03:43:16
您不能通过input按钮执行此操作。
你的另一种选择是通过网页上的摄像头捕获图像,然后将图像推送到您的服务器上。
HTML
<video id="video" width="640" height="480" autoplay></video>
<button id="snap">Snap Photo</button>
<canvas id="canvas" width="640" height="480"></canvas>Javascript
// Grab elements, create settings, etc.
var video = document.getElementById('video');
// Get access to the camera!
if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
// Not adding `{ audio: true }` since we only want video now
navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
video.src = window.URL.createObjectURL(stream);
video.play();
});
}
// Elements for taking the snapshot
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var video = document.getElementById('video');
// Trigger photo take
document.getElementById("snap").addEventListener("click", function() {
context.drawImage(video, 0, 0, 640, 480);
});https://stackoverflow.com/questions/45725111
复制相似问题