Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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
});

— asked June 11th 2010 by vikas khairnar
  • photogallery
0 Comments

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.

    — answered June 13th 2010 by David Geller
    permalink
    0 Comments
  • 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.

    — answered June 13th 2010 by Kosso
    permalink
    1 Comment
    • I have the same problem on Android. Even if I add the mediatypes… I can only pick photos. I'm testing on a device.

      — commented October 13th 2011 by Tommy Skott
  • Also im looking for the solution, i need upload videos and photos from the gallery but i dont know how.. =/

    — answered November 2nd 2012 by Mauricio Stand
    permalink
    1 Comment
    • Has anyone EVER got the answer to this problem? It works fine on iOS for SKD 2.1 and above, but it never runs on Android. Infact, video camera is also not shown. It would really help if someone from appcelerator commented on this!

      — commented April 4th 2013 by Shalvika Sood
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.