[TIMOB-26795] iOS: Event listener on overlay is not working for camera when camera is kept idle for a few minutes
| GitHub Issue | n/a |
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-07-16T22:02:57.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 8.1.0 |
| Components | iOS |
| Labels | camera, ios, overlay |
| Reporter | shumne |
| Assignee | Vijay Singh |
| Created | 2019-02-01T11:04:34.000+0000 |
| Updated | 2019-07-16T22:03:00.000+0000 |
Description
On click of simple label/button, we open the camera and one overlay is added on the camera view to show close/capture/gallery icons.
Following are the steps to reproduce the issue.
Case 1:
* Open the application.
* Click on the label to open the camera.
* Keep app in the background for 1 or 2 minutes.
* Open again
* When we click Close button on the camera overlay, It is not clickable.
Case 2:
* Open the application
* Click on the label to open the camera.
* Keep app in the foreground for few minutes.
* Same here, when we click Close button on the camera overlay, It is not clickable.
Attachments
Hello [~shumne], Thanks for reporting this. Are you experiencing this on all iOS devices or a specific device on your end?
Hi Rakhi, We are facing this issue on all iOS devices.
A quick solution for this issue is - Create 'overlay' once and use it every launch of camera. Which means create overlay outside of 'handleCamera' function. I have attached updated index.js. Please let me know if it works for you. Thanks!
PR - https://github.com/appcelerator/titanium_mobile/pull/10685 Test Case -
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); win.addEventListener('click', function(){ onGalleryOverlay(); }); function onGalleryOverlay() { var overlay = Ti.UI.createView({ height: Ti.UI.FILL, width: Ti.UI.FILL }); var closeBtn = Ti.UI.createButton({ width: "80dp", height: "80dp", backgroundColor: "yellow", top: "20dp", right: "20dp" }); closeBtn.addEventListener("click", function() { Ti.Media.hideCamera(); }); overlay.addEventListener("click", function() { Ti.API.info('ovelay clicked'); Ti.Media.hideCamera(); }); overlay.add(closeBtn); Ti.Media.showCamera({ mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO], showControls: false, overlay: overlay, saveToPhotoGallery : true, autohide : false, success:function(e) { console.log("\n success"); }, cancel: function() { console.log("cancel"); }, error:function(error) { console.log("error"); } }); } win.open();FR Passed, Awaiting for Merge to become available on Github.
Closing ticket, fix verified in SDK version 8.1.0.v20190301040201. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10685