ESAudioPlayer: A reactive audio player for iOS
ESAudioPlayer is a reactive audio player for iOS using RxSwift. It provides basic audio management features like playing an audio from a URL. And some more advanced features like queue management, MediaPlayer transport controls and now playing center info.
- Completely abstracted player details, only reactive layer is exposed for use
- Optimized performance for managing long queues
- Basic track management (Play, pause, resume)
- Queue management (Shuffle, repeat, next, previous, etc...)
- Speed management
- Seek forward, backwards or to a specific point
- Handle remote command center actions (Play, pause, next, previous, change playback position)
- Handle updating now playing center
- Swift version 5 or higher
- iOS 13 or higher
- Dependency on RxSwift as it's used to make player reactive
ESAudioPlayer is available through CocoaPods. To install it, simply add the following line to your Podfile:
To run the example project, clone the repo, and run
pod install from the Example directory first.
🗝 How to use ESAudioPlayer?
- Use the
ESAudioPlayer, creating a new instance is disabled.
- Pass a track or a list of tracks to play through the
play(list:), which take
- Subscribe to the changes your interested in:
state: Returns the player's current state (playing, buffering, paused, stopped, error)
currentTrack: Returns the track that is currently in the player (Whether it's playing or paused)
queue: Returns the queue that is currently in the player
currentTime: Returns the current position of the player in minutes and seconds
trackDuration: Returns the full time of the player in minutes and seconds
currentSpeed: Returns the currently selected playback speed
isShuffleOn: Returns whether the repeat or shuffle are turned on or not respectively
Mario Mouris, firstname.lastname@example.org
ESAudioPlayer is available under the MIT license. See the LICENSE file for more info.