[TIMOB-23546] Windows: Tap-to-focus for Camera
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-07-26T18:16:28.000+0000 |
Affected Version/s | Release 5.4.0 |
Fix Version/s | Release 6.0.0 |
Components | Windows |
Labels | n/a |
Reporter | Kota Iguchi |
Assignee | Kota Iguchi |
Created | 2016-06-21T13:17:54.000+0000 |
Updated | 2016-09-06T14:25:07.000+0000 |
Description
When
overlay
is specified for Ti.Media.showCamera
, there is no "Tap to Focus" support now, which makes it difficult to focus at shooting.
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],
overlay: overlay,
success: function (e) {
Ti.API.info('showCamera() success');
imageView.image = e.media;
},
error: function (e) {
alert('showCamera() error: ' + JSON.stringify(e));
}
});
});
win.add(openButton);
win.add(imageView);
win.open();
Windows::Media::Devices::VideoDeviceController: https://msdn.microsoft.com/library/windows/apps/br226825
https://github.com/appcelerator/titanium_mobile_windows/pull/786
Verified using: OS: Microsoft Windows 10 Pro 10.0.14393 Appc core: 6.0.0-38 Appc NPM: 4.2.8-6 Ti SDK: 6.0.0.v20160904203840 Lumia 930: 10.0 When using the rear camera with an overlay the view can now be tapped to focus the camera. Filed TIMOB-23870 for error being thrown when using front camera Closing ticket