playback: hack around paused seeking issue
Hack around an issue where the notification position will not update if one seeked while the player was paused. This is the best implementation I can do that will not result in the notification getting excessively rate-limited.
This commit is contained in:
@@ -241,6 +241,15 @@ class MediaSessionComponent(
|
||||
reason: Int
|
||||
) {
|
||||
invalidateSessionState()
|
||||
|
||||
if (!playbackManager.isPlaying) {
|
||||
// Hack around issue where the position won't update after a seek (but only when it's
|
||||
// paused). Apparently this can be fixed by re-posting the notification, but not always
|
||||
// when we invalidate the state (that will cause us to be rate-limited), and also not
|
||||
// always when we seek (that will also cause us to be rate-limited). Someone looked at
|
||||
// this system and said it was well-designed.
|
||||
callback.onPostNotification(notification, "position discontinuity")
|
||||
}
|
||||
}
|
||||
|
||||
// --- MEDIASESSION CALLBACKS ---
|
||||
|
||||
Reference in New Issue
Block a user