Skip to content

shhadi/YouTubeAndroidPlayer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Android Player for Xamarin.Android

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.

YouTube Screen1 YouTube Screen2 YouTube Screen4 YouTube Screen4 YouTube Screen3

Samples:

Simple PlayerView

This app shows how to use a YouTubePlayerView to play a video.

Simple PlayerFragment

This app shows how to use a YouTubePlayerFragment to play a video.

Custom Player Controls

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.

Custom Fullscreen Handling

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.

Overlay ActionBar Demo

This app shows how you can overlay an action bar on the player when it is in fullscreen mode.

Standalone Player

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.

YouTube App Launcher Intents

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

Ported to C#

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

Running the project

TODO:

VideoWall Sample is still in the TODO list.

Stuck Somewhere?

Let me know! @nishanil

About

YouTube Android Player API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%