Hi I changed the first Example from ultimate webview 2 to check the camera.
It opens a dialog : Choose app. See screenshot.
Every app is working file selector, gallery, accept the camera app dont open.
What can I do.
rgs
J.
It opens a dialog : Choose app. See screenshot.
Every app is working file selector, gallery, accept the camera app dont open.
What can I do.
rgs
J.
B4X:
ultimateWebView1.LoadHTMLString( $"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<h1>Camera Test</h1>
<input Type="file" id="mypic" accept="image/*" capture="camera">
<canvas></canvas>
<br>
<script>
var input = document.querySelector('input[type=file]'); // see Example 4
input.onchange = function () {
var File = input.files[0];
//upload(File);
drawOnCanvas(File); // see Example 6
//displayAsImage(File); // see Example 7
};
function upload(File) {
var form = new FormData(),
xhr = new XMLHttpRequest();
form.append('image', file);
xhr.open('post', 'server.php', true);
xhr.send(form);
}
function drawOnCanvas(File) {
var reader = new FileReader();
reader.onload = function (e) {
var dataURL = e.target.result,
c = document.querySelector('canvas'), // see Example 4
ctx = c.getContext('2d'),
img = new Image();
img.onload = function() {
c.width = img.width;
c.height = img.height;
ctx.drawImage(img, 0, 0);
};
img.src = dataURL;
};
reader.readAsDataURL(File);
}
function displayAsImage(File) {
var imgURL = URL.createObjectURL(File),
img = document.createElement('img');
img.onload = function() {
URL.revokeObjectURL(imgURL);
};
img.src = imgURL;
document.body.appendChild(img);
}
</script>
<!-- source: http://www.w3.org/TR/html-media-capture/ -->
</body>
</html>
"$)