A Wrapper over the Android Media Player Library that Plays a Media with Audio focus
- Audio Focus player can be used to play any Media with Audio Focus
- This library can be used to play a media with a Uri
- Supports android versions above Android Oreo 8.0 ( API level 26 )
- This library has a simple interface just Like Media Player API in android
Add this in your build.gradle
implementation 'com.avirias.audiofocus:audiofocus:1.0.0'
Then initialize it in onCreate() Method of Activity or Fragment :
AudioFocusPlayer audioFocusPlayer = new AudioFocusPlayer(context);
Initializing it with some customization
// Set a Datasource
audioFocusPlayer.setDataSource(yourMediaUri);
Play or Pause it
// Play the Media
audioFocusPlayer.play();
// Pause the Media
audioFocusPlayer.pause();