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

iOS: showCamera does not work on iPad2 if running iPad app

    Details

      Description

      {html}<div><p>If you run an iPad application on the iPad
      Titanium.Media.showCamera doesn't work.<br>
      If you run an iPhone application on the iPad,
      Titanium.Media.showCamera camera works properly.</p>
      <p>-fail with iPad app Step 1: make an app for 'iPad' and paste in
      the code below.<br>
      step 2: run the app on an iPad 2<br>
      Step 3: click the 'camera' button<br>
      Step 4: notice the camera overlay fly out the top of the page</p>
      <p>-pass with iPhone app Step 1: make an application for 'iPhone'
      and paste in the code below<br>
      step 2: run the app on an iPad 2<br>
      Step 3: click the 'camera' button<br>
      Step 4: notice the camera works properly</p>
      <pre>
      <code class="javascript">Titanium.UI.setBackgroundColor('#000');

      var win1 = Titanium.UI.createWindow({
      title:'Tab 1',
      backgroundColor:'#fff'
      });

      var camera_button = Titanium.UI.createButton ({
      title:'Camera',
      height:60,
      bottom: 10,
      width:160
      });
      camera_button.addEventListener ('click', function(e) {

      Titanium.Media.showCamera ({

      saveToPhotoGallery: true,
      allowEditing: true,
      // top:100,
      // width:'auto',

      success: function(event){
      var a = Titanium.UI.createAlertDialog({ title: 'You did it!' });
      a.show();
      },

      error: function(error){
      var a = Titanium.UI.createAlertDialog({ title: 'Uh Oh...' });
      if (error.code == Titanium.Media.NO_CAMERA || error.code == Titanium.Media.NO_VIDEO) { a.setMessage('Sorry, this device does not have a camera. You knew that, right?'); }
      else { a.setMessage('Unexpected error: ' + error.code); }
      a.show();
      }

      });

      });

      win1.add(camera_button);
      win1.open();</code>
      </pre>
      <h3>Resources</h3>
      <p>ScreenShot and Video attached</p>
      <h3>Tested With</h3>
      <p>TiSDK 1.6.1, iPad 2, iOS 4.3</p>
      <h3>Associated Helpdesk Ticket</h3>
      <p><a href=
      "http://developer.appcelerator.com/helpdesk/view/76504">http://developer.appcelerator.com/helpdesk/view/76504</a></p></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              rseagraves Reggie Seagraves
              Reporter:
              jalter Jon Alter
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration