Friday, October 24, 2008

AS3 + You(Tube)

Posted by Jeff Fisher, YouTube APIs and Tools Team

We now have a demo of the YouTube Chromeless Player working from within ActionScript 3. Even better, this demo is part of an open source project on Google Code. Best of all, there is an article about the sample that explains how the sample is constructed.

This is something we've been wanting to provide for a while, and the YouTube API team greatly appreciates the work of developer Matthew Richmond of The Chopping Block for making it happen. Thanks Matthew!

Thursday, October 23, 2008

Java Support for V2

Posted by Jeff Fisher, YouTube APIs and Tools Team


The Java Client Library has been updated to support V2 of the YouTube API in its latest release. The Migration Guide has been updated with guidance on how to update your Java code. Just check the "Java" option at the top of the page.

If you encounter any issues upgrading to V2, come join us in the forum.

Monday, October 20, 2008

Ch-ch-ch-changes: Versioning + Geo-Search

Posted by Jeff Fisher, YouTube APIs and Tools Team

This release introduces the concept of API versioning. This allows us to make breaking changes to the API that you can enable in your applications when you are ready. The list of protocol changes are documented in our Migration Guide. V2 brings us in line with the AtomPub specification. Stay tuned for more information about how V2 affects all Google Data APIs on the Data APIs blog.

As promised in the title of this post, the Geo-based search feature requested by Issue 200 has been released using the location and location-radius parameters.

Other issues this release resolves:
  • Issue 110 - Retrieve time a favorite was added
  • Issue 599 - Return deleted videos in private favorites/etc feed.
  • Issue 579 - Restricting search to partner videos
  • Issue 808 - Expose bare VideoID in XML

We encourage you to migrate to V2 as soon as you can to take advantage of these exciting features. Note that we will no longer be adding new features to V1.

For a complete list of our documentation changes, view the Revision History of our documentation.

Sunday, October 19, 2008

Mashup Roundup

Posted by Stephanie Liu, YouTube APIs and Tools Team

We've seen some cool implementations in the past few weeks, and wanted to share some of them with you. 



Jim Bumgardner recently migrated Coverpop, a cool photo-mosaic app, off of the Legacy API to use the YouTube Data API.








280Slides - A great web-based presentation creator with easy YouTube integration to add videos to your presentations. 





ViralorSpiral - An interesting "hot or not" style of viral video prediction. It uses YouTube authentication for its accounts!




If you haven't seen these YouTube-specific implementations of the popular Imageflow project, here are some neat tools you can add onto your own site. 




As a downloadable PHP script: http://www.imageflow.nl/






As an easily embeddable Google Gadget: http://youtubeflow.blogspot.com/


If you've created or have seen cool YouTube mashups, let us know in the forum!

Tuesday, September 30, 2008

Spotlight on: WatchToLearnChinese.com

Posted by Stephanie Liu, YouTube APIs and Tools Team

A common way to use the YouTube API is to make a niche site -- YouTube isn't necessarily built to be a destination site for iguana lovers, or antique car racers, or people looking to learn Mandarin. Developers can use the API to create a rich supporting feature set for these communities. It's great to come across sites like this that are done well, so when I saw WatchToLearnChinese.com, I asked one of the creators, Philipp Lenssen, editor of Google Blogoscoped, to tell us more about the site. (I was also excited because it was a good way for me to brush up on my rusty Mandarin in time for a trip to Beijing!)

Tell us about WatchToLearnChinese.com.
We recently launched Watch to Learn Chinese, a site presenting over 500 Mandarin learning videos (as well as some Mandarin videos in general for advanced learners). We noticed so many great material already existing on YouTube that we wanted to utilize the YouTube API to bring it all on a site with special notes in Pinyin, that transliteration of Chinese using the Latin alphabet. After scouring hundreds of videos and sorting them into three difficulty levels, and assigning ratings specifically looking out for usefulness to learners, we opened the doors to present this as a free learning tool. While we don't want to and can't replace a Chinese teacher or learning books, we're hoping this can serve as additional material accompanying learning courses.

Beyond the videos, we've also added a game that mixes images (drawn ones, and Creative Commons-licensed photos), sounds, and text. My Chinese partner on this project had spoken a great deal of sentences into the microphone and I edited the sound into many little pieces to be used for the game (using the free Audacity editor). For the translations of the many words and sentences, we hired a translation company -- you provide them with a Word file or similar document, select your source and target language, and after some days, you can download the translated document (we've used Click2Translate.com, but you may also find another service you prefer). It might have been the first time that translation company was ever faced with the task of not only translating into Chinese, but also into accentuated Pinyin!

On that note, we've also added a YouTube channel with learning videos of our own.

Why did you decide to use the Chromeless Player instead of just embedding YouTube content the regular way?
There were several reasons for this. For one thing, we wanted to completely customize the player -- including every last button, video buffer indicator, color and so on. (Inspiration for this approach came from TotLol.com, a YouTube API-based site for parents and their toddlers which I had reviewed as part of Blogoscoped.com, a news blog on Google topics.) Another feature of the YouTube API that came in very useful was that we were able to assign a start and end time for the core lesson of a video. Imagine you want to watch a series of 10 videos by the same presenter -- wouldn't it be nice to not always watch the 20 seconds intro, but skip right to the lesson material? (And if you do want to learn more about the presenter after the lesson, we grouped their other videos on our site and also link to their homepage, if we found one.)

Tell us a little more about the backend. Do you have any lessons learned for everyone at home?
To let you find videos on the site, we set up a little PHP/MySQL engine which searches through video title and description. To optimize this process, we do some behind-the-scenes routines to check for "fuzzy" Pinyin matches. This is one example where you can build on existing videos but then add value by offering features specialized to that content. For instance, take the Chinese Pinyin word "wǒ mén", which means "we"; it was important that searchers should be able to enter this as "wǒ mén", "wǒmén", "women" and so on, and still find a match.

To manage video additions, we created a little private form where you input the YouTube URL, a title, a description, rating, type of learning course and so on. Once the form is submitted, the program will check for existing videos on the site to avoid duplicates, and then pulls the video thumbnail to store on our server. Now, a routine server-scheduled job (the Apache Cronjob) will check if the video still exists on YouTube, in case someone made it private, or disallowed embedding, or something else happened with it. When a problem is found we can see this in the management console and decide how to handle this problem, like by removing the video or looking for a replacement. Lesson learned: be conservative when you do the checking of availability and don't immediately hide display of videos on your site were you may suspect a problem. Thanks to an overzealous early version of our availability checker, which may have stumbled upon a changed HTML tag or similar on YouTube, WatchToLearnChinese.com was completely empty one morning... because all videos had been incorrectly flagged as unavailable by us!

And now, we're hoping for happy visitors to the site, and ponder ways of growing it in the future. It was certainly a lot of fun so far.

Thanks, Philipp! Check out the docs for more info about the Chromeless Player, the the JavaScript Player API, and the Data API.

YouTube API Support in Drupal

Posted by Jochen Hartmann, YouTube APIs and Tools Team

Before coming to Google, I spent a good amount of time working with Drupal, the popular, open-source content management platform written in PHP. So when I heard that Brad Bowman of aten design group was working on the integration with the YouTube Data API, I was really excited.

Drupal is easily extended via third-party modules that interact both with the core Drupal API and with other third-party modules. Brad's youtube_api module is more of a low-level infrastructure component that allows other modules to interact with the YouTube Data API.

By integrating this module into your site, you can easily perform YouTube uploads in your own code by adding calls like this:
// Build an XML string with the correct video meta-data
$xml_string = youtube_api_create_xml('xml_tester', $xml);

// Use the YouTube API module to perform the video upload
$result = youtube_api_video_upload($xml_string,
$node->files['upload_0']->filepath, $node->files['upload_0']->filename);
The module currently works for Drupal 5 and a live version of it can be seen at
icitizenforum.com. A Drupal 6 release is planned for the near future.

Thursday, September 25, 2008

PHP: Check Yourself, Before You Wreck Yourself

Posted by Jochen Hartmann, YouTube APIs and Tools Team

If you are just getting started with our PHP Client Library and would like to verify that your installation is correct, you can now use a new tool to do so. I have just checked in the first version into the repository at the Zend Framework site.

The tool can run either from the command line or on your server. It verifies that:
  • PHP has been compiled with the correct extensions
  • the Zend Framework is installed and accessible
  • SSL is enabled and that you can access the YouTube Data API
The sample output below shows the results of a successful installation:

jhartmann@mybox:~$ php VerificationChecker.php
== Ran PHP Verification using CLI ==
PHP Extension Errors -- No errors found
Zend Framework Installation Errors -- No errors found
SSL Capabilities Errors -- No errors found
YouTube API Connectivity Errors -- No errors found