Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.49 KB

File metadata and controls

45 lines (31 loc) · 1.49 KB

ExoPlayer Plugin for Xamarin

Xamarin bindings library for the Google ExoPlayer library.

For more information on ExoPlayer see the Android Developer documentation.

Plugin is available on Nuget.

Documentation

protected Com.Google.Android.Exoplayer.IExoPlayer mediaPlayer;
if (mediaPlayer == null) 
{ 
	mediaPlayer = Com.Google.Android.Exoplayer.ExoPlayerFactory.NewInstance(1);
} 
Android.Net.Uri soundString = Android.Net.Uri.Parse("http://www.montemagno.com/sample.mp3");

FrameworkSampleSource sampleSource = new FrameworkSampleSource(this, soundString, null); 
TrackRenderer aRenderer = MediaCodecAudioTrackRenderer(sampleSource, MediaCodecSelector.Default);

mediaPlayer.Prepare(aRenderer);
mediaPlayer.PlayWhenReady = true;

See the Exoplayer.Droid sample app.

Thanks to

License

  • ExoPlayerXamarin plugin is licensed under MIT