Problem Description
Calling Ti.Media.openPhotoGallery with the videoQuality parameter set to Ti.Media.QUALITY_HIGH, has no effect. It's ignored completely - video of medium quality is inserted.
A message is also shown - "Compressing..." - in the picker, when in fact it should just be straight up inserting the video, not compressing it to medium quality.
Steps to reproduce
1. Create a new mobile project
2. Add this testcase to app.js:
var win = Ti.UI.createWindow();
win.open();
var view = Ti.UI.createView();
win.add(view);
var button = Ti.UI.createButton({
left: 100,
style: 0,
title: "Record video",
});
button.addEventListener('click',function(){
Ti.Media.showCamera({
mediaTypes: Titanium.Media.MEDIA_TYPE_VIDEO,
videoMaximumDuration: 10000,
videoQuality: Titanium.Media.QUALITY_HIGH,
saveToPhotoGallery: true,
allowEditing: false,
success:function(e){
alert("video recorded and saved to path: "+e.media.nativePath+" size in bytes: "+e.media.size);
//apparantly the above 'saveToPhotoGallery' is not obeyed, so we manually call saveToPhotoGallery
Ti.Media.saveToPhotoGallery(e.media,{
success: function(evt) {
alert("video saved to gallery at "+evt.path);
},
error: function(e) {
alert("fail to save video to gallery");
}
});
},
error:function(error){alert("error: "+error);}
});
});
view.add(button);
var button = Ti.UI.createButton({
right: 100,
style: 0,
title: "Pick video from camera roll",
});
button.addEventListener('click',function(){
Ti.Media.openPhotoGallery({
mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO],
videoMaximumDuration: 10000,
videoQuality: Titanium.Media.QUALITY_HIGH,
allowEditing: false,
success: function(e) {
alert("video picked, path: "+e.media.nativePath+" size in bytes: "+e.media.size);
},
error: function(error) {alert("error: "+error);}
});
});
view.add(button);
3. Run it in iOS
4. Check the log
Extra information
For detailed information and a complete code sample to test, see my Q&A here: (
http://developer.appcelerator.com/question/159904/recorded-video-vs-video-from-camera-roll-on-ios---recorded-videos-are-3-times-the-file-size)
Note: The documentation for
http://docs.appcelerator.com/titanium/latest/#!/api/PhotoGalleryOptionsType does NOT mentioned the videoQuality parameter, but it is defined in the source code (Line 480 here:
https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/MediaModule.m)
This issue has just been fixed in TIMOB-23847, thanks!
Closing as duplicated ticket is resolved.