Audio player for iOS
Fixes a bug where the ready
event never fires if playWhenReady: true
.
Fixes a problem where the initial time feature would not work if playWhenReady
is true
.
The AudioPlayer
now has an additional state: buffering
, along with a different pattern for when it is in which state. The state will behave like this:
As before idle
is when no item is loaded, and the player does nothing. When an item is loaded, the player will immediately enter the loading
state. When the item is loaded and ready for playback, it enters the ready
state. When playback has started it will enter either playing
or buffering
depending on if buffering is needed or not. As before, paused
indicates the paused state.
Now includes a load indicator as an example of how this can be used to give the user information about what the app is currently doing. It also includes an example of how to handle an error when loading an audio item with no internet connection.
Handles a failure in the AVPlayer by creating a new instance if a failure occurs.
didRecreateAVPlayer
event to the AudioPlayer
. This can be used to reset the AVAudioSession.Category
when a new instance of the AVPlayer
is created.If the player fails, a new (or the same) item will need to be loaded in order to trigger the creation of a new instance of the AVPlayer.
custom(time: CMTime)
case to the TimeEventFrequency
enumAudioPlayerDelegate
completely. Events should be used instead.Adds a bufferedPosition
property to the player, returning the current seconds that are buffered of an AudioItem
.