Skip to content

Commit

Permalink
[APT-10128] Fixed the order of dispatched actions during seek related…
Browse files Browse the repository at this point in the history
… events

Currently the order of the actions dispatched on a seeking action:
Intial Seeking action (Skip distance, Prev chapter, seek position, etc.)
Finish Seeking action because we immediately call exoplayer to seek to the new position and this triggers the Seek listeners with the current armadillo state without playback info being updated.
Then dispatch PlaybackProgressAction with the new position that updates the armadillo state's playback info

Instead we reverse the order of the finish seek action and PlaybackProgressAction so we are able to update the playback info progress before the finish seek occurs so it has the correctly updated playback info
  • Loading branch information
griffinfscribd committed Jun 6, 2024
1 parent 7f123c9 commit a8d0101
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ internal class ExoplayerPlaybackEngine(private var audioPlayable: AudioPlayable)
}

private fun seekToExo(position: Milliseconds) {
exoPlayer.seekTo(exoPlayer.currentMediaItemIndex, position.longValue)
stateModifier.dispatch(PlaybackProgressAction(position, exoPlayer.playerDuration()))
exoPlayer.seekTo(exoPlayer.currentMediaItemIndex, position.longValue)
}
}
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Project Armadillo Release Notes

## 1.3.2
- Added a fix for order of dispatched actions during seek related events

## 1.3.1
- Adds support for offline DRM for downloaded MPEG-DASH audio

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
PACKAGE_NAME=com.scribd.armadillo
LIBRARY_VERSION=1.3.1
LIBRARY_VERSION=1.3.2
EXOPLAYER_VERSION=2.17.1
RXJAVA_VERSION=2.2.4
RXANDROID_VERSION=2.0.1
Expand Down

0 comments on commit a8d0101

Please sign in to comment.