Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-13240

iOS: Media - Titanium.Media.openPhotoGallery is not working for iPads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Invalid
    • Affects Version/s: Release 3.1.0
    • Component/s: iOS
    • Labels:
    • Environment:

      Tested with:
      SDK: 3.1.0.v20130327135307
      Studio:3.0.2.201302191606
      Device: iPad mini(v 6.0), iPad2(v 5.1), iPhone5(v 6.0)

      Description

      Titanium.Media.openPhotoGallery is not working for iPads.
      This is not regression since the issue occurs on 3.0.2 GA as well

      Steps to reproduce:
      1. Create an app using the code below.
      2. Launch the test app.

      Actual:
      No photo gallery is invoked on iPads whereas photo gallery is successfully invoked on iPhones.

      Expected:
      Photo gallery should be invoked on iPads as well.

       
       
       
      var win1 = Titanium.UI.createWindow({  
          title:'Tab 1',
          backgroundColor:'white'
      });
       
       
      var imageView = Titanium.UI.createImageView({
          height:200,
          width:200,
          top:20,
          left:10,
          backgroundColor:'#999'
      });
       
      var popoverView;
      var arrowDirection;
       
      if (Titanium.Platform.osname == 'ipad')
      {
          // photogallery displays in a popover on the ipad and we
          // want to make it relative to our image with a left arrow
          arrowDirection = Ti.UI.iPad.POPOVER_ARROW_DIRECTION_LEFT;
          popoverView = imageView;
      }
       
      Titanium.Media.openPhotoGallery({
       
          success:function(event)
          {
              var cropRect = event.cropRect;
              var image = event.media;
       
              // set image view
              Ti.API.debug('Our type was: '+event.mediaType);
              if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)
              {
                  imageView.image = image;
              }
              else
              {
                  // is this necessary?
              }
       
              Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y  + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width);
       
          },
          cancel:function()
          {
              alert('cancelled fired');
          },
          error:function(error)
          {
          },
          allowEditing:true,
          popoverView:popoverView,
          arrowDirection:arrowDirection,
          mediaTypes:[Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO]
          
      });
       
      win1.add(imageView);
       
      win1.open();
      	
      
      

        Attachments

          Activity

            People

            • Assignee:
              srahim Sabil Rahim
              Reporter:
              amittal Anshu Mittal
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-16034
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code