Search code examples
androidcordovafile-uploadvideo-capture

Limit video dimension/size when recording video in PhoneGap app on android


I am developing a web app based on Phonegap with the feature of recording and uploading images and videos. Since videos tend to be quite large in standard resolutions, this feature is only helpful, when I am able to manage to scale down the file size (either at time of recording or afterwards).

On iOS 6 I have managed to do this by using the newly introduced <input type="file">. Thus the recorded video is automatically compressed, so that a 30 sec. video gets about 3 MB of file size, which is quite okay.

In Android this is not done (well, currently I could not even manage to get the input of type file working on Android 2.3). Since the size limitation in the Phonegap API is not supported by Android, and I did not find a plugin that is capable of doing this, I have no idea on how to solve this task.

Are there any ideas out there on how to do that?


Solution

  • <input type="file"/> 
    

    is not supported in the Android WebView. We are going to check in some preliminary support for this feature in 2.4.0. It won't do the compression like iOS though.

    I believe you'd need to write a plugin to compress your video.