New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-25314] : iOS camera with overlay view is zoomed #9818
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FR Passed: Able to see that the camera is no longer zoomed in when an overlay is used which has camera controls enabled. Test case taken from https://jira.appcelerator.org/browse/TIMOB-25314
var overlay = Ti.UI.createView({width: Ti.UI.FILL, height: Ti.UI.FILL});
var closeBtn = Ti.UI.createButton({
width: 40,
height: 40,
backgroundColor: "red",
});
closeBtn.addEventListener("click", function() {
Ti.Media.hideCamera();
});
overlay.add(closeBtn);
function onGallery() {
Ti.Media.showCamera({
mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],
showControls: false,
overlay: overlay,
success:function(e) {
console.log("\n success");
},
cancel: function() {
console.log("cancel");
},
error:function(error) {
console.log("error");
}
});
}
function onGalleryOverlay() {
Ti.Media.showCamera({
mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],
showControls: true,
overlay: overlay,
//transform: Ti.UI.create2DMatrix({scale: 1}),
success:function(e) {
console.log("\n success");
},
cancel: function() {
console.log("cancel");
},
error:function(error) {
console.log("error");
}
});
}
function onGalleryWithoutControls() {
Ti.Media.showCamera({
mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],
showControls: false,
success:function(e) {
console.log("\n success");
},
cancel: function() {
console.log("cancel");
},
error:function(error) {
console.log("error");
}
});
}
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
layout: 'vertical'
});
var btn1 = Ti.UI.createButton({
title: 'Show Camera with overlay w.o. controls',
top: 50
});
var btn2 = Ti.UI.createButton({
title: 'Show Camera with Overlay with controls',
top: 50
});
var btn3 = Ti.UI.createButton({
title: 'Show Camera w.o Overlay w.o. controls',
top: 50
});
btn1.addEventListener('click', onGallery);
btn2.addEventListener('click', onGalleryOverlay);
btn3.addEventListener('click', onGalleryWithoutControls);
win.add(btn1);
win.add(btn2);
win.add(btn3);
win.open();
Test steps
- Created a build from this PR
- Created a titanium app
- Added the test case above
- Ran the program
- Used the 2nd option
Show camera with overlay and controls
to record a video - Camera was no longer zoomed in as seen previously (e.g. 7.2.0.v20180501104106)
- Other two options worked as intended
Test Environment
APPC Studio: 5.0.0.201712081732
APPC CLI: 7.0.3
iphone 6 plus (10.2)
Operating System Name: Mac OS High Sierra
Operating System Version: 10.13
Node.js Version: 8.9.1
Xcode 9.2
Generated by 🚫 dangerJS |
https://jira.appcelerator.org/browse/TIMOB-25314