The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications. The API defines methods for loading and playing YouTube videos (and playlists) and for customizing and controlling the video playback experience.
Using the API, you can load or cue videos into a player view embedded in your application's UI. You can then control playback programmatically. For example, you can play, pause, or seek to a specific point in the currently loaded video.
You can also register event listeners to get callbacks for certain events, such as the player loading a video or the player state changing. Finally, the API has helper functionality to support orientation changes as well as transitions to fullscreen playback.
This app shows how to use a YouTubePlayerView to play a video.
This app shows how to use a YouTubePlayerFragment to play a video.
This app displays several custom controls to demonstrate the use of YouTubePlayer programmatic controls. The app shows a dropdown menu that cues a video or a playlist, a play button, a pause button, and an input field that lets you specify a point to skip to in the video. It also shows an event log that lists player state changes as they happen.
This app demonstrates the best practice for handling fullscreen video playback. This custom fullscreen handling method is preferred because the YouTube player's default fullscreen implementation causes rebuffering of the video.
This app shows how you can overlay an action bar on the player when it is in fullscreen mode.
This app shows how to use a YouTubeStandalonePlayer intent to start a standalone YouTube player in a separate activity. This player can either be fullscreen or it can appear as a dialog above the current activity.
This app uses the static methods in the YouTubeIntents class to create Intents that navigate the user to Activities within the main YouTube application on the device.
Read more about Samples here: https://developers.google.com/youtube/android/player/sample-applications
This project contains YouTube Android Player API oringinally written in Java by Google which is projected to C# using Bindings
Solution contains two projects:
- YouTube Android Player API for Xamarin.Android. (YouTubeApi)
- Samples (again a port from Java) (YouTubeDemo)
Original Java Samples and YouTube Android Player API can be found here
- Make sure you get a developer key from Google: https://developers.google.com/youtube/android/player/register
- Add the Public Access API key to the class DeveloperKey.cs class
- Connect an Android device running version 4.2.16 or later of the YouTube app.
VideoWall Sample is still in the TODO list.
Let me know! @nishanil