Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23546] Windows: Tap-to-focus for Camera

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-07-26T18:16:28.000+0000
Affected Version/sRelease 5.4.0
Fix Version/sRelease 6.0.0
ComponentsWindows
Labelsn/a
ReporterKota Iguchi
AssigneeKota Iguchi
Created2016-06-21T13:17:54.000+0000
Updated2016-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();

Comments

  1. Kota Iguchi 2016-06-22

    Windows::Media::Devices::VideoDeviceController: https://msdn.microsoft.com/library/windows/apps/br226825
  2. Gary Mathews 2016-07-26

    https://github.com/appcelerator/titanium_mobile_windows/pull/786
  3. Ewan Harris 2016-09-06

    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

JSON Source