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

Windows: Ti.Media.takePicture usage does not include videosLibrary capability

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: Release 6.0.0
    • Fix Version/s: Release 6.0.0
    • Component/s: Windows
    • Labels:
    • Environment:

      OS: Microsoft Windows 10 Pro 10.0.14393
      Appc core: 6.0.0-38
      Appc NPM: 4.2.8-6
      Ti SDK: 6.0.0.v20160904203840

    • Story Points:
      2
    • Sprint:
      2016 Sprint 19 SDK

      Description

      Description

      When using the code below and not adding the videosLibrary capability, when the picture is taken the app will crash. If the videosLibrary capability is added then it will work as expected. From testing it appears that the generation of used capabilities by the CLI does not add the videosLibrary capability.

      var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' }),
          openButton = Ti.UI.createButton({ title: 'OPEN CAMERA', backgroundColor: 'blue' }),
          imageView = Ti.UI.createImageView({ width: Ti.UI.FILL, height: '70%' });
       
      var overlay = Ti.UI.createView({
          layout: 'vertical',
          height: '20%', width: Ti.UI.FILL,
          bottom: 0
      }),
      takeButton = Ti.UI.createButton({ title: 'TAKE A PHOTO', backgroundColor: 'red' }),
      hideButton = Ti.UI.createButton({ title: 'HIDE PREVIEW', backgroundColor: 'red' });
       
      takeButton.addEventListener('click', function () {
          Ti.Media.takePicture();
      });
      hideButton.addEventListener('click', function () {
          Ti.Media.hideCamera();
      });
      overlay.add(takeButton);
      overlay.add(hideButton);
       
      openButton.addEventListener('click', function () {
          Ti.Media.showCamera({
              whichCamera: Titanium.Media.CAMERA_FRONT, // Titanium.Media.CAMERA_REAR
              mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
              overlay: overlay,
              success: function (e) {
                  Ti.API.info('showCamera() success');
              },
              error: function (e) {
                  alert('showCamera() error: ' + JSON.stringify(e));
              }
          });
      });
       
      win.add(openButton);
      win.add(imageView);
      win.open();
      

      Steps to reproduce
      1. Add the code above to an existing app.js
      2. Build for a device
      3. Click OPEN CAMERA
      4. Click TAKE PHOTO
      Actual result

      The app will crash as the videosLibrary is not included

      Expected result

      App should not crash, correct capabilities should be added

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                eharris Ewan Harris
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code