Skip to content

Instantly share code, notes, and snippets.

@henryboldi
Created May 9, 2014 21:34
Show Gist options
  • Save henryboldi/5763d41ae3067ab7434a to your computer and use it in GitHub Desktop.
Save henryboldi/5763d41ae3067ab7434a to your computer and use it in GitHub Desktop.
//send to be encoded by zencoder
client.Job.create({input: url, "outputs": [
{
"url": "s3://" + bucketName + "/" + key + ".webm",
"label": "webm",
"format": "webm"
}, "thumbnails": [{
"label": "first",
"number": 1
}]
],
"notifications": [{
"url": "http://hackerbracket.com/hacks/isEncoded/" + key
}]
}, function(err, data) {
console.log(data);
Hacks.create({ title: req.body.title, description: req.body.description, technologies: req.body.technologies, image: url, owner: req.session.User.id, key: key }).exec(function (err, hack) {
if (err) {
console.log(err);
// req.session.flash = {
// err: err
// };
return res.json(err);
}
res.redirect('/'+req.session.User.username);
});
}); // end zencoder encoding fucntion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment