Engineering and Developers Blog
What's happening with engineering and developers at YouTube
YouTube Captions Uploader Web App
Thursday, January 27, 2011
Captions can greatly enhance the experience of viewing a YouTube video, and the YouTube API has offered developers ways to
upload
and
retrieve
caption data in authorized requests for a while now. However, the various YouTube API
client libraries
don’t natively support interacting with captions at this time, and writing your own code for uploading or retrieving captions can be challenging.
With that in mind, we're happy to announce the
YouTube Captions Uploader
open source project on Google Code, which provides real-world code for uploading captions to YouTube. The code is written for the Java App Engine environment, and it uses some nifty new App Engine features like the
Channel API
, the
Blobstore Service
, and
Task Queues
. And even if you're not an App Engine developer, we hope that the
code
that interacts with the YouTube API's captions service will provide a good starting point for writing your own code.
In addition to open sourcing the code for this project, we’re also running the code itself on a public App Engine instance,
http://yt-captions-uploader.appspot.com/
. So, even if you're not a developer, you can still use the application to upload captions for videos in your YouTube account.
Please share your comments or feedback via the project’s
issue tracker
. We hope that you find it useful both as a standalone web application and as a starting point for writing your own code!
Cheers,
—Jeff Posnick, YouTube API Team
Introducing JavaScript Player API for iframe embeds
Thursday, January 20, 2011
Update (July 2012):
The
onYouTubePlayerAPIReady
callback has been superseded by
onYouTubeIframeAPIReady
and the URL for loading the IFrame Player API code has changed to
http(s)://www.youtube.com/iframe_api.
The API is now fully supported.
If you have been enjoying our
<iframe>
embed
announced
back in July we have some good news for you. Starting today, the
<iframe>
embed code is the default way to
share videos
on YouTube.com. We are also introducing
an initial beta version of
the
<iframe>
embed JavaScript Player API, making it a viable alternative for developers who previously used the API exposed by the ActionScript players. Let’s look at an example of the API usage:
<!DOCTYPE HTML>
<html>
<body>
<div id="player"></div>
<script>
//Load player api asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var done = false;
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: 'JW5meKfy3fY',
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
function onPlayerReady(evt) {
evt.target.playVideo();
}
function onPlayerStateChange(evt) {
if (evt.data == YT.PlayerState.PLAYING && !done) {
setTimeout(stopVideo, 6000);
done = true;
}
}
function stopVideo() {
player.stopVideo();
}
</script>
</body>
</html>
This example will play a video for several seconds and then stop playback. An instance of
YT.Player
is used to control the player, defined by script loaded from
http(s)://www.youtube.com/iframe_api
. For more information about the API usage, as always, please consult our Player API
documentation
and let us know what you think on our
Developer Forum
.
Cheers,
-Jarek Wilkiewicz, on behalf of the YouTube Player 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
blur faces
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 IFrame Player API
YouTube live
YouTube Reporting API
ytd
Archive
2018
Aug
Apr
2017
Nov
Sep
Aug
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