Engineering and Developers Blog
What's happening with engineering and developers at YouTube
The ActionScript 2 Chromeless Player and Monetized Videos
Monday, October 25, 2010
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
PubSubHubbub for YouTube Activities
Thursday, October 7, 2010
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
Resources for Mobile Development with YouTube
Friday, September 24, 2010
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 :
YouTube 移动应用程序开发参考资料
YouTube 行動應用程式開發資源
携帯端末向け開発リソース YouTube
YouTube를 통한 모바일 개발 도움말
Recursos para desenvolvimento de aplicativos para celular com o YouTube
Ресурсы для разработки мобильных приложений, интегрированных с YouTube
Recursos de desarrollo para móviles con YouTube
Thanks,
-Jarek Wilkiewicz, YouTube API Team
Staging Server Now Defaults to YouTube API Version 2
Monday, September 13, 2010
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
A New Way To Embed YouTube Videos
Thursday, July 22, 2010
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
"
allowfullscreen
frameborder="0">
</iframe>
Example:
<br />
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 “
黄帝心仙人
".
Flash and the HTML5 <video> tag
Tuesday, June 29, 2010
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,
recently created “
BYOBW 2010 HelmetCam - Just the good parts
”
YouTube API @ Google I/O 2010
Tuesday, June 8, 2010
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 (
A
ndroid app uploads) to Z (
z
ero-metadata uploads). We hit a few letters in between, too: B (
b
rowser-
b
ased uploads) I (
i
Phone app uploads), Q (upload
q
uota
q
uestions), R (
r
esumable uploads) and Y (
Y
ouTube 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
Labels
.net
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
mashups
media:keywords keywords tags metadata
metadata
mobile
mozilla
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
survey
tdd
theme
tos
tutorials
updates
uploads
v2
v3
video
voting
watch history
watchlater
webvtt
youtube
youtube api
youtube developers live
youtube direct
ytd
Archive
2015
December
Chat it up, streamers! New Live Chat, Fan Funding ...
November
October
May
April
March
January
2014
October
September
August
May
March
2013
December
October
September
August
July
June
May
April
March
February
2012
December
November
September
August
July
June
May
April
March
February
January
2011
December
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
July
June
May
April
March
February
January
2009
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
2007
December
November
August
June
May
Feed
YouTube
on
Follow @youtubedev