Engineering and Developers Blog
What's happening with engineering and developers at YouTube
No WebView required, with native YouTube Player API for Android
Friday, December 21, 2012
Adding a high-quality video experience to your Android application just got a whole lot easier. Starting today, you can embed and play YouTube videos in your app using the new
YouTube Android Player API
.
The API, which was
pre-announced
at Google I/O 2012, offers these benefits:
High-quality video playback supported on Android 2.2 (Froyo) or newer
Easy integration
with your Android application (no
WebView
required)
Fullscreen
and orientation change support
Closed captions
display
Support for YouTube ads
Programmatic access, similar to existing
Player APIs
, to most aspects of the
YouTube video playback experience
Integration with the Android YouTube app using a standard set of YouTube
Intents
We are launching the API as
experimental
, though we do not expect major interface changes going forward.
The Only Limit Now is Your Imagination
(and
ToS
)
These
instructions
explain how to include the
YouTubeAndroidPlayerApi.jar
client library in your Android application. The library is supported on Android devices running version
4.2.16
or newer of the Android YouTube app.
You can use the
YouTubeApiServiceUtil
class'
isYouTubeApiServiceAvailable
method to confirm that a device is compatible.
For a simple embed, use the
YouTubeStandalonePlayer
. To build a more sophisticated user interface, try the
YouTubePlayerView
or the
YouTubePlayerFragment
.
Fragments
can help create an engaging experience as shown in the Video Wall app
example
.
Play With These Apps
Here are a few interesting apps available for you to explore:
See everything on
Flipboard
, all your news and life’s great moments in one place. Now you can watch YouTube videos from wherever you are in Flipboard without leaving the application, providing a more integrated and seamless experience.
BuzzFeed
delivers original reporting, scoops, and the hottest social content on the web. Android users can now view their favorite BuzzFeed content featuring YouTube videos in the BuzzFeed app and share with their friends.
9x9.tv
enables users to discover and watch curated, topical videos that are organized into TV-like channels. Their
blog
describes their experience developing with the API.
SoundTracking
lets people use their mobile phone or tablet to share their music moments and favorite jams with friends and family. Users can now discover and play YouTube music videos of the songs within their music timeline.
Fitness Flow by
Skimble
helps you get in shape with high-quality exercise videos led by professional trainers. Skimble uses YouTube to stream workout content on your Android phone and tablets.
Check out a few screen shots below or download the apps from
Google Play
today!
Flipboard
BuzzFeed
Fitness Flow by Skimble
Learn More
If you would like to learn more about the YouTube Android Player API, the
documentation
is a great place to start. In addition, we have curated useful videos in this
playlist
. Please subscribe to the
YouTube for Developers'
channel to keep up on the latest.
Check Out The Sample Code
We’ve prepared several code examples to make it easy for you to get started with the new API. You will find them on
code.google.com
. The description of the examples is available in our
documentation
. If you need additional help with the API feel free to use our
support resources
.
Cheers,
-- Ross McIlroy, Anton Hansson, and Horia Ciurdar, YouTube Mobile Team
The Simpler, Yet More Powerful New YouTube Data API
Friday, December 14, 2012
Since its initial
launch
in 2007, the YouTube Data API has become one of Google’s most popular APIs by request volume, thanks to the
awesome apps
from developers like you. To help you make better integrated video experiences, you can now use the YouTube API version
3.0
. The new API is easy to use thanks to rich client library support, improved tooling, reference documentation and integration with Google’s common API infrastructure. Version 3.0 only returns what you ask for and is using JSON rather than XML encoding for greater efficiency. The API introduces new core functionality including
Freebase
integration via topics, and universal search. If you develop social media management apps, you’ll love channel bulletin post and full subscriber list management, also new in this release. Version 3.0 of the API constitutes the API's biggest overhaul to date and we’re eager for you to
try it today
!
New Functionality: Topics, Universal Search, and Audience Engagement Support
Have you ever tried to search for YouTube videos only to find out that keyword search can produce ambiguous results? With the new Topics API, thanks to the power of
Freebase
, you can find exactly what you’re looking for by specifying Freebase topic IDs rather than search keywords.
For example, if you’re reading this post from outside of the US and would like to search for content related to football,
/m/02vx4
is probably the topic ID you're after. The API's
universal search
feature lets you retrieve channels, playlists and videos matching the topic with just one request like
this one
. Find out more in our Topics
API Guide
.
Version 3.0 introduces better tools to engage and interact with one’s YouTube audience. Social media management apps can now help content creators communicate with their
channel subscribers
using buletin
posts
.
Efficiency, Client Libraries, Better Tooling and More!
To help you reduce your app’s bandwidth requirements version 3.0 only returns the information you ask for as specified by the “
part
” parameter.
While the default JSON encoding in version 3.0 is more efficient than XML in version 2.0, if parsing JSON isn’t your thing, check out the
client libraries
for .NET, Dart, Go, Java, JavaScript, Objective-C, PHP, Python and Ruby. The libraries use OAuth 2.0 authorization and work with the YouTube API as well as other modern
Google APIs
thus simplifying your application.
The familiar Google API tools such as the
API console
work with YouTube API version 3.0 without any extra hassles. Additionally, our API reference documentation now allows you to scroll down to the
bottom of any reference page
to try the API. You can also or visit the standalone
API Explorer
to browse a list of supported methods.
App Examples
Even though version 3.0 is still
experimental
, a number of exciting new apps are already using it. Let’s look at a few examples:
Showyou
, an app that makes it easy to watch the Internet,
integrated
the Topics API to enable users to discover related videos after tapping on topics associated with the Showyou feed.
Argentina-based
Interesante
integrated
the Topics API to determine the Freebase topic of videos being shared. Interesante used this to serve interest-based video recommendations.
FanBridge
, a company specializing in growing and managing one’s fan base, recently introduced channel
bulletin post
functionality with
scheduled posts
support.
Tubular Labs
, which focuses on YouTube audience development, uses
subscriber list
to help content creators develop a better understanding of their audiences.
Pixability
, a company specializing in YouTube marketing software, was able to quickly port their
Online Video Grader
to the YouTube API version 3.0 thanks to the new Python client
library
.
Learn More
If you would like to learn more about the YouTube API version 3.0, in addition to the API
documentation
, the material curated in
this playlist
is a great place to start. Please subscribe to the
YouTube for Developers' channel
to keep up on the latest.
Use The Source, Luke!
Since the most fun way to work with it is to try it, we’ve prepared a few code examples in
Python
and
JavaScript
to get you started. For a more comprehensive client-side app using the Topics API, try the
Topics Explorer
. You can find its source code on
code.google.com
.
Cheers,
--
Raul Furnică
,
Vladimir Vuskovic
and
Pepijn Crouzen
, YouTube API Team
ClientLogin using Google Accounts
Tuesday, December 11, 2012
Long-time readers might remember a blog post from a while back entitled “
ClientLogin #FAIL
”, in which we covered the myriad ways in which your
ClientLogin
authorization attempts might result in an error. Even though ClientLogin has been officially
deprecated
since April 2012, and even though we’ve been recommending that developers switch to
OAuth 2
for longer than that, we know there are still a good number of legacy applications out there that still rely on ClientLogin.
If you are a developer of such an application, there’s another thing that you (and your users) will need to start watching out for: at some point in the future, we will start requiring that the username parameter passed to ClientLogin (i.e. what’s referred to as the
Email=
value in the
ClientLogin request
) correspond to the full email address of the
Google Account
that’s associated with an underlying YouTube channel. We’ve supported using Google Account email addresses with ClientLogin for many years now, ever since we started
linking
Google Accounts to YouTube channels, but old habits die hard, and many users still use YouTube usernames.
We haven’t yet determined a date for when we still stop supporting ClientLogin with YouTube usernames and will provide additional details when we know more about when it will take place. However, if you use ClientLogin, it’s not too early to start encouraging your application’s users to start providing their Google Account email addresses instead of their YouTube usernames when logging in. If you have the ability to update your existing application’s user interface, we recommend doing so to indicate that the username field should take a Google Account email address. If you have any online help materials or technical support for your software, update them to ensure that users know to provide their Google Account email address.
Users who log in via the YouTube.com web interface, or who go through the AuthSub, OAuth 1, or OAuth 2 web authorization flows will soon be required to use their Google Account email address instead of their YouTube username as well. This web-based transition will take place well before we deprecate YouTube usernames for ClientLogin, and it should be transparent to developers since Google controls the user interface for these flows. For more information, see this
help center article
.
As mentioned, we’ll have a follow-up post in coming months with more details about exactly when we’ll stop supporting YouTube usernames with ClientLogin. That post will also communicate the exact error message that ClientLogin will return when a YouTube username is used.
We’d like to close with one more plea: ClientLogin is deprecated, and is technically inferior to OAuth 2 in a number of important ways. Our new Google APIs client libraries provide first-class OAuth 2 integration that developers can take advantage of in their new code, or back port to their existing code. You will be doing your users a service and making their accounts more secure by transitioning from ClientLogin to OAuth 2.
Update (June 2013)
: The change mentioned in this blog post is now in effect. Attempts to use ClientLogin with a YouTube username will result in
HTTP 403 Forbidden
responses, with
Error=BadAuthentication
in the response body.
Cheers,
—
Jeff Posnick
,
YouTube API Team
Labels
.net
360
acceleration
access control
accessibility
actionscript
activities
activity
android
announcements
apis
app engine
appengine
apps script
as2
as3
atom
authentication
authorization
authsub
best practices
blackops
bootcamp
captions
categories
channels
charts
chrome
chromeless
client library
clientlibraries
clientlogin
code
color
comments
compositing
create
curation
custom player
decommission
default
deprecation
devs
direct
discovery
docs
Documentation RSS
dotnet
education
embed
embedding
events
extension
feeds
flash
format
friendactivity
friends
fun
gears
google developers live
google group
googlegamedev
googleio
html5
https
iframe
insight
io12
io2011
ios
iphone
irc
issue tracker
java
javascript
json
json-c
jsonc
knight
legacy
Live Streaming API
LiveBroadcasts API
logo
machine learning
mashups
media:keywords keywords tags metadata
metadata
mobile
mozilla
NAB 2016
news
oauth
oauth2
office hours
open source
partial
partial response
partial update
partners
patch
php
player
playlists
policy
previews
pubsubhubbub
push
python
quota
rails
releases
rendering
reports
responses
resumable
ruby
samples
sandbox
shortform
ssl https certificate staging stage
stack overflow
stage video
staging
standard feeds
storify
storyful
subscription
sup
Super Chat API
survey
tdd
theme
tos
tutorials
updates
uploads
v2
v3
video
video files
video transcoding
virtual reality
voting
VR
watch history
watchlater
webvtt
youtube
youtube api
YouTube Data API
youtube developers live
youtube direct
YouTube live
YouTube Reporting API
ytd
Archive
2017
Mar
Jan
2016
Nov
Oct
Aug
May
Apr
2015
Dec
Nov
Oct
May
Apr
Mar
Jan
2014
Oct
Sep
Aug
May
Mar
2013
Dec
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
2012
Dec
Nov
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2011
Dec
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2010
Dec
Nov
Oct
Sep
Jul
Jun
May
Apr
Mar
Feb
Jan
2009
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2008
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
2007
Dec
Nov
Aug
Jun
May
Feed
YouTube
on
Follow @youtubedev