Description
When using the code below, if the view is tapped in an attempt to focus the camera then the following error is thrown
"code":-1,"error":"The request is not supported.\r\n\r\nThe request is not supported.\r\n","success":false\
var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' }),
openButton = Ti.UI.createButton({ title: 'OPEN CAMERA', backgroundColor: 'blue' }),
imageView = Ti.UI.createImageView({ width: Ti.UI.FILL, height: '70%' });
var overlay = Ti.UI.createView({
layout: 'vertical',
height: '20%', width: Ti.UI.FILL,
bottom: 0
}),
takeButton = Ti.UI.createButton({ title: 'TAKE A PHOTO', backgroundColor: 'red' }),
hideButton = Ti.UI.createButton({ title: 'HIDE PREVIEW', backgroundColor: 'red' });
takeButton.addEventListener('click', function () {
Ti.Media.takePicture();
});
hideButton.addEventListener('click', function () {
Ti.Media.hideCamera();
});
overlay.add(takeButton);
overlay.add(hideButton);
openButton.addEventListener('click', function () {
Ti.Media.showCamera({
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
whichCamera: Ti.Media.CAMERA_FRONT,
overlay: overlay,
success: function (e) {
Ti.API.info('showCamera() success');
imageView.image = e.media;
},
error: function (e) {
alert('showCamera() error: ' + JSON.stringify(e));
Ti.API.info(JSON.stringify(e));
}
});
});
win.add(openButton);
win.add(imageView);
win.open();
Steps to reproduce
Add the above code to your existing app.js
Tap OPEN CAMERA
Tap the screen
Actual result
The above error will be thrown
Expected result
No errors should be thrown
master: https://github.com/appcelerator/titanium_mobile_windows/pull/857 6_0_X: https://github.com/appcelerator/titanium_mobile_windows/pull/858
Verified using: OS: Microsoft Windows 10 Pro 10.0.14393 Appc core: 6.0.0-42 Appc NPM: 4.2.8-6 Ti SDK: 6.0.0.v20160914165725 Appc Studio: 4.8.0.201609101003 When using the code in the description and tapping the screen the error is no longer thrown Closing ticket