Engineering and Developers Blog
What's happening with engineering and developers at YouTube
Recent activity: apitestjhartmann has written a tutorial
Tuesday, March 17, 2009
As you may have heard,
YouTube has been getting more social lately
. Our activity feeds help your users stay up-to-date on the cool channels and videos that their friends (or anyone else, for that matter) have been uploading, subscribing to, adding as favorites and so forth.
But we don't just care about YouTube users. We also care about developers. And we want you to have time to be more social, too.
With that in mind, Jeff Fisher and I wrote a
hands-on tutorial
that explains how to build the
YouTubeActivityViewer
, a PHP application that uses the new activity feeds. The application uses our
PHP client library
with
jQuery
. If you're still not ready to rush out and socialize, you can also build in a caching system with
memcache
.
Latest .NET SDK Released! LINQ & New Social Notifier Sample
Thursday, March 5, 2009
Posted by Frank Mantek, Google Data APIs Team
The new .NET SDK is released and available for download here:
http://code.google.com/p/
google-gdata/downloads/list
There's now updated support for YouTube V2 and a new vertical object model that allows you to use local LINQ queries. Please go through the
Google.YouTube
namespaces and see what's new there. We have some documentation for it here:
http://google-gdata.
googlecode.com/svn/trunk/
clients/cs/docs/
AdditionalContent/
YouTubeLinqExamples.html
Last, but not least, there is the
Notifier for YouTube
sample application, which showcases the
activity feeds
YouTube is exposing. You can subscribe to events from your friends and other YouTube users and get notified whenever they leave their marks in the YouTube universe. The
sample
is also available as a separate download.
The complete release notes can be found here:
http://google-gdata.
googlecode.com/svn/docs/
RELEASE_NOTES.HTML
which also lists all the bugs that were fixed in this release. Report new ones here:
http://code.google.com/p/
google-gdata/issues/list
PHP Client Library: Uploading videos now 99% more efficient !
Monday, March 2, 2009
Posted by Jochen Hartmann, YouTube APIs and Tools Team
If you are using the
PHP Client Library
to upload your videos to YouTube.com you may have had to deal with memory issues, such as the common
Fatal error: Allowed memory size of ... bytes exhausted
error message.
I am happy to announce that
as of version 1.7.6 of the client library
, this should no longer be a problem. Jeff Fisher and I have added support for streaming large video files to our API in manageable 1 MB chunks. The change is completely transparent, so you won't need to do anything besides upgrade your copy of the client library.
Prior to this change, our client library used to rely solely on the
Zend_Http_Client
object to handle HTTP communication between servers. The client makes requests by reading the entire body of your
HTTP POST
message into a string, which then gets sent to our API server. This behavior is perfectly acceptable for normal use since most of the time we are just sending XML strings or small media files such as images, but doesn't work quite so well for uploading 1 GB video files.
To address this problem, I designed a
Zend_Gdata_MediaMimeStream
object which only stores a handle to the video file being uploaded. Jeff built a
Zend_Gdata_HttpAdapterStreamingSocket
which then reads from the media stream in 1 MB chunks and sends to the socket until the entire message is read. We have tested this code extensively and are always open to feedback on how to improve performance issues in our client library, so
check out the source code
if you are interested.
While I have your attention, let me also share another trick for those obsessed with efficiency: If you are only interested in working with the raw XML instead of the complete Zend_Gdata object model, you can
flip a minor switch
that is available in all of our service classes (Zend_Gdata_YouTube, Zend_Gdata_Docs, etc.):
$yt = new Zend_Gdata_YouTube();
$yt->useObjectMapping(false);
$xmlString = $yt->getRecentlyFeaturedVideoFeed();
echo gettype($xmlString); # will return 'string'
As you can see in the snippet above, the
$xmlString
variable is now just a regular string instead of a
Zend_Gdata_VideoFeed
object. My testing shows that this can make fetching video feeds from YouTube faster by up to 35 times. Of course you would need to add a little bit of time parsing the XML with the tool of your choice (
XPath
, etc.). I should also add that those interested in parsing XML without the aid of the client library may want to check out the
Backward Compatibility Guidelines
for the YouTube Data API.
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