It is a BAD IDEA to put your Zencoder API key in plain text inside of JavaScript. Just to repeat that one more time, do not use this in code that other people could possibly access. Nothing would stop people from taking your API key and encoding all the video they wanted.
The implication is that I couldn't therefore put this code in any internet-facing webpages.
Which leads me to wonder what the use-cases are for this implementation ?