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

iOS Media.showCamera "Temp" file issue

    Details

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

      iOS 9.3
      Xcode 7.2
      Appcelerator SDK 5.3.1

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

      Description

      Issue Description

      Video is recorded and saved to the "Photos" app successfully, but it apparently is also saved in the "applicationDataDirectory". Looking at the physical iPhone > Settings > Usage > Storage, the size of the app increase the exact same amount of the video that was just recorded. After capture more videos, the app is bigger.

      Steps to reproduce
      1. Create a new classic app project
      2. Replace the code inside app.js to the next one

        //Camera Issue with temp storage case#00010479
        var win = Titanium.UI.createWindow({
            title:"Using the Camera and Video",
            backgroundColor:"#FFFFFF"
        });
         
        var button = Titanium.UI.createButton({
            title:"Use camera",
            width:180,
            height:48,
            bottom: 12,
            zIndex:2
        });
         
        button.addEventListener("click", function(e){
            //Open the photo gallery
            Titanium.Media.showCamera({
                //function to call upon successful load of the gallery
                success:function(e){
                    if(e.mediaType === Titanium.Media.MEDIA_TYPE_PHOTO){
                        //e.media represents the photo or video
                        var imageView = Titanium.UI.createImageView({
                            image:e.media,
                            width:320,
                            height:480,
                            top:12,
                            zIndex:1
                        });
                        win.add(imageView);
                    }else if(e.mediaType === Titanium.Media.MEDIA_TYPE_VIDEO){
         
                        var w = Titanium.UI.createWindow({
                            title:"New Video",
                            backgroundColor:"#000000"
                        });
         
                        var videoPlayer = Titanium.Media.createVideoPlayer({
                            media:e.media,
                            backgroundColor:"#FFFFFF",
                        
                        });
         
                        w.add(videoPlayer);
         
                        videoPlayer.addEventListener("complete", function(e){
                            w.remove(videoPlayer);
                            videoPlayer = null;
                            w.close();
                        });
         
                        w.open({modal:true});
                    }
         
                },
                error:function(e){
                    alert("There was an error");
                },
                cancel:function(e){
                    alert("The event was cancelled");
                },
                //Allow editing of media before success
                allowEditing:true,
                saveToPhotoGallery:true,
                //Media types to allow
                mediaTypes:[Titanium.Media.MEDIA_TYPE_PHOTO,Titanium.Media.MEDIA_TYPE_VIDEO],
                //The other is Titanium.Media.MEDIA_TYPE_VIDEO,
                //If recording video, you can set the quality to record at
                videoQuality:Titanium.Media.QUALITY_HIGH
                /*other possible values for this property are
                 * Titanium.Media.QUALITY_MEDIUM
                 * Titanium.Media.QUALITY_LOW
                 */
            });
        });
         
        Titanium.App.addEventListener('camera_button', function(){
            Titanium.Media.takePicture();
        });
         
        win.add(button);
         
        win.open();
        
        

      3. Run
      4. Record a video
      5. Check the app size
      Expected results

      App should flush the videos if they are not longer used after the app is killed

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              rramirez Ricardo Ramirez
              Reviewer:
              Angel Petkov
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code