Slave Jovanovski, an engineer at YouTube, has put together a Google Chrome extension that should be of interest to the YouTube API community. It’s called YouTube Feed, and after installing and authenticating with your YouTube account, it automatically will fetch your YouTube social activity stream (both subscriptions and friends’ actions) while you use Google Chrome. When a new event, like a YouTube friend uploading or commenting on a video, takes place, the extension will notify you and provide details on the activity, as well as links to view the actual video. You have control over which types of activities you’d like to be notified about, as well as how frequently you’d like the extension to check for updates.

While you’ll hopefully find the extension useful on its own merits, the fact that the source code has been released as part of an open source project means that the extension’s code can serve as inspiration (or a jumping off point) for writing your own JavaScript code that interacts with the YouTube API. Curious as to how to use OAuth to authenticate YouTube accounts from a Chrome Extension? Or request JSON data with a JavaScript callback? The answers await you in the source code!

Cheers,
–Jeff Posnick, YouTube API Team

The YouTube Players team’s goal is to make sure that watching videos online is as enjoyable an experience as possible. As a viewer, maximizing enjoyment usually involves some tradeoffs: sure, you can watch a 1080p high definition version of the newest movie trailer, but that might mean choppy playback as your computer strains to keep up with the more demanding processing required. We wanted to let you know about some changes we’re making to help minimize those tradeoffs, so that you can watch smoother, higher-quality video from your existing devices.

Adobe’s recently announced Flash Player 10.2 release supports a new, more efficient video display mechanism known as the Stage Video API. The full details of how and why Stage Video speeds up video display can be found in Adobe’s technical documentation. The Players Team will be gradually experimenting with Stage Video playbacks on YouTube.com in the coming weeks, but as a developer using the ActionScript 3 Player APIs, you can enable Stage Video playback for your embedded video right away; simply add the wmode=direct parameter to the player URL that you’re using to reference the YouTube video. You’ll need the Flash Player 10.2 installed to take advantage of the accelerated playback, but playbacks will work for users with older Flash Player versions as well.

The Players Team knows that Stage Video for Flash playbacks is just one path to take toward improving video playback performance across the web. For example, YouTube playbacks using the new <iframe> embeds will automatically benefit as more and more (and more) modern browsers add hardware acceleration for the native HTML5 <video> element.

Cheers,
-Jeff Posnick, on behalf of the YouTube Players team
(Updated 2011-02-09 to reflect the production release of Flash Player 10.2.)

The YouTube API’s standard feeds are a great way to expose your users to the best of what YouTube has to offer. To compliment the existing standard video feeds, which contain lists of individual videos that meet certain criteria (the top rated videos in the United States for the current day,
The YouTube API’s standard feeds are a great way to expose your users to the best of what YouTube has to offer. To compliment the existing standard video feeds, which contain lists of individual videos that meet certain criteria (the top rated videos in the United States for the current day, for instance), we’re happy to introduce a new set of standard channel feeds.

While standard video feeds contain lists of videos, standard channel feeds contain lists of channels, or user accounts. The two types of standard channel feeds are most_viewed and most_subscribed, and just like with video feeds you can narrow down your results even further with time, region, and category or user type parameters. For example, the URL for requesting the most viewed channels with videos related to music in Great Britain for the past week is http://gdata.youtube.com/feeds/api/channelstandardfeeds/GB/most_viewed/-/Music?v=2&time=this_week. Each entry in a standard channel feed provides detailed information about a specific YouTube channel, including a element with info on how many comments, videos, and views that channel has received.

Once you have these lists of channels, a natural next step would be to allow your logged-in users to subscribe to a given channel or view a list of videos uploaded in that channel.

Standard channel feeds are only available in version 2 of the YouTube API, which will soon be the default version in the production environment. In the meantime, be sure to explicitly specify that you want to use version 2 when making your YouTube API requests.

Cheers,
Jeff Posnick, YouTube API Team

We want to let the developer community know about a change to the officially supported URL for YouTube API ClientLogin requests. Previously, developers who wanted to obtain authentication credentials via a username and password had to send their ClientLogin request to https://www.google.com/youtube/accounts/ClientLogin. The new URL that we encourage all developers to use is https://www.google.com/accounts/ClientLogin. This new URL has been functional for a while, and is the same URL that other Google APIs use for ClientLogin requests. Switching YouTube API ClientLogin traffic to the standard URL ensures that developers across all of Google’s APIs will see standard behavior when logging users in.

All of the details regarding this switch as well as best practices for performing ClientLogin requests can be found in our YouTube API documentation. There is one specific change in behavior that is worth calling out: responses from the new ClientLogin URL will not include the YouTube username of the authenticated user, which the old URL’s responses did provide. We encourage developers to take advantage of the username default when constructing YouTube API request URLs, which always refers to the currently logged in user.

We have no immediate plans to disable the old ClientLogin URL, but we do encourage developers to update their code at their earliest convenience to point to the new URL. We will post again with further details if and when the legacy URL is turned off.

Cheers,
-Jeff Posnick, YouTube API Team

The ActionScript 3 Player APIs, both in the chromeless and embedded variety, have been available for use since last October. When we released the ActionScript 3 APIs, we announced the deprecation of the ActionScript 2 equivalents. As per our deprecation policy, we will keep the ActionScript 2 Player APIs running through October of 2012; however, we wanted to announce a change in the videos available for playback that will affect those still using the ActionScript 2 chromeless player.

As of early January, 2011, some videos that YouTube and our content partners would like to monetize will not be playable using the ActionScript 2 chromeless player because it does not have the ability to show ads. If you attempt to play back such a video, an onError event will be fired, as documented in the ActionScript 2 Player APIs reference guide. As a developer, you can handle this event and play an alternate video, or display an explanatory message to your users.

Please note that this change only affects playback in the ActionScript 2 chromeless player. If you are using the ActionScript 2 embedded player (i.e. the official YouTube player with built-in controls) or if you’ve already upgraded to one of the ActionScript 3 players, you can continue to play the same video content you can play today. Also note that you might be using the the ActionScript 2 chromeless player indirectly if you’re using a third-party custom video player to play back YouTube content. Please reach out to the provider of your custom video player if you’re not sure whether this change will affect you.

Cheers,
-Jeff Posnick, YouTube API Team

Update (February 2012): We're happy to report that PubSubHubbub functionality for YouTube feeds has been restored for the uploads, subscriptions, and favorites feed. When subscribing to a feed URL, be sure that the only URL parameter you include is v=2, e.g. http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads?v=2


Update (November 2011): As mentioned below, PubSubHubbub for YouTube feeds is currently inactive. The engineering team is investigating options for restoring functionality; more info will be posted following those investigations.


Update (October 2011): Unfortunately, we no longer support subscribing to YouTube user events via PubSubHubbub. We suggest using the Simple Update Protocol as an alternative.


PubSubHubbub, for those not in the know, is a server-to-server protocol for notifying interested parties of events they’re interested in. Notifications are pushed out to subscribers via HTTP web hooks, which offers efficiencies over polling-based solutions. With PubSubHubbub, your server finds out about events in near real-time, without having to determine the optimal polling interval or repeatedly fetch individual activity feeds that haven’t changed.


We’re happy to announce that it’s now possible to subscribe to three types of YouTube user events via PubSubHubbub: video uploads, new subscriptions, and video favorites. The subscription requests need to be made on a per-user basis, so you will only receive updates for specific users that you’re interested in.Your code can look for our PubSubHubbub hub address in the href attribute of the top-level <link rel='hub'> element in uploads, subscriptions, and favorites feeds. For example, the feed http://gdata.youtube.com/feeds/api/users/GoogleDevelopers/uploads?v=2 exposes the hub address in the <link rel='hub' href='http://pubsubhubbub.appspot.com'/> element.


More details on the PubSubHubbub can be found in the specification document. If you’d like your server to receive YouTube user event updates via PubSubHubbub, this list of libraries is a good place to start.


Cheers,
-Jeff Posnick, YouTube API Team, in conjunction with the PubSubHubbub Team



Update: article translations are now available in Chinese, Japanese, Korean, Portugese, Russian and Spanish ! Here are the links :
The importance of mobile applications in our day-to-day lives continues to grow. We can now do so many things with our phones that would have been impossible not too long ago. While watching videos on mobile devices has been popular for quite some time, mobile uploads to YouTube grew by 160% last year. Mobile application developers can take advantage of this growth by incorporating different types of functionality. Many interesting YouTube projects combine video capture, uploading, sharing and playback, with application logic executing both on the mobile device and in the cloud. With that in mind, we've compiled this article to help developers quickly get up to speed on what is involved in building one, please let us know what you think!


Update: article translations are now available in Chinese, Japanese, Korean, Portugese, Russian and Spanish ! Here are the links :


Thanks,
-Jarek Wilkiewicz, YouTube API Team

The YouTube Google Data API currently exists in two flavors: version 1 and version 2. If you’re not explicitly requesting version 2 of the API, then you’re using the default, version 1.

As we add new functionality to the API, it’s invariably added to version 2: features like partial responses/updates, extended access controls, captioning support, and YouTube Insight statistics are only available to developers accessing the newer release. We’ve kept version 1 running as-is for a while now, and will continue to do so for months to come, but we’re taking the first step to transition developers off of version 1 of the API by changing the default in our staging server environment to version 2.

We expect to default the production environment to version 2 before the end of the year, and we will post again when we have more definite dates. In the meantime, if you are still using version 1 of the API, please prepare for the change by taking one of the following steps:
  • Modify a test version of your code to access stage.gdata.youtube.com URLs as described in this blog post. You’ll automatically default to version 2, and you can test and make changes to your code against the staging server.
  • Start explicitly requesting version 2 using the v=2 URL parameter or GData-Version HTTP request header. Most of the YouTube API client libraries provide methods for switching between API versions, and they will take care of setting the appropriate GData-Version header for you. You may need to modify your code to make it compatible with version 2.
  • If you know that your code is incompatible with version 2 of the YouTube API and you can’t fix things yet, start explicitly requesting version 1 of the API. Note that this is not a long-term solution, as all code will eventually need to be migrated off of version 1.
Stay tuned over the coming months for more announcements about the change to the default in production, and the eventual decommission of version 1, currently scheduled for October 2011.

Cheers,
-Jeff Posnick, YouTube API Team

An enhancement to our video embed capability is now available through a new embed code style. This new style uses <iframe> and looks like this:
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID
An enhancement to our video embed capability is now available through a new embed code style. This new style uses <iframe> and looks like this:
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_IDallowfullscreen frameborder="0">
</iframe>


Example:


If you use the new embed code style, your viewers will be able to view your embedded video in one of our Flash or HTML5 players, depending on their viewing environment and preferences. Environments that support the HTML5 video player are listed here on our HTML5 settings page. In instances where HTML5 isn't supported (e.g. our HTML5 player can't play videos with ads), we use Flash.

An additional benefit of the new embed style is that it will eventually allow embeds to work on mobile devices, which typically use a built-in player instead of Flash or HTML5.


Before we make this new embed code the standard for our general users, we wanted to give our developer community a preview. While there may be some limitations, please try it out and
let us know how it went.

Toliver Jue, Software Engineer
recently learned some dance moves from “
黄帝心仙人".

There's been a lot of discussion lately about whether or not the HTML5 <video> tag is going to replace Flash Player for video distribution on the web. We’ve been excited about the HTML5 effort and <video> tag for quite a while now, and most YouTube videos can now be played via our HTML5 player. This work has shown us that, while the <video> tag is a big step forward for open standards, the Adobe Flash Platform will continue to play a critical role in video distribution.

It's important to understand what a site like YouTube needs from the browser in order to provide a good experience for viewers as well as content creators. We need to do more than just point the browser at a video file like the image tag does - there’s a lot more to it than just retrieving and displaying a video. The <video> tag certainly addresses the basic requirements and is making good progress on meeting others, but the <video> tag does not currently meet all the needs of a site like YouTube:

Standard Video Format
First and foremost, we need all browsers to support a standard video format. Users upload 24 hours of video every minute to YouTube, so it's important to minimize the number of video formats we support. Especially when you consider that for each format, we also provide a variety of sizes (360p, 480p, 720p, 1080p). We have been encoding YouTube videos with the H.264 codec since early 2007, which we use for both Flash Player and mobile devices like the iPhone and Android phones. This let us quickly and easily launch HTML5 playback for most videos on browsers that support H.264, such as Chrome and Safari.

Concerns about patents and licensing have prevented some browsers from supporting H.264; this in turn has prevented the HTML5 spec from requiring support for a standard format. We believe the web needs an open video format option. One that not only helps address the licensing concerns, but is also optimized for the unique attributes of serving video on the web. To that end, we’re excited about the new WebM project. Google is open sourcing and contributing the VP8 codec to the WebM effort. Google, Mozilla, and Opera have all committed to support WebM, and we have already started making YouTube videos available in the WebM format. Adobe has also committed to support VP8, the video codec for WebM, in an upcoming Flash Player release.

Robust video streaming
Closely related to the need for a standard format is the need for an effective and reliable means of delivering the video to the browser. Simply pointing the browser at a URL is not good enough, as that doesn't allow users to easily get to the part of the video they want. As we’ve been expanding into serving full-length movies and live events, it also becomes important to have fine control over buffering and dynamic quality control. Flash Player addresses these needs by letting applications manage the downloading and playback of video via Actionscript in conjunction with either HTTP or the RTMP video streaming protocol. The HTML5 standard itself does not address video streaming protocols, but a number of vendors and organizations are working to improve the experience of delivering video over HTTP. We are beginning to contribute to these efforts and hope to see a single standard emerge.

Content Protection
YouTube doesn't own the videos that you watch - they're owned by their respective creators, who control how those videos are distributed through YouTube. For YouTube Rentals, video owners require us to use secure streaming technology, such as the Flash Platform's RTMPE protocol, to ensure their videos are not redistributed. Without content protection, we would not be able to offer videos like this.

Encapsulation + Embedding
Flash Player's ability to combine application code and resources into a secure, efficient package has been instrumental in allowing YouTube videos to be embedded in other web sites. Web site owners need to ensure that embedded content is not able to access private user information on the containing page, and we need to ensure that our video player logic travels with the video (for features like captions, annotations, and advertising). While HTML5 adds sandboxing and message-passing functionality, Flash is the only mechanism most web sites allow for embedded content from other sites.

Fullscreen Video
HD video begs to be watched in full screen, but that has not historically been possible with pure HTML. While most browsers have a fullscreen mode, they do not allow javascript to initiate it, nor do they allow a small part of the page (such as a video player) to fill the screen. Flash Player provides robust, secure controls for enabling hardware-accelerated fullscreen displays. While WebKit has recently taken some steps forward on fullscreen support, it's not yet sufficient for video usage (particularly the ability to continue displaying content on top of the video).

Camera and Microphone access
Video is not just a one-way medium. Every day, thousands of users record videos directly to YouTube from within their browser using webcams, which would not be possible without Flash technology. Camera access is also needed for features like video chat and live broadcasting - extremely important on mobile phones which practically all have a built-in camera. Flash Player has provided rich camera and microphone access for several years now, while HTML5 is just getting started.


We’re very happy to see such active and enthusiastic discussion about evolving web standards - YouTube is dependent on browser enhancement in order for us to improve the video experience for our users. While HTML5’s video support enables us to bring most of the content and features of YouTube to computers and other devices that don’t support Flash Player, it does not yet meet all of our needs. Today, Adobe Flash provides the best platform for YouTube’s video distribution requirements, which is why our primary video player is built with it.

John Harding, Software Engineer,

Kuan Yong, Gareth McSorley and I -- representing Product Management, Engineering, and Developer Relations, respectively -- were happy to present a YouTube API session at this year’s Google I/O developer conference. We got the chance to meet many members of the developer community there, but unfortunately not everyone is able to make it out to San Francisco in person. For the benefit of those who could not attend, a recording of our session is now available on YouTube, and embedded below.

The session was titled “YouTube API Uploads: Tips, Tricks, and Best Practices” and we covered all topics related to uploads from A (Android app uploads) to Z (zero-metadata uploads). We hit a few letters in between, too: B (browser-based uploads) I (iPhone app uploads), Q (upload quota questions), R (resumable uploads) and Y (YouTube Direct). There’s something for everyone in this session, so if your application uploads video to YouTube, be sure to check it out!



Cheers,
-Jeff Posnick, YouTube API Team
YouTube is hiring! ~ http://google.com/jobs/workyoutube

If you access the YouTube API via Java using the official Google Data Client Library, we want to let you know about upcoming changes to the YouTube API that may affect your existing code. Developers who are using a client library in a language other than Java, or who use Java but access the YouTube API without using the Google Data Client Library will not be affected by this change.

Versions of the Java Google Data Client Library earlier than 1.41.2 (the most recent release as of this writing) are particularly picky about the data they receive back from the YouTube API and deserialize into Java objects. If our YouTube API servers are updated to start including an additional attribute for an existing element in their Atom XML responses, older versions of the Java client library will throw a deserialization exception complaining about this extra data. While this might be considered beneficial in some contexts, it unfortunately precludes our ability to extend the YouTube API’s functionality by returning back new data in its responses. We recently ran into this issue while trying to launch a new totalUploadViews attribute, for instance.

We removed the totalUploadViews attribute soon after adding it, but progress can’t be delayed forever. If you’re using the Java Google Data Client Library, we strongly recommend that you update your installation to the 1.41.2 (or newer) release. We plan on re-adding the totalUploadViews attribute in mid-July, and other new attributes may follow. If you haven’t updated to a compatible version of the Java client library by mid-July, your existing Java code will start throwing exceptions when you retrieve an Atom XML response containing the new attribute, such as a request for a user’s YouTube profile.

A special note to developers using YouTube Direct: because YouTube Direct is built on top of the Java client library, it also needs to be updated to use a compatible release. The latest archived downloads of the source code for both the 1.0 and 2.0 releases, as well as the SVN source, have been updated for compatibility. Please take the time to update your YouTube Direct deployment in App Engine before mid-July.

Cheers,
—Jeff Posnick, YouTube API Team
YouTube is hiring! ~ http://google.com/jobs/workyoutube

We're happy to announce the release of YouTube Direct v2.0. This release includes substantial upgrades that will make it easier for developers to test and customize the platform. In addition to the backend changes, we've also fixed a number of reported bugs and added these brand new features:
  • Support for secure AuthSub.
  • Support for viewing and editing YouTube captions for any video submitted. All caption languages are supported.
  • Support for multiple YouTube Direct uploader embeds (for different assignments) on a single page.
  • Pre- and post-submission text is now configurable on a per-assignment basis.
  • Users can now select from a pre-populated list of the most recent 50 videos in their account when uploading an existing video.

If you're currently using v1.0, we encourage you to download the latest release and upgrade your deployment. Please read detailed release notes and documentation on the new features as well.

We've seen YouTube Direct used in many interesting applications so far and we hope that this new release will enable more creative and engaging campaign around videos through your sites. If you have feedback on YouTube Direct, please visit our YouTube APIs Developer Forum and drop us a line. To receive announcements in the future, please subscribe to the YouTube API Annoucement list.

Amanda Surya, YouTube API Team

We're happy to announce the release of YouTube Direct v2.0. This release includes substantial upgrades that will make it easier for developers to test and customize the platform. In addition to the backend changes, we've also fixed a number of reported bugs and added these brand new features:
  • Support for secure AuthSub.
  • Support for viewing and editing YouTube captions for any video submitted. All caption languages are supported.
  • Support for multiple YouTube Direct uploader embeds (for different assignments) on a single page.
  • Pre- and post-submission text is now configurable on a per-assignment basis.
  • Users can now select from a pre-populated list of the most recent 50 videos in their account when uploading an existing video.

If you're currently using v1.0, we encourage you to download the latest release and upgrade your deployment. Please read detailed release notes and documentation on the new features as well.

We've seen YouTube Direct used in many interesting applications so far and we hope that this new release will enable more creative and engaging campaign around videos through your sites. If you have feedback on YouTube Direct, please visit our YouTube APIs Developer Forum and drop us a line. To receive announcements in the future, please subscribe to the YouTube API Annoucement list.

Amanda Surya, YouTube API Team

We wanted to share some big news that was just announced on the Google Code blog: the YouTube API now supports partial responses and partial update requests. Both these features allow you to drastically cut down on the amount of data you send and receive via the API, which means simpler, faster API operations and happier users.

The announcement post on the Google Code blog goes into much more detail, so take a look at that first. When you’re ready to start writing code, check out the partial response and partial update sections of the YouTube API Developer’s Guide.

Cheers,
-Jeff Posnick, YouTube API Team
YouTube is hiring! ~ http://google.com/jobs/workyoutube
We wanted to share some big news that was just announced on the Google Code blog: the YouTube API now supports partial responses and partial update requests. Both these features allow you to drastically cut down on the amount of data you send and receive via the API, which means simpler, faster API operations and happier users.

The announcement post on the Google Code blog goes into much more detail, so take a look at that first. When you’re ready to start writing code, check out the partial response and partial update sections of the YouTube API Developer’s Guide.

Cheers,
-Jeff Posnick, YouTube API Team
YouTube is hiring! ~ http://google.com/jobs/workyoutube







Since launching YouTube Direct last November, our team has been hard at work adding new functionalities, fixing bugs, and answering developer's questions. We wanted to take a momentary break from all that to share some updates.

Separate from but related to the main YouTube Direct project are two other Google Code projects: video capture and YouTube Direct upload applications for the Android and iPhone operating systems. These two projects are basic implementations that we hope will inspire organizations to add video capture and YouTube Direct upload functionality to their Android or iPhone applications.

We've been gradually, and quietly, checking in various bug fixes and enhancements to the current release's Subversion repository on Google Code. One recent change is especially important, as it adds support for the new video page URLs that will start becoming more common. Periodically, we package the current release into a new "tagged" release, and generate release notes summarizing what's new. If you haven't updated your YouTube Direct codebase recently, we strongly suggest that you read the release notes and perform a sync with our code repository. Starting with the next YouTube Direct release, we will send email announcements to the low-traffic, announce-only Google Group. We recommend that all developers using YouTube Direct sign up to the group — actually, all YouTube API users should sign up to receive periodic important notifications.

Many organizations, in addition to our launch partners, have deployed YouTube Direct on their websites since our launch, and we wanted to highlight a few here.

Gannett rolled out a company-wide initiative in honor of Black History month, in which they ask people to interview civil rights heroes via video. Al-Jazeera invited the community to share their thoughts and experiences around Hajj, the annual Muslim pilgrammage to Mecca. And if you have news videos around any of the big stories of the day, ITN News wants them. Even Tufts University is using YouTube Direct to solicit personal videos from the community called "You, in One Minute".

As always, the best resource for developers looking to embed YouTube Direct functionality on their website is our Getting Started Guide. If you have any technical questions about YouTube Direct, our YouTube API Developer's Google Group is the place to turn.

Cheers,
-Jeff Posnick on behalf of the YouTube Direct Team