I'm working on a web app, trying to enable sharing a video on Youtube, essentially adding an "Upload to youtube" button. I'm trying to use the Youtube Data API for JavaScript, following this example https://developers.google.com/youtube/v3/code_samples/javascript#upload_video.
My code is the same as in the example. All was going well until I got an error "MediaUploader is not defined" from this line of code:
var uploader = new MediaUploader({
The MediaUploader class doesn't seem to be defined anywhere in the example code.
I've searched far and wide through Google API docs and JS ref, but the only mention of a MediaUploader class I found is in the context of WordPress, PHP or Python.
Please help - what is MediaUploader in the context of JavaScript/Google API and where can I find documentation on it?
Ok, got back to this task & finally found the answer. The MediaUploader class is defined in https://github.com/youtube/api-samples/blob/master/javascript/cors_upload.js.
Dear Google/Youtube docs maintenance people, if you ever read this please add this code sample to the official docs on resumable upload using JavaScript! It will save a world of pain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With