Details
-
Type:
Bug
-
Status: Closed
-
Priority:
None
-
Resolution: Fixed
-
Affects Version/s: Release 6.0.0
-
Fix Version/s: Release 6.0.0
-
Component/s: Windows
-
Labels:
-
Environment:
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
-
Story Points:2
-
Sprint:2016 Sprint 19 SDK
Description
Description
When using the code below and not adding the videosLibrary capability, when the picture is taken the app will crash. If the videosLibrary capability is added then it will work as expected. From testing it appears that the generation of used capabilities by the CLI does not add the videosLibrary capability.
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({
|
whichCamera: Titanium.Media.CAMERA_FRONT, // Titanium.Media.CAMERA_REAR
|
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
|
overlay: overlay,
|
success: function (e) {
|
Ti.API.info('showCamera() success');
|
},
|
error: function (e) {
|
alert('showCamera() error: ' + JSON.stringify(e));
|
}
|
});
|
});
|
|
win.add(openButton);
|
win.add(imageView);
|
win.open();
|
Steps to reproduce
- Add the code above to an existing app.js
- Build for a device
- Click OPEN CAMERA
- Click TAKE PHOTO
Actual result
The app will crash as the videosLibrary is not included
Expected result
App should not crash, correct capabilities should be added
Attachments
Issue Links
- relates to
-
TIMOB-23156 Windows: Automatically add required Capabilities to Manifest based on API usage
-
- Closed
-