Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23870] Windows: 'The request is not supported' error thrown when using front camera and tapping view to focus

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2016-09-12T08:46:04.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.0.0
ComponentsWindows
Labelsqe-6.0.0
ReporterEwan Harris
AssigneeKota Iguchi
Created2016-09-06T14:24:38.000+0000
Updated2016-09-15T16:13:29.000+0000

Description

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

Comments

  1. Kota Iguchi 2016-09-07

    master: https://github.com/appcelerator/titanium_mobile_windows/pull/857 6_0_X: https://github.com/appcelerator/titanium_mobile_windows/pull/858
  2. Ewan Harris 2016-09-15

    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

JSON Source