If you ever pay attention to your browser’s location bar, you may have noticed that, for a while now, the YouTube.com website has used playlist IDs that are prefixed with the characters “PL” when constructing the URLs for playlist pages.http://www.youtube.com/playlist?list=PL72CF07D200AA2AFAis one example of that. This practice of prepended playlist IDs previously didn’t extend over to the Data API—PL72CF07D200AA2AFAwould not have been recognized as a valid playlist ID, but72CF07D200AA2AFAwould have.
Starting later today, Wednesday, August 22, the YouTube Data API will accept playlist IDs with the “PL” prefix whenever they’re used as metadata or inAPI request URLs. In mostresponses, the API will return playlist IDs with “PL” prefixes. The one exception is that for the next few days,searching for playlistswill return playlist ids without the “PL” prefix. This will change on Tuesday, August 28, at which point the “PL” prefix will be included in playlist search results as well.
While we will continue to support using unprefixed playlist IDs as metadata or in API request URLs for the time being, at some point in the future we may require the “PL” prefix to be used whenever a playlist ID is provided. We’ll provide additional guidance if we do decide to stop supporting requests with unprefixed playlist IDs.
This change should be backwards compatible, but if you’re currently manipulating or comparing the playlist IDs that are returned via the API in any way, or making any assumptions about the length of the ID (which you shouldn’t be), please make sure that your code will handle IDs that contain the “PL” prefix.
If you have any questions about this changes, please let us know in ourdeveloper forum.
If you’ve hesitated to use theplayer in your app due to the IFrame Player API’s experimental status, then wait no more. We’ve removed that API’s ‘experimental’ tag, which means the API is production-ready and is covered by YouTube’s deprecation policy. Since theis the default way of sharing YouTube videos on the Web, the IFrame Player API is now the recommended mechanism to control video playback behavior in your Web applications.
To provide a consistent developer experience with the YouTube Upload Widget, we’ve changed the the URL for loading the IFrame Player API code to https://www.youtube.com/iframe_api. The old URL (http://www.youtube.com/player_api) is now deprecated, though it will continue to work. Similarly, the iframe API initialization callback name has been changed to onYouTubeIframeAPIReady from onYouTubePlayerAPIReady, also for consistency with the YouTube Upload Widget. The old callback name, onYouTubePlayerAPIReady, is now deprecated as well. If your app uses both the YouTube Upload Widget as well as the IFrame Player API, you only need to include the script once and handle a single initialization callback.
Going forward, we’ll continue making improvements to the IFrame API and make it work better with mobile platforms. As before, you can find the details about the API in our documentation and ask questions about it on our developer forum.
If you’ve ever developed a custom playback experience based on ourPlayer API, you’ve probably used thegetVideoBytesLoaded()andgetVideoBytesTotal()methods to determine how much the current video is locally buffered and the size of the entire video. After obtaining this information, the next logical step is to divide the number of bytes loaded by the total number of bytes to obtain the fraction of the video that’s been buffered, which you can then display in your custom user interface.
Instead of taking this two-step approach to calculate how much of a video has buffered, we encourage you to use the newgetVideoLoadedFraction()method. It will return a numerical value between 0.0 and 1.0 that represents the same fraction obtained by dividinggetVideoBytesLoaded()bygetVideoBytesTotal(). While those two legacy methods still work today, they are now officially deprecated, as per the terms of ourdeprecation policy.
getVideoLoadedFraction()allows us to expose more accurate information to your code about the state of the video that’s currently playing across a wider range of playback scenarios. When HTML5playback was used in thePlayer, for instance, we previously had toreturn “fake” valuesforgetVideoBytesLoaded()andgetVideoBytesTotal(), as the true byte counts weren’t directly exposed via theelement. The value returned bygetVideoLoadedFraction()should be correct for that and other playback scenarios that we roll out in the future.
If you have any questions about the new method or anything else related to the YouTube APIs, please let us know in thedeveloper forum.
Over the past few years we’ve heard two specific pieces of feedback from the YouTube API community:
Developers haveclamored for yearsfor a way of embedding a webcam YouTube upload widget on their web pages, similar to the webcam upload tool available atyoutube.com/my_webcam.
Developers who have usedYouTube Directin the past have asked for a simpler solution that doesn’t require the same level of technical expertise to set up and manage.
Knowing about this demand made us particularly excited for ourGoogle I/O announcementsof theYouTube Upload Widgetthat supports webcam uploads, andYouTube Direct Lite, both of which are now available for public use.
YouTube Upload Widget Using theYouTube Upload Widgeton your site is as simple asadding an , like so:
Developers who want more control over the uploads experience can use a fullJavaScript APIto initiate the widget, and listen for events related to the upload.
YouTube Direct Lite YouTube Direct Liteis a complete rewrite of the existingYouTube Directplatform. The goal of the project remains the same: make it possible to solicit videos from your users and then moderate those submissions into standard YouTube playlists for display. The difference is that YouTube Direct Lite is implemented purely in client-side HTML, JavaScript, and CSS, and unlike with YouTube Direct, no Java App Engine deployment is needed. You can download the YouTube Direct Lite code, customize it, and deploy it on your own web server along with the rest of your site’s content. To make things even easier, we’re hosting a canonical deployment of YouTube Direct Lite that you could include on your pages without having to deploy anything at all—just add the appropriate
You can find a live example of YouTube Direct Lite integration, including the use of the YouTube Upload Widget, onthis sample page. Feel free to use that page to submit a video letting us know how you plan on using the new tools.
Bringing theYouTube Upload WidgetandYouTube Direct Liteto web developers and community maintainers will give you new tools to hear from (and see!) your community, and who knows what great things will come from that!
Cheers, —Eric Lundberg, Jeff Posnick and Vladimir Vuskovic, YouTube API Team
Whether you’re a fledgling developer looking to get started with an API or a skilled developer who wants to learn some new tricks, you’ll find engaging material at theGoogle Developers Academy. Of particular interest to readers of this blog is theYouTube section, which hosts courses specific to the YouTube APIs.
Thefirst coursewalks JavaScript developers through the steps needed to embed an live demoof a page with videos from last year’s Google I/O conference to see the player in action.
We will be gradually adding to theYouTube sectionof the Google Developers Academy, and we’ll announce the new courses on this blog and ourYouTube for Developers Google+ page. Stay tuned for more great resources!
Web developers are accustomed to making magical user experiences with a few lines of elegant JavaScript, but when faced with talking to RESTful services like the YouTube API, the options have been anything but simple. The most common approach relies on…
As you might have seen announced on our Google Developers blog, the deprecation policies associated with many of Google’s APIs are changing. We want to highlight the specific way this affects YouTube API developers.As of today, our YouTube API deprec…
We’d like to let the community know about an upcoming change that will affect some developers using Flash-only players in their webpages or applications. Previously, a URL like http://www.youtube.com/v/VIDEO_ID would default to the ActionScript 2 ver…
Update (May 2012): The showinfo=1 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 You…
Pop quiz: what’s the difference between the following feed URLs?https://gdata.youtube.com/feeds/api/users/googledevelopers/uploads?v=2https://gdata.youtube.com/feeds/api/users/googledevelopers/uploads?v=2&orderby=publishedhttps://gdata.youtube.co…
Update (April 2012): The last paragraph was changed to reflect the distinct yt:display and display attribute names, depending on whether the parent element is media:credit or yt:username.By now, you may have read about the recent launch of connecting a…
Update (August 2012): We now suggest YouTube Direct Lite rather than YouTube Direct for most new integrations.The following scenario comes up all the time when we talk to developers: a website with an active readership is interested in soliciting video…
There’s a new entry in the growing list of video feeds supported by the YouTube Data API: the watch history feed. This feed allows authenticated API users to retrieve their own YouTube viewing histories—retrieving the watch history of any other use…
YouTube Direct, our open source platform for obtaining and moderating user-generated videos (and photos!), was first announced over two years ago. Since that time, the project has continued to grow, and we’re happy to announce the latest round of add…
As you might have recently read, there’s an upcoming change that affects any “friends” you might have associated with your YouTube account. Your existing “friend” connections will be automatically converted into Address Book contacts, and whe…