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

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

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


Interact With Virtual Historic Computers
14/04/2024

Alan Turing's ACE computer is a legendary computer that is particularly special for I Programmer - our account of it was the first ever history article on the site when it launched in 2009. Now this i [ ... ]



Explore SyncFusion's Blazor Playground
16/04/2024

Syncfusion has provided an in-browser environment where you can write, compile and run code that uses Blazor components and get it previewed live.


More News

Last Updated ( Tuesday, 10 July 2012 )