Engineering and Developers Blog
What's happening with engineering and developers at YouTube
Let your users discover live events and track their audience
Tuesday, October 29, 2013
YouTube Live streaming platform
enables eligible channels to stream live content on YouTube.
With the addition of live streaming content to the Data API, you can make it easier for users to find information about these live streaming events:
get search results indicating whether a video is an
upcoming
or
active
liv
e broadcast
get both
scheduled
and
actual
values of
start
and
end
time of the broadcast
get
concurrent viewer count
of a broadcast
search for live content via
eventType
filter
How to start implementing new features
The basics
The new
snippet.liveBroadcastContent
property in search results indicates whether a video or channel resource has live broadcast content. Valid property values are upcoming, active, and none.
The video resource's new
liveStreamingDetails
property is an object that contains metadata about a live video broadcast. To retrieve this metadata, include
liveStreamingDetails
in the
part
parameter value's list of resource parts when calling the
videos.list
,
videos.insert
, or
videos.update
method. The metadata includes the following new properties:
actualStartTime
,
actualEndTime
,
scheduledStartTime
,
scheduledEndTime
,
concurrentViewers
.
The
search.list
method's
eventType
parameter and the
search result
's
snippet.liveBroadcastContent
property.
Samp
le code and tools
Client libraries
for many different programming languages can help you implement the YouTube Live Streaming API as well as many other Google APIs.
Don't write code from scratch! Our
Java
,
PHP
, and
Python
code
samples
will help you get started.
The
APIs Explorer
lets you try out sample calls before writing any code.
Stay tuned here and subscribe to the
YouTube for Developers
channel to keep up on the latest.
Keep it live,
-
Derek Tan
,
Ibrahim Ulukaya
and
the YouTube Live Streaming Team
Spice up your channel with the InVideo Programming API
Wednesday, October 2, 2013
If you’ve used
InVideo Programming
before, you know that it’s a powerful way to attract subscribers to your channel. By featuring a watermark or a hit video on all videos on your channel, you can showcase the best of what your channel has to offer. You can also add a link to your home on social networks with a custom message to drive two-way conversation with your viewers on multiple fronts.
“That’s awesome,” you might say. “I’m already using it via the YouTube.com website!” Well, great! But did you know these options are available via our v3
Data API
? The API enables all kinds of interesting use cases. Some examples:
Update the message to tease your latest tweet. When users click on your link, they are taken to your Twitter page
Feature the most recent upload to
any
channel on YouTube
Run a channel about television? You can write a script to rotate the featured video depending on whether it is the afternoon or the evening, a weekday or a weekend! Or, rotate the featured video daily to drive more views, reshares and discussion of quality content that might not be as fresh
Build a widget on your website or mobile app that lets your subscribers vote for a video to be featured every week! The video doesn’t have to be a video from your channel - it can be
any
video on YouTube!
InVideo Programming options are set as part of the
channels resource
, passed as a parameter to
youtube.channels.update()
in the
invideoPromotion
field. For instance, to feature this recent “YouTube Developers Live” show featuring our team’s favorite moments, I would structure the
invideoPromotion
field in my API request’s payload body like this:
invideoPromotion": {
"items": [
{
"id": {
"type": "video",
"videoId": "
lzaYch2mqlU
"
},
"timing": {
"type": "offsetFromStart",
"offsetMs": "0",
"durationMs": "15000"
}
}
]
}
Other options for the type field in the
id
object include
website
and
recentUpload
, which correspond to InVideo Programming featuring a link, or automatically updating InVideo Programming featuring the latest video in a channel. For more information, see
the documentation describing the
invideoPromotion
object
in the channels resource.
A video featuring a watermark (top right) and InVideo Programming (bottom left)
Chances are good, though, that you’re using one of our
API client libraries
, which will help translate these API requests and responses into programmatic objects that you can manipulate and pass around in your code.
InVideo Programming functionality is relatively new, so if you are using an API client for a language like Java or .NET, you will need to make sure your client libraries are up-to-date before you can take advantage of these new features. Our samples are sorted by programming language on our
Github page
.
You can also set a channel’s watermark using the Data API’s
watermarks.set
() method. Watermarks are images that appear in the upper right hand corner of your videos that will link viewers to your channel on web and in the YouTube mobile apps for Android and iOS. This is usefu
InVideo Programming lets you reinforce your channel’s brand and drive viewers to other videos or social channels. The API makes it easy for your team to integrate InVideo Programming into your tools and workflow to make them more dynamic and interesting. Integrating the API into your tools and workflow only help to make your InVideo Programming more dynamic.
Happy coding!
-
Ikai Lan
,
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
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