Rahul Chidgopkar
Posts: 0
Joined: Tue May 14, 2013 7:11 am

Record video and upload to database

I'm creating an app which records video and uploads it to a database. But the camera component launches in photo mode by default. Is there any detailed tutorial explaining video recording?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Record video and upload to database

Hello! You have to use cordova plugin capture. It's available in app by defaul, so no need to install it through Eclipse. Here is more information on how to configure it http://cordova.apache.org/docs/en/2.4...

Rahul Chidgopkar
Posts: 0
Joined: Tue May 14, 2013 7:11 am

Record video and upload to database

Thanks for the super quick reply. However, I'm totally new to app development and coding in general. The best thing about Appery is I have been able to get a lot done without coding. Could you please give me some guidelines as to which files I have to put this code in and how to invoke it?
I broadly know that it is some sort of Javascript code so I have to put it in a JS file, but which JS file and how to call it is something I'm unsure of.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Record video and upload to database

1) In app settings on Android permissions tab check RECORD_AUDIO and WRITE_EXTERNAL_STORAGE;
2) on page add button, on button Click event run JS:
codevar captureSuccess = function(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles&#46;length; i < len; i += 1) {
path = mediaFiles&#46;fullPath;
alert(path);
&#47;&#47; do something interesting with the file
}
};
&#47;&#47; capture error callback
var captureError = function(error) {
navigator&#46;notification&#46;alert('Error code: ' + error&#46;code, null, 'Capture Error');
};
&#47;&#47; start video capture
navigator&#46;device&#46;capture&#46;captureVideo(captureSuccess, captureError, {limit:1});/code

After video recording is finished, you'll return back to the app and see an alert with file name.

benjamin.atkinson
Posts: 0
Joined: Wed Jul 03, 2013 5:44 pm

Record video and upload to database

Hi, Marina.

Thanks for this tip. I followed your instructions.

I'm not getting the camera to come up when I test the button. Will the js work in the test environment? I tried on the phone and the browser.

Thanks - Ben

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Record video and upload to database

Hi Benjamin,

No, you should build APK or IPA binary and install it on device.

benjamin.atkinson
Posts: 0
Joined: Wed Jul 03, 2013 5:44 pm

Record video and upload to database

Thank you, Katya.

Esau Romano
Posts: 0
Joined: Sun Jun 02, 2013 7:03 pm

Record video and upload to database

what about the upload part of this post?

Esau Romano
Posts: 0
Joined: Sun Jun 02, 2013 7:03 pm

Record video and upload to database

Hello Miss Brodina:

isn't there a way to transform it in to a string an upload it to appery backend or any mongodb?

Return to “Issues”