[Android] Use audioJumpDelay for fast forward and rewind callback

Robert Stone git at videolan.org
Thu Feb 3 09:01:34 UTC 2022


vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Mon Jan 17 00:00:33 2022 -0800| [4dbe76ff5f23712fd2e0e7627d28c6b62462977d] | committer: Nicolas Pomepuy

Use audioJumpDelay for fast forward and rewind callback

> https://code.videolan.org/videolan/vlc-android/commit/4dbe76ff5f23712fd2e0e7627d28c6b62462977d
---

 .../vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt b/application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
index 3e213f73c..2fe5ecb4e 100644
--- a/application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
+++ b/application/vlc-android/src/org/videolan/vlc/MediaSessionCallback.kt
@@ -33,7 +33,7 @@ import kotlin.math.min
 
 @Suppress("unused")
 private const val TAG = "VLC/MediaSessionCallback"
-private const val TEN_SECONDS = 10000L
+private const val ONE_SECOND = 1000L
 
 @ObsoleteCoroutinesApi
 @ExperimentalCoroutinesApi
@@ -323,12 +323,12 @@ internal class MediaSessionCallback(private val playbackService: PlaybackService
     override fun onSeekTo(pos: Long) = playbackService.seek(if (pos < 0) playbackService.getTime() + pos else pos, fromUser = true)
 
     override fun onFastForward() {
-        playbackService.seek((playbackService.getTime() + TEN_SECONDS).coerceAtMost(playbackService.length), fromUser = true)
+        playbackService.seek((playbackService.getTime() + Settings.audioJumpDelay * ONE_SECOND).coerceAtMost(playbackService.length), fromUser = true)
         checkForSeekFailure(forward = true)
     }
 
     override fun onRewind() {
-        playbackService.seek((playbackService.getTime() - TEN_SECONDS).coerceAtLeast(0), fromUser = true)
+        playbackService.seek((playbackService.getTime() - Settings.audioJumpDelay * ONE_SECOND).coerceAtLeast(0), fromUser = true)
         checkForSeekFailure(forward = false)
     }
 



More information about the Android mailing list