Video Gallery
Hi , i would like to know if it is possible to get a video gallery for my application because it seems that the only gallery possible to implement is the photogallery
What can i do to display videos and then choose a video like the photogallery?
6 Answers
-
If you want to just enable the choosing of videos from the built-in gallery picker, add
mediaTypes: [Titanium.Media.MEDIA_TYPE_VIDEO]
when you call Ti.Media.openPhotoGallery - then it will only show the videos in the gallery. -
Hey Jimmy,
did you manage to do it on Android?
The solution Kosso suggested only works on iOS.My best regards!
-
It would like to upload videos after choosing or capturing. It is possible 2 months later? Please can i have a clear answer to know if i have to give up Titanium or not because it's very urgent.
Thanks
-
It would like to upload videos after choosing or capturing. It is possible 2 months later? Please can i have a clear answer to know if i have to give up Titanium or not because it's very urgent.
Thanks
-
if (Ti.Platform.osname == 'android') { var intent = Titanium.Android.createIntent({ action : Ti.Android.ACTION_PICK, type : "video/*" }); //android.media.action.VIDEO_CAPTURE intent.addCategory(Ti.Android.CATEGORY_DEFAULT); self.activity.startActivityForResult(intent, function(e) { if (e.error) { Ti.UI.createNotification({ duration : Ti.UI.NOTIFICATION_DURATION_SHORT, message : 'Error: ' + e.error }).show(); } else { if (e.resultCode === Titanium.Android.RESULT_OK) { videoFile = e.intent.data; var source = Ti.Filesystem.getFile(videoFile); movieFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, 'mymovie.3gp'); source.copy(movieFile.nativePath); videoFile = movieFile.nativePath; scene_picker(source); } else { Ti.UI.createNotification({ duration : Ti.UI.NOTIFICATION_DURATION_SHORT, message : 'Canceled!' }).show(); } } }); }
-
I am also still not able to view the video in the photogallary. Is there any solution. The code i have used is as below.
Titanium.Media.openPhotoGallery({
success : function(event) {
Ti.API.debug('Our type was: ' + event.mediaType);
if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO || Ti.Media.MEDIA_TYPE_VIDEO) {
UploadPhotoToServer(event.media);
}
},
cancel : function() {
},
error : function(err) {
Ti.API.error(err);
},
mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_VIDEO]
});