Wednesday, August 28, 2013

Here’s my playlist, so submit a video, maybe?

Update: YouTube Direct Lite for iOS is now available as well. This version demonstrates best practices for using the YouTube APIs on iOS.

YouTube Direct Lite allows you to solicit videos from your users and then moderate those submissions into standard YouTube playlists for display. And now there is an app for that.

With the YouTube Direct Lite apps (Android, iOS), your fans can

  • record a new video,
  • upload an existing video from their device,
  • pick one of their own YouTube uploads

and submit to your playlist, all from their Android device. You can then moderate their submissions, which won't show up in your playlist till you explicitly approve them.

YouTube Direct Lite platform doesn’t require any server-side code that needs to be configured or deployed. As the moderator, you will see a playlist of videos waiting for your approval. The videos you approve, will be added into your channel.


How to start using the Android application

1) Register your Android app
2) Enable the Youtube Data API v3 and Google+ API in your API Console.
3) Include the Google Play Services library in your project to build this application.
4) Plug your Playlist Id into Constants.java and Android API Key into Auth.java

Main ActivityYouTube playerUpload Service
Main ActivityYouTube playerUpload Service



How to start using the iOS application

2) Plug your Playlist Id, Client ID and Client Secret into Utils.h
2) Install the Google Client Library.
3) Run the sample

Main Activity     YouTube player     Upload Service
Uploads PlaylistiFrame Player
YouTube Upload




Open-sourced to reference best practices of YouTube APIs on Android and iOS

YouTube Direct Lite apps (Android, iOS) are open-sourced projects and you are more than welcome to customize them for your needs. You can also contribute back to the projects with bug reports, feature or merge requests.

Android application uses the YouTube Data API v3, YouTube Android Player API, YouTube Resumable Uploads, Google Play Services and Plus API.

In addition to Android best practices for the YouTube APIs, this project follows the design and development guidelines for Android. This project adheres to Holo style, typography, 48dp rhythm, iconography and uses IntentService, BigPictureStyle notification, and GoogleAccountCredential.

iOS application uses the YouTube Data API v3, the YouTube iFrame Player API, and YouTube Resumable Uploads.


In addition, in these videos, we talk about the philosophy we followed in building these apps and a few best practices for the Youtube APIs, Android, and iOS development.



This App is still experimental, so stay tuned here and subscribe to the YouTube for Developers channel to keep up on the latest.

Cheers,
Ibrahim Ulukaya, YouTube API Team

Thursday, July 25, 2013

Drive YouTube subscriptions from your web site

(Cross-posted from the YouTube Creator blog.)

To build your YouTube audience from all of your web properties, you can now embed the YouTube subscribe button on your site. This lets your fans subscribe with a single click without leaving your site. Once fans subscribe, they can see your channel on their YouTube homepage, phone, tablet, Playstation 3, smart TVs and millions of other devices.

Here’s what the subscribe button looks like on Vice.com in the bottom-right corner of this screenshot:


To put the subscribe button on your site, just embed the code below like you’d embed a YouTube video.
<script src="https://apis.google.com/js/plusone.js"></script>
<div class="g-ytsubscribe" data-channel="Your Channel Name Here">
</div>

Check out this documentation if you want to customize the button or dive into the details.

Kurt Wilms, Product Manager, recently watched “Stjarnan FC show how to celebrate a goal.”

Monday, June 24, 2013

Google+ page identities and the YouTube API

As more YouTube channels start using Google+ page identities, here are some best practices to ensure that your code can make authorized API calls to access the channel.


With Google+ page identities, there can be many channels associated with a single Google Account. For example, when a user Alice Smith signs into her Google Account, she may have her “Alice Smith” (personal) channel on that account, and potentially additional channels, linked to Google+ pages, on associated accounts. These associated accounts do not have a password by default; she gets access to them by signing into her personal account, and then using a switcher to go back and forth between them.


How does this channel selection work with APIs? With API access through web-based OAuth 2, the switcher comes automatically. The web flow will ask Alice which account she wants to use, after she signs into her “Alice Smith” account. The OAuth 2 tokens your application gets back work just as they do today.


The OAuth 2 web-based “Select an account” interface, allowing a user to grant access to their personal channel or any channels linked to Google+ pages that they manage.


If you’re not using web-based OAuth 2 (you are still relying on one of our deprecated authorization methods), or if you are an Android developer who is using OAuth 2 (there is currently no native Android account switcher), then the API will choose the “wrong” channel in some cases, or even no channel (e.g., if the personal account doesn’t have a channel). When this happens, the user has two options to specify the correct channel:


As a best practice, we recommend that you ensure users know of these options, so your application will access the correct channel. Even more importantly, we recommend that all applications provide visual feedback letting users know which channel is currently authorized. If you’re still using version 2 of the YouTube Data API, you can retrieve the profile of the special identifier default; this corresponds to the currently authorized channel’s profile. In the version 2 response, the channel’s display name is returned as an attribute of yt:username, and the profile image can be found by looking at media:thumbnail. If you’ve started using version 3, then the method to use is channels.list() with the part=snippet and mine=true parameters set. The version 3 response contains a channel’s display name in channel.snippet.title and profile image in channel.snippet.thumbnails.default.url.


To summarize, here are the high-level points to keep in mind:
  • OAuth 2 will automatically display a “Select an account” web interface, allowing users with multiple channels associated with their account to choose which one they’re authorizing access to.
    • ...this doesn’t apply to Android OAuth 2, yet.
  • Use of other authorization methods will mean some users need to specify which channel to use, either in their Advanced Account Settings (if they consistently use one channel), or by setting up login credentials for each channel, and using them as needed.
  • All developers are strongly encouraged to display visual feedback letting their users know which channel is currently authorized.


Update: This YouTube Developers Live show with Sherry Listgarten, the Product Manager responsible for Google+ and YouTube integration, goes into more details about plans for Google identities and YouTube channels. It also contains a video walkthrough of many of the points covered in this blog post.



Cheers,
Jeff Posnick, YouTube API Team

Friday, May 10, 2013

Find the hidden patterns with YouTube’s new Analytics API


Trying to figure out how YouTube’s one billion monthly users are interacting with your videos? Try the new YouTube Analytics API to get custom reports of the YouTube statistics you care about in a direct JSON or CSV response, perfect for dashboards and ad hoc reports. 

The new API includes all the standard view and engagement metrics you would expect, including views, shares, and subscriber numbers. Compared to the previous Insight Data API, you also get:
  • Watch metrics: Track estimated minutes watched across channel, content owner, or video, and dive into the video details with average view time and average view percentage.
  • Earning performance metrics: Track estimated earnings (net revenue) from select advertising sources across your content.
  • Ad performance metrics: Break down video performance with monetized playbacks, ad impressions, gross revenue, and cost per impression reports.
  • Annotation metrics: Optimize overlays/annotations with click through and close rate metrics.
Client Libraries and Code Samples
You’ll find client libraries for the languages you use most, with nine different languages available today. You can also make HTTP RESTful requests directly, and with our API Explorer, you can try out sample reports before writing any code.  

Don’t write your code from scratch! Get started with code examples in Java, JavaScript, Python, and Ruby. If you want a step-by-step walkthrough of building a complete web application, have a look at our JavaScript exercise.  

App Examples
Check out some apps that are already using the API: 

Next Big Sound
Next Big Sound
VidIQ
VidIQ
  • Next Big Sound provides analytics and insights for the music industry by tracking billions of social signals including YouTube. This enables record labels, artists, and band managers to make better decisions on everything from promotion strategies to tour locations.
  • vidIQ is an audience development suite that works with global brands to organically grow their views and subscribers. Their features include cross-platform social analytics, advanced comment management, SEO tools, social syndication and influencer identification. 
Wizdeo
Wizdeo
Vidyard
Vidyard













  • Wizdeo’s WizTracker provides in-depth analysis of YouTube channels to help with cross promotion and video comparisons during their initial launch. Users get access to detailed analytics about views, subscriber engagement, traffic sources and demographics.
  • Vidyard is a video marketing platform. With powerful analytics, built-in marketing tools, and integration with key marketing automation platforms, Vidyard helps marketers drive results with video content.  
Fullscreen
Fullscreen
  • Fullscreen is building a global network of YouTube channels with content creators and brands. Fullscreen provides a full suite of end-to-end YouTube tools and uses the new API for internal, business-intelligence tools.  

Learn More
In addition to the documentation, check out our Analytics API playlist to make getting started even easier.  



If your goal is to export all statistics for a large number of channels on a recurring basis for your data warehouse, look forward to using the upcoming scheduled reports feature of the API, expected to launch later this year.

To get more info on the YouTube APIs, subscribe to our YouTube for Developers’ channel and YouTubeDev on Google+. 

Cheers,
-- Ted Hamilton, Christoph Schwab-Ganser, and the YouTube Analytics API Team 

Thursday, May 9, 2013

We’re going live from Google I/O

Author PhotoBy Mike Winton, Director of Developer Relations

(Cross-posted from the Google Developers Blog)

At Google I/O 2013, we will share the future of our platforms with you. Developers from all over the world are the key innovators of powerful, breakthrough technologies, and that’s why we challenged ourselves to make the Google I/O experience available to every developer, everywhere.
Watch Google I/O live
From the comfort of your own home, office, secret lair, or anywhere you have a reliable Internet connection, you can stream Google I/O May 15-16 live. Brought to you by Google Developers Live (GDL), the Google I/O homepage will become the GDL at I/O live streaming hub starting on May 15th at 9:00 AM PT (16:00 UTC). From this page, you can:
  • Stream 4 channels of technical content on your computer, tablet, or phone. You’ll feel like you’re right there in the keynote and session rooms, listening to product announcements straight from the source. Live streaming will run on developers.google.com/io from 9 AM PT (16:00 UTC) to 7 PM PT (2:00 UTC) on May 15 and 16.
  • Watch exclusive interviews with the Googlers behind the latest product announcements. This year, GDL will be on site, broadcasting one-on-one product deep dives, executive interviews, and Sandbox walkthroughs from the GDL stage.
  • Get the latest news in real-time. We’ll be posting official announcements during I/O. You’ll be able to see the feed on the Google I/O homepage, in the I/O mobile app (coming soon), and on +Google Developers.
  • Never miss a session. All Google I/O technical sessions will be recorded and posted to GDL and the Google Developers YouTube channel. Subscribe to our YouTube channel for archived session updates.
Live blog the keynote
Grab our live blogging gadget to add the keynote live stream to your own site or blog. Customize the gadget with your site or blog name, live blog alongside real-time Google announcements, and share a dynamic Google I/O experience with your readers. Have questions? For more info, check out our live blogging gadget FAQ.

Get together locally
Experience Google I/O with your local developer community by hosting or attending an I/O Extended event. If you’re hosting, register here and learn how to hold a totally epic event with our handy Organizer Guide. Otherwise, with over 400 sites in 90+ countries, chances are good that there is an I/O Extended event near you. Find an event now!

And before I/O, tune in to Google Developers Live programming to connect with Google engineers, prep for this year’s event, and browse our archived content. For official conference updates, add +Google Developers to your Circles, follow #io13 for big announcements, join the Google I/O community, and keep an eye on the Google I/O site.

Mike Winton founded and leads Google's global Developer Relations organization. He also enjoys spending time with his family and DJing electronic music.

Thursday, May 2, 2013

Streaming to YouTube Live? Put an API on it!

The YouTube Live Streaming API makes it easier to build tools and apps for channels that are enabled to stream live content on YouTube. With the YouTube Live platform, you have the ability to real-time transcode to a range of video qualities that support a broad set of devices and networks, dynamic bandwidth adjustment so viewers automatically see the highest quality stream their network supports, and DVR-like controls to allow viewers to pause, fast forward, and rewind during a live stream.


How to start developing with live streams

  • The basics
    • A broadcast represents a live event that you'll stream on YouTube. The API lets you schedule a broadcast, bind it to your live video stream, and update its status to testing, live, or complete.
    • A stream represents the actual broadcast content.
    • A cuepoint represents an ad break that can be inserted into a live broadcast. Cuepoints are only available to YouTube content partners.

  • Documentation
    • The Getting Started guide explains these concepts in more detail and explains how they interact with other YouTube Data API and YouTube Content ID API resources.
    • The Life of a Broadcast guide walks you through the typical steps for creating and managing a live broadcast on YouTube.
    • The YouTube Live Streaming Guide identifies the encoder settings, bitrates, and resolutions that the YouTube Live Streaming platform supports.

  • Sample 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.

In addition, in this video, we talk about the philosophy we followed in building the API and also see some great demos from our partners.



Awesome examples

Here are a few great examples from developers already using the API:

Capella’s Cambria Live
Capella’s Cambria Live

  • Capella’s Cambria Live encodes live broadcasts in real time and streams them to YouTube Live. Cambria Live takes uncompressed broadcast video directly from a camera via SDI or HDMI and compresses it into the H.264 format with AAC audio, ensuring optimal video and audio quality.

Elgato Game Capture HD
Elgato

  • Elgato Game Capture HD enables you to stream PlayStation or Xbox gameplay to share it with your friends and fans as it happens. Elgato’s video products enable high-quality video recording and conversion for consumers and professionals alike.

XSplit
Radioline
XSplit Radioline
  • XSplit is a streaming and video-mixing application that is fun and easy to use. It is widely-used for streaming games.

  • Radioline designs and operates a cloud-based mobile internet radio. You can find or discover new radio stations according to their names, genres, areas or according to your favorite playlists.

This API is still experimental, so stay tuned here and subscribe to the YouTube for Developers channel to keep up on the latest.

Cheers,
-- Derek Tan, Satyajeet Salgar, and the YouTube Live Streaming API Team

Wednesday, April 17, 2013

The Helping Hand of an Expert

Have you ever been stuck working on a problem only to receive a solution from a friendly person you've never met? Some of the most helpful responses on Stack Overflow and open source code examples have been contributed by our YouTube API community members. The Google Developer Expert (GDE) program is designed to recognize the active and passionate YouTube API developers who make these outstanding contributions.


Each year, Google Developer Experts are selected for their existing accomplishments using Google technologies, their continued passion for these technologies, and their willingness to engage with and mentor other developers.

To learn more about what it’s like to be a GDE, check out this interview with two of our 2013 YouTube API GDEs, Matias Molinas from Argentina and Tim Wintle from the U.K. 



If you’d like to share your knowledge, connect with us on +YouTubeDev, contribute to Stack Overflow, and find like-minded developers at your local Google Developer Group (GDG)

Cheers,
—Jarek Wilkiewicz and Jeremy Walker, YouTube API Team