Go Premium for a chance to win a PS4. Enter to Win

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 466
  • Last Modified:

How to make YouTube API Calls from GWT App

I need to integrate YouTube API into my GWT web application. I need to make YouTube API calls such as the following:

UPLOAD: https://developers.google.com/youtube/2.0/developers_guide_protocol_browser_based_uploading
CHECK STATUS: https://developers.google.com/youtube/2.0/developers_guide_protocol_checking_video_status
SET DEVELOPER TAGS: https://developers.google.com/youtube/2.0/developers_guide_protocol_uploading_videos

In order to circumvent browser's same origin restrictions, the calls have to be CORS calls.

How can I make these YouTube API calls from my GWT web application? A small code sample would be greatly appreciated.

Note that I have tried using YouTube Direct Lite, but it seems it doesn't allow setting developer tags, which is crucial for me.
1 Solution
Meir RivkinFull stack Software EngineerCommented:
AFAIK the gdata.youtube.com web servers hosts YouTube Data API supports CORS.
check here for sample code and some documentation:

bare in mind that CORS works using XMLHttpRequest interface which is not supported by all browsers.
check here for compatibility:
CORS browser compatibility

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now