Why recorded video is not shown in my app's photogallery?
Hello,
We are developing one app. in which we have the functionality of recording and saving video into photogallery, then that video will be uploaded to server. We have the same code as in kitchen sink to record, save and upload video to server. But problem is that when we record a video and save it to photo gallery using Titanium.Media.saveToPhotoGallery(video); that video was not found in app's photo gallery. why that was happened?
Waiting for feedback.
My code is same as used in kitchensink to record video and save it to photo gallery.
Titanium.Media.showCamera({
success:function(event)
{
var video = event.media;
var thumbnail = event.thumbnail;
Titanium.Media.saveToPhotoGallery(video);
Titanium.UI.createAlertDialog({title:'Photo Gallery',message:'Now Choose your video from your gallery'}).show();
Titanium.App.fireEvent("openphotogal");
},
cancel:function()
{
},
error:function(error)
{
// create alert
var a = Titanium.UI.createAlertDialog({title:'Video'});
// set message
if (error.code == Titanium.Media.NO_VIDEO)
{
a.setMessage('Device does not have video recording capabilities');
}
else
{
a.setMessage('Unexpected error:' + error.code);
}
// show alert
a.show();
},
mediaTypes:Titanium.Media.MEDIA_TYPE_VIDEO,
videoMaximumDuration:60000,
videoQuality:Titanium.Media.QUALITY_HIGH
});
3 Answers
-
I'm experiencing a similar problem. Basically, changes to the photo gallery don't appear during a single instance of my app running on the iPhone. It's as if the Titanium layer is caching the results of its first view requested of the photo gallery.
-
Firstly, the video recording functionality will never return a thumbnail. (same goes for picking a video from your gallery)
Secondly, if you are using the Ti.Media.openPhotoGallery to open the gallery and choose something, make sure you add
mediaTypes: [Titanium.Media.MEDIA_TYPE_VIDEO, Titanium.Media.MEDIA_TYPE_PHOTO]
in your code when you open it. -
Also im looking for the solution, i need upload videos and photos from the gallery but i dont know how.. =/