Project: titanium
Issue TIMOB-23699: iOS Media.showCamera "Temp" file issue
h6. 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. h6. Steps to reproduce # Create a new classic app project # Replace the code inside app.js to the next one {code} //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(); {code} # Run # Record a video # Check the app size h6. Expected results App should flush the videos if they are not longer used after the app is killed
Story points: 2