I am developing a Cordova application and using PouchDB as database, which, when connection is available, replicates all the information to CouchDB. I am successfully storing simple text and image. I have been trying to store also video and audio, without luck.
The way I store the data is:
var emo = {
_id: timestamp,
user: uuid,
location: curLatLng,
_attachments:
{
"image.jpg":
{
content_type:"image\/jpeg",
data: image
},
"video.mp4":
{
content_type:"video\/mp4",
data: video
}
}
};
db.put(emo, function callback(err, result) {
if (!err) {
//console.log('Successfully posted a todo!');
}
});
I created the "video" more or less in the following way: Cordova - Capture video and retrieve base64 data
So, at the end its format is blob.
First of all I am not sure if storing audio/video in PouchDB is possible. If it is possible, are you able to spot what I am doing wrong? Should I follow a different approach?
Thanks a lot for your time!