Engineering and Developers Blog
What's happening with engineering and developers at YouTube
New Player Options for Lists of Videos
Friday, March 30, 2012
Update (May 2012):
parameter can now be included in the player's URL to indicate that the list of video thumbnails should be initially visible. The example below has been updated to illustrate this usage.
Most developers know that the YouTube embedded player can display a single video, but did you know that it can be used to display a list of videos as well? There have been a number of recent enhancements around list playback functionality, and if you’re not already taking advantage of those new features, we wanted to let you know what you’re missing out on.
The first change of note is the syntax for embedding the player in an HTML document. As for
, you can use the
embed code to load a list of videos, and the IFrame embed supports HTML5
playback in environments where Flash is not available.
Another exciting change relates to the lists of videos that you can load. The player is no longer limited to just displaying videos from an actual YouTube playlist. You can also load a user's uploaded videos, a user's favorite videos, or videos matching a specific search term. In the embed URL, the
parameters control the list of videos that is loaded. The
value can be either
. Depending on the
parameter value should be set to the desired playlist id, YouTube user ID, or search term. For example, the following embed code displays the most recent videos uploaded in the “GoogleDevelopers” YouTube channel:
<iframe width="560" height="315" src="http://www.youtube.com/embed/?
" frameborder="0" allowfullscreen></iframe>
The corresponding embedded player is shown below:
, moving to the
next/previous video in a list
, and controlling whether playback is
shuffled or looped
a sample page
that you can experiment with and use as inspiration when developing your own code.
—Jeff Posnick, YouTube API Team
Minimum embeds: 200px x 200px
Thursday, March 29, 2012
If you're a careful reader of the YouTube API
Terms of Service
as well as the
YouTube Player documentation
, you may have noticed that while embedded players smaller than the minimum size might not support all player features, we haven’t defined what that size is.
As a part of our spring cleaning, we've tidied up our documentation to specify a
minimum player size
, which is
200px by 200px.
This change will take effect beginning late April 2012, so please check your application to avoid surprises. If you have any questions or comments about this, or any other YouTube API feature, please let us know on the
-Jarek Wilkiewicz, YouTube API Team
Keeping Things Fresh
Friday, March 23, 2012
Pop quiz: what’s the difference between the following feed URLs?
All three will return a list of videos uploaded in the
, with the most recent uploads listed first. However, only the first URL will return the freshest results available — the second or third feeds could both be missing videos that were uploaded within the past few hours. In addition, even if the videos are listed in the second and third feeds, the metadata returned for those videos might not reflect any recent updates.
The reason for this, as
explained in our documentation
, is that some requests go against our search index, which has cached data, while other requests retrieve data directly from our backend databases, which always contain the most up-to-date data. To determine whether a request will query the search index or the backend database, you can use the following rules of thumb:
If your request only includes the
query parameters, then it should go against the backend database and the results will be fresh. A few other parameters that change the way the feed is formatted, like
, can also be used without triggering the search index. Although it does filter results out of the feed, the
parameter can also be used while still going against the backend database, because the filtering is performed server-side after the data has been retrieved.
If your request contains other parameters, there’s a good chance it will end up against the search index. Some common parameters that will always trigger a search are
Going against the search index isn’t inherently a bad thing. Using the search index is an incredibly efficient way of returning all the videos that match an arbitrary keyword, or ordering a feed of videos so that they’re sorted by view count. The important thing to realize is that the search index doesn’t need to be used for tasks that the backend database can handle, and you’ll get fresher results from the backend database.
Until now we’ve been focusing on retrieving a feed of videos uploaded in a specific account, but these same principles apply to looking up a single video with a given ID as well. Using the information above, can you determine which of these URLs will request a video entry from the backend database, and which will go against the search index?
As you’ve probably figured out, the first URL retrieves the entry for video ID
directly from the backend database, while the second URL searches for all entries with metadata containing
and then returns the one matching result. The results look similar, but only the first URL will give you the complete, up-to-date video metadata. As such, we recommend always using that syntax when retrieving the entry for a video whose ID you know.
-Jeff Posnick, YouTube API Team
YouTube, Google+, the API, and You
Thursday, March 15, 2012
Update (April 2012):
The last paragraph was changed to reflect the distinct
attribute names, depending on whether the parent element is
By now, you may have read about the
of connecting a Google+ profile with a new YouTube channel and questioned whether the change will affect YouTube Data API responses and, consequently, your application. The API does have a couple of changes that affect the way account names are returned, and these changes are designed to be backward compatible with applications that follow the best practices defined in our
With that in mind, this post explains how to ensure that user names function properly in your application.
If your application uses authentication and refers to feeds belonging to the currently authenticated user, always use the string
as the username in the feed URL. For example, the URL
retrieves the currently authenticated user's profile no matter what type of account she has, and
is always the correct URL to POST to when performing a resumable upload into the current user’s account.
Avoid manually generating links to
— instead, extract URLs for related feeds from
elements. For instance, the
profile entry for a given account
element with a
, and that element's
attribute contains the URL for that account’s playlists.
If you do need to manually generate a feed URL that is not for the
user, use the value in the
element as the username in the feed URL. Other fields, like
, might contain a display name or a different identifier that is not appropriate for use in a feed URL.
Note that for accounts that have connected a Google+ profile to a new YouTube channel and for
Google Accounts without a linked YouTube account
field will not be a traditional YouTube username. Instead, it will be a globally unique identifier that isn't intended for display in a user interface. A new field,
, will always contain this globally unique identifier regardless of the account type, and if you are writing new code to specifically deal with that identifier, we recommend reading it from
Any existing code that relies on displaying the
value to users should instead switch to using a value taken from one of that element's
attributes. On the
element, the relevant attribute is called
. On the
element, the corresponding attribute is called
attribute value will always be a meaningful value suitable for display. For accounts connected to Google+, it will be set to the full public display name. For full YouTube accounts that aren’t connected to Google+, it will be set to the YouTube account name.
–Jeff Posnick, YouTube API Team
“Super Tuesday” Reporting, Powered by YouTube Direct
Monday, March 5, 2012
It’s Presidential election season in the United States, and YouTube’s News and Politics team is partnering with
timely political videos
from across the country. With that in mind, we’re excited to announce that citizen journalists can now submit videos documenting the election process by using the new
mobile applications powered by
and released by Storyful. Both applications are based on the open source code examples we’ve released for
, and submit videos to the instance of YouTube Direct that Storyful curates.
Tomorrow is “Super Tuesday,” when 10 states will hold their primary elections. If you live in one of the Super Tuesday states, we encourage you to install the Storyful Direct mobile application and shoot some footage documenting your political experience—a selection of videos will appear on YouTube and
throughout the day. Even if you don’t live in a state that’s holding a primary tomorrow, the Storyful Direct apps can be used to document your experience during the runup to the Presidential election in November.
And if you’re a developer who isn’t yet familiar with the YouTube Direct platform, you can find all the information you need to get started with the web and mobile platforms at the
Google Code project page
—Jeffrey Posnick, YouTube API Team
See you at GDC, PyCon and SXSW
Thursday, March 1, 2012
YouTube Developer Advocates and Engineers will be presenting next week at GDC, PyCon and SXSW. If you’re coming to any of those conferences, we’d love to meet you. Here is what’s in store at each conference:
Games Developers Conference, San Francisco, March 5-9
YouTube API + Cloud Rendering = Happy Mobile Gamers
Demo booth #1901 on the show floor
PYCON 2012, Santa Clara, March 7-15
Scalability at YouTube
SXSW Interactive, Austin, March 9-13
The VJ in Your Pocket: Mobile YouTube API Apps for Content Creators, Curators and Consumers
YouTube Mobile/Google TV code lab for Android developers
Amanda Surya, YouTube Developer Relations Team
google developers live
Live Streaming API
media:keywords keywords tags metadata
ssl https certificate staging stage
Super Chat API
YouTube Data API
youtube developers live
YouTube Reporting API
Press & Blog
Creators & Partners
YouTube Creator Blog
YouTube Trends Blog