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

iOS: Edited videos are not saved to photo gallery

    Details

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

      MacOS 10.12 (16A323)
      Studio 4.7.1.201609100950
      Ti SDK 6.0.0.v20160921004951
      Appc NPM 4.2.7
      Appc CLI 6.0.0-7
      Alloy 1.9.1
      Xcode 8.0 (8A218a)

    • Story Points:
      5

      Description

      If a recorded video is edited (by changing/dragging the start or end points) then the video is not saved to the photo gallery, even though saveToPhotoGallery is true.

      Steps to reproduce issue
      1. Create a new project and use the code below
      2. Build the project for an iOS device
      3. Click Open Camera
      4. Record a video
      5. Edit the start or end points of the video by dragging the bars at the edges of the timeline at the top of the screen
      6. Click Use Video
      7. Go the device's photo gallery

      Expected Results
      The edited video is present, as per our docs:

      saveToPhotoGallery (boolean) whether modified media should be saved back to the gallery, generally only useful with allowEditing=true

      Actual Results
      The edited video is not present

      Notes
      If you do not edit the video, it is correctly saved to the photo gallery
      If on iOS 10 you need to add these keys to your tiapp.xml:

      <key>NSCameraUsageDescription</key>
      <string>Can we use your camera?</string>
      <key>NSMicrophoneUsageDescription</key>
      <string>Can we use your microphone?</string>
      <key>NSPhotoLibraryUsageDescription</key>
      <string>Can we save to your library?</string>
      

      Code

      var win = Titanium.UI.createWindow({
          backgroundColor: "#FFFFFF"
      });
       
      var button = Titanium.UI.createButton({
          title: "Open camera"
      });
       
      button.addEventListener("click", function(e) {
          if (!Ti.Media.hasCameraPermissions()) {
              Ti.Media.requestCameraPermissions(takeVideo);
          } else {
              takeVideo();
          }
      });
       
      win.add(button);
      win.open();
       
      function takeVideo() {
          Ti.Media.showCamera({
              success: function(e) {
                  Ti.API.info("Video captured successfully!");
              },
              error: function(e) {
                  alert("There was an error");
              },
              cancel: function(e) {
                  alert("The event was cancelled");
              },
              allowEditing: true,
              saveToPhotoGallery: true,
              mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],
              videoQuality: Ti.Media.QUALITY_HIGH
          });
      }
      

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              ewieber Eric Wieber
              Reviewer:
              Chee Kiat Ng (Inactive)
              Tester:
              Harry Bryant
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code