Created
May 9, 2014 21:34
-
-
Save henryboldi/5763d41ae3067ab7434a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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