From a8d010163855f13859eb1cb97190f46d6b264a82 Mon Sep 17 00:00:00 2001 From: griffinf Date: Wed, 5 Jun 2024 17:26:13 -0700 Subject: [PATCH] [APT-10128] Fixed the order of dispatched actions during seek related 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 --- .../main/java/com/scribd/armadillo/playback/PlaybackEngine.kt | 2 +- RELEASE.md | 3 +++ gradle.properties | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Armadillo/src/main/java/com/scribd/armadillo/playback/PlaybackEngine.kt b/Armadillo/src/main/java/com/scribd/armadillo/playback/PlaybackEngine.kt index 5935668..5d9c341 100644 --- a/Armadillo/src/main/java/com/scribd/armadillo/playback/PlaybackEngine.kt +++ b/Armadillo/src/main/java/com/scribd/armadillo/playback/PlaybackEngine.kt @@ -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) } } \ No newline at end of file diff --git a/RELEASE.md b/RELEASE.md index feee41f..ffd0436 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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 diff --git a/gradle.properties b/gradle.properties index 280d925..1fb9cb9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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