https://github.com/baseflow/exoplayerxamarin
Xamarin bindings library for the Google ExoPlayer library
https://github.com/baseflow/exoplayerxamarin
android baseflow c-sharp exoplayer google-exoplayer media mediaplayer nuget xamarin
Last synced: 7 months ago
JSON representation
Xamarin bindings library for the Google ExoPlayer library
- Host: GitHub
- URL: https://github.com/baseflow/exoplayerxamarin
- Owner: Baseflow
- License: mit
- Created: 2014-11-20T10:53:26.000Z (about 11 years ago)
- Default Branch: develop
- Last Pushed: 2024-01-23T12:54:35.000Z (almost 2 years ago)
- Last Synced: 2025-05-08T23:32:58.285Z (7 months ago)
- Topics: android, baseflow, c-sharp, exoplayer, google-exoplayer, media, mediaplayer, nuget, xamarin
- Language: C#
- Homepage: https://baseflow.com
- Size: 99.7 MB
- Stars: 153
- Watchers: 23
- Forks: 66
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
ExoPlayer Plugin for Xamarin
================

[](https://ci.appveyor.com/project/martijn00/exoplayerxamarin)
[](https://www.nuget.org/packages/Xam.Plugins.Android.ExoPlayer/)
[](https://www.nuget.org/packages/Xam.Plugins.Android.ExoPlayer/)
[](https://github.com/martijn00/ExoPlayerXamarin/releases)
[](https://www.myget.org/F/martijn00/api/v3/index.json)
Xamarin bindings library for the Google ExoPlayer [library][ExoPlayer].
ExoPlayer is an application level media player for Android. It provides an
alternative to Android’s MediaPlayer API for playing audio and video both
locally and over the Internet. ExoPlayer supports features not currently
supported by Android’s MediaPlayer API, including DASH and SmoothStreaming
adaptive playbacks. Unlike the MediaPlayer API, ExoPlayer is easy to customize
and extend, and can be updated through Play Store application updates.
# Support
* Feel free to open an issue. Make sure to use one of the templates!
* Commercial support is available. Integration with your app or services, samples, feature request, etc. Email: [hello@baseflow.com](mailto:hello@baseflow.com)
* Powered by: [baseflow.com](https://baseflow.com)
## Documentation ##
* The [developer guide][] provides a wealth of information.
* The [class reference][] documents ExoPlayer classes.
* The [release notes][] document the major changes in each release.
* Follow our [developer blog][] to keep up to date with the latest ExoPlayer
developments!
[developer guide]: https://google.github.io/ExoPlayer/guide.html
[class reference]: https://google.github.io/ExoPlayer/doc/reference
[release notes]: https://github.com/google/ExoPlayer/blob/release-v2/RELEASENOTES.md
[developer blog]: https://medium.com/google-exoplayer
## Using ExoPlayer ##
The ExoPlayer plugin is available on [Nuget][Nuget].
```c#
var HttpDataSourceFactory = new DefaultHttpDataSource.Factory().SetAllowCrossProtocolRedirects(true);
var MainDataSource = new ProgressiveMediaSource.Factory(HttpDataSourceFactory);
var Exoplayer = new IExoPlayer.Builder(Context).SetMediaSourceFactory(MainDataSource).Build();
MediaItem mediaItem = MediaItem.FromUri(Android.Net.Uri.Parse("https://ia800806.us.archive.org/15/items/Mp3Playlist_555/AaronNeville-CrazyLove.mp3"));
Exoplayer.AddMediaItem(mediaItem);
Exoplayer.Prepare();
Exoplayer.PlayWhenReady = true;
```
See the Exoplayer.Droid sample app for further details.
**IMPORTANT: Exoplayer 2.9.0 and up requires Visual Studio 2019 with R8 and D8. You also need to enable AAPT2. Readmore at: https://devblogs.microsoft.com/xamarin/androids-d8-dexer-and-r8-shrinker/**
Thanks to
=========
- [Nathan Barger][NathanBarger] for doing the initial porting work
- [MKuckert](https://github.com/MKuckert) for helping with bindings and samples
- [bspinner](https://github.com/bspinner) for helping with bindings and samples
License
=======
- **ExoPlayerXamarin** plugin is licensed under [MIT][mit]
[mit]: http://opensource.org/licenses/mit-license
[NathanBarger]: http://forums.xamarin.com/profile/NathanBarger
[ExoPlayer]: https://github.com/google/ExoPlayer
[Nuget]: https://www.nuget.org/packages/Xam.Plugins.Android.ExoPlayer/
[Developer]: http://developer.android.com/guide/topics/media/exoplayer.html