showCamera can only take PHOTO but no VIDEO
Hi,I've got a problem while using "Titanium.Media.showCamera"
here's the code:
Titanium.Media.showCamera({
success: function(event){
var video = event.media;
movieFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'mymovie.mov');
movieFile.write(video);
},
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);
}
a.show();
},
mediaTypes: Titanium.Media.MEDIA_TYPE_VIDEO,
videoMaximumDuration:10000,
videoQuality:Titanium.Media.QUALITY_HIGH
});
I can still using my camera to take Picture but no Video,and the "mediaTypes" has been set to "Titanium.Media.MEDIA_TYPE_VIDEO"
why and what can i do to take video?
1 Answer
-
Check out the file "camera_video.js" in the Resources/examples folder of the latest Kitchen Sink code. It contains a fairly complete working example of the code. There is a lot of un-documented or incomplete code in this area of functionality, even up to version 1.7.2 of the SDK.