react-native-track-player
react-native-track-player copied to clipboard
Queue improvements
A few improvements to functionalities relying on updates of the underlying SwiftAudioEx and KotlinAudio libraries.
SwiftAudio updates pr: https://github.com/doublesymmetry/SwiftAudioEx/pull/28.
KotlinAudio updates pr: https://github.com/doublesymmetry/KotlinAudio/pull/50
Feature
- Implement
TrackPlayer.load(track): replaces the current track with the supplied track or creates a track when the queue is empty. This feature would mainly be used by simple single track apps – for example a radio station app - Implement
TrackPlayer.move(fromIndex, toIndex) - Implement
TrackPlayer.getProgress() - Deprecate
TrackPlayer.getBufferedPosition(),TrackPlayer.getDuration(),TrackPlayer.getPosition().
Fix
- Queue methods that modify the queue no longer mutate
playWhenReady, so when TrackPlayer is in playing mode it stays so and opposite (https://github.com/doublesymmetry/react-native-track-player/issues/1691) - Calling
TrackPlayer.remove(index)on the current track no longer throws, instead it activates the next track (or the first track if there is no next track). - Calling
TrackPlayer.jump(index)whereindexis the index of the active track no longer throws, instead it causes the track to be restarted.