Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15883] iOS: Ti.Media.openPhotoGallery() does not obey videoQuality parameter

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2016-08-31T19:23:04.000+0000
Affected Version/sRelease 3.1.3
Fix Version/sRelease 6.0.0
ComponentsiOS
LabelsCommunity
ReporterBitfabrikken - Dan Wulff Kronholm
AssigneeHans Knöchel
Created2013-11-28T11:46:24.000+0000
Updated2016-09-22T17:59:42.000+0000

Description

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)

Comments

  1. Hans Knöchel 2016-08-31

    This issue has just been fixed in TIMOB-23847, thanks!
  2. Eric Wieber 2016-09-22

    Closing as duplicated ticket is resolved.

JSON Source