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

iOS: Add "allowTranscoding" option to Ti.Media.openPhotoGallery()

    Details

    • Story Points:
      5
    • Sprint:
      2019 Sprint 10

      Description

      Summary:
      When selecting a video from the gallery, iOS will transcode/convert the selected video by default and return the newly formatted video instead. This can cause a very long delay if the video is large.

      Solution:
      Add an iOS-only "allowTranscoding" option for our Ti.Media.openPhotoGallery() method, when set false, will return the selected video as-is without transcoding it. This will solve the long delay issue.

      Ti.Media.openPhotoGallery({
      	allowTranscoding: false,
      	mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],
      	success: function(e) {
      		// Got it.
      	},
      });
      

      Note:
      There is no equivalent to this on Android, which always returns a reference to the video as-is. So, this is an iOS only feature.

      Native Implementation Details:
      Add this code at line 1746. I can provide a PR

      if ([TiUtils isIOS11OrGreater]) {
            BOOL disableVideoCompression = [TiUtils boolValue:@"disableVideoCompression" properties:args def:NO];
            if (disableVideoCompression) {
              picker.videoExportPreset = AVAssetExportPresetPassthrough;
            }
          }
          [self displayModalPicker:picker settings:args];
      

        Attachments

          Activity

            People

            • Assignee:
              vijaysingh Vijay Singh
              Reporter:
              rlustemberg Richard Lustemberg
              Reviewer:
              Vijay Singh
              Tester:
              Samir Mohammed
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code