Limit Video size on capture video


#1

Hello, I am currently developing Android App.

Any idea on how to limit the size of video while capturing an video? @mhartington


#2

Check out cordova’s media capture plugin

http://plugins.cordova.io/#/package/org.apache.cordova.media-capture

Specifically the part about CaptureVideoOptions.limit


#3

But CaptureVideoOptions.limit doesnt restrict size of file. Is that correct? It only restricts number of clips.

Correct me if I am wrong.


#4

Seems to be only the number of clips. Doesn’t look like it’s going to be possible to limit the recording by file size right out of the box. You may need to do some custom code and logic for that


#5

Thank You. I thought same. Just confirming the same.

Also, one more question, I need to provide ability to user to select any video file in device.

For Pictures, we use the option Camera.PictureSourceType.PHOTOLIBRARY.

Like that, is there any option like this to populate only videos?

Thanks.


#6

May be you can use regexp to match a pattern of video file extensions.


#7

@siddhartha, you mean to write code to get list of video file and populate it?
If so, That is the only alternate way.

Before doing that Just like to know, is there any way to get all videos from gallery? Just how we populate all pictures from gallery using Camera.PictureSourceType.PHOTOLIBRARY.

@mhartington - any input on this please?
Thanks.


#8

Not too sure to be honest. I’ve never used the plugin so I’m not really an authority on it. But @siddhartha’s suggestion sounds like it might be the best approach for now


#9

Even I have never used the MediaCapture plugin. I was just offering a suggestion. Do what suits you and your app the best.