Page 1 of 2

Record video and upload to database

Posted: Thu May 23, 2013 9:33 am
by Rahul Chidgopkar

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?


Record video and upload to database

Posted: Thu May 23, 2013 11:19 am
by Maryna Brodina

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...


Record video and upload to database

Posted: Thu May 23, 2013 11:47 am
by Rahul Chidgopkar

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.


Record video and upload to database

Posted: Thu May 23, 2013 12:40 pm
by Maryna Brodina

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.


Record video and upload to database

Posted: Wed Jul 03, 2013 5:44 pm
by benjamin.atkinson

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


Record video and upload to database

Posted: Wed Jul 03, 2013 7:58 pm
by Kateryna Grynko

Hi Benjamin,

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


Record video and upload to database

Posted: Fri Jul 05, 2013 6:14 pm
by benjamin.atkinson

Thank you, Katya.


Record video and upload to database

Posted: Fri Aug 02, 2013 3:57 am
by Esau Romano

what about the upload part of this post?


Record video and upload to database

Posted: Fri Aug 02, 2013 10:51 am
by Maryna Brodina

Record video and upload to database

Posted: Fri Aug 02, 2013 2:02 pm
by Esau Romano

Hello Miss Brodina:

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