Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26795] iOS: Event listener on overlay is not working for camera when camera is kept idle for a few minutes

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-07-16T22:02:57.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.1.0
ComponentsiOS
Labelscamera, ios, overlay
Reportershumne
AssigneeVijay Singh
Created2019-02-01T11:04:34.000+0000
Updated2019-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

FileDateSize
cameraIssue.zip2019-02-01T11:03:47.000+0000750767
index.js2019-02-06T19:16:16.000+00004742

Comments

  1. Rakhi Mitro 2019-02-03

    Hello [~shumne], Thanks for reporting this. Are you experiencing this on all iOS devices or a specific device on your end?
  2. shumne 2019-02-04

    Hi Rakhi, We are facing this issue on all iOS devices.
  3. Vijay Singh 2019-02-06

    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!
  4. Vijay Singh 2019-02-07

    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();
       
  5. Samir Mohammed 2019-02-12

    FR Passed, Awaiting for Merge to become available on Github.
  6. Samir Mohammed 2019-03-01

    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

JSON Source