YouTube Unveils Its Native Player API For Android, Enabling In-App Video, Ad Support And More

Posted on Dec 24 2012 - 10:49am by Editorial Staff


With announced first back in Google I/O 2012, Google’s video sharing site YouTube finally brings a native player API for Android, although it is still in experimental stage. The native player APIU will let developers embed and play YouTube videos within their apps while also receiving the support for YouTube ads.

The API is available for those apps that are on devices with Android 2.2 or newer. The company as per the post believed that the API is well-documented along with giving instructions on how to include the API client library in any application.

These instructions explain how to include the YouTubeAndroidPlayerApi.jar client library in your Android application. The library is supported on Android devices running version 4.2.16 or newer of the Android YouTube app.

You can use the YouTubeApiServiceUtil class’ isYouTubeApiServiceAvailable method to confirm that a device is compatible.

For a simple embed, use the YouTubeStandalonePlayer. To build a more sophisticated user interface, try the YouTubePlayerView or the YouTubePlayerFragment. Fragments can help create an engaging experience as shown in the Video Wall app example.

About the Author

Editorial Staff at I2Mag is a team of subject experts.