Uploading a file using the Youtube Youtube JavaScript - MediaUploader not defined

I am working on a web application trying to allow video sharing on Youtube, essentially adding a “Upload to youtube” button. I am 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. Everything went fine until I received the error message "MediaUploader is not defined" from this line of code:

var uploader = new MediaUploader({

The MediaUploader class does not seem to be defined anywhere in the sample code.

I searched all over the world for Google API and JS ref documents, but the only mention of the MediaUploader class that I found was for WordPress, PHP, or Python.

Please help - what is MediaUploader in the context of the Google JavaScript / API and where can I find the documentation on it?

+4
source share
1 answer

Well, I returned to this task and 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 documentation service users, if you have ever read this, please add this sample code to the official renewable download documents using JavaScript! It will save the world of pain.

+13
source

All Articles