YouTube Android Player API
Written by Kay Ewbank   
Tuesday, 10 July 2012

A YouTube Android Player API was  'pre-announced' at Google I/O, and while the full announcement and release is still in the future, the API is available for use now.

Displaying and viewing YouTube content on Android devices currently means using the YouTube app or some compromise in ease of use or functionality. The new API will provide a native YouTube video experience, with full player controls from within your apps, meaning your users can view the videos without leaving your app.

You can get an overview of the API from the Google I/O session video:

 

The API is suitable for use with Android on mobiles, tablets and Google TV, and you’ll be able to carry out the basic coding to integrate videos in just three lines. The API has automatic support for full-screen change of orientation, and will adjust the quality of the stream according to the strength of the network connection. There’s even support for paid content.

There are actually several YouTube APIs alongside a collection of tools. The Data API can be used to carry out most of the operations a normal YouTube user can on the YouTube website.

youtubeplayer

The Player APIs let you control the YouTube player using JavaScript or ActionScript. You get a choice of using the basic embedded player, which already contains player controls, or the chromeless player, which lets you create your own player controls.

The embedded player is sufficient if you just want to add a player to your website to show individual videos or a playlist, though it can be customized to use a different color player or to alter some behaviors. It can also be used in conjunction with the Data API, so your app can find a video using the Data API and then display it using the embedded player. The player can be controlled using JavaScript or ActionScript from within a Flash application.

In either case, you can mimic user actions such as pausing the video, seeking ahead, and muting the sound. You can also poll the status of the player and listen for events, to let your code react to whatever the player is currently doing.

Next in complexity is the chromeless Player. This lets you display and work with a YouTube video with no controls, and it exposes the same JavaScript and ActionScript APIs as the embedded player does.

youtubeicon

The Data API gives you everything you need to program a device or server-side logic for a website. You can use it to search for videos, retrieve standard feeds, and see related content. The API also lets your apps authenticate as a user to upload videos, and to modify user playlists. It gives you the means to work programmatically with the video and user information stored on YouTube.

The API manages the XML and HTTP requests and responses that the YouTube API servers expect and return. To make working with the API easier, Google has put together a number of client libraries that abstract the API into a language-specific object model, including Java, .NET, PHP, and Python.

More Information

YouTube API Overview Guide

 

blog comments powered by Disqus

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


Hijacking Chromecast Is Easy
23/07/2014

Chromecast, Google's streaming video USB stick, has a really clever way of allowing users to set it up. The trouble is that it might just be too clever. It turns out that what is easy for users to set [ ... ]



Visual Studio 14 CTP 2 - NO CAPS
24/07/2014

It seems almost silly to lead a story about the next version of Visual Studio with the fact that it might have dropped the ALL CAPS menu items, but it is an indication that the team is trying to fix V [ ... ]


More News

Last Updated ( Tuesday, 10 July 2012 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.