[Android] Invoke publishState() on video player seek

Robert Stone git at videolan.org
Wed Nov 25 14:40:32 CET 2020


vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Tue Nov 24 19:08:25 2020 -0800| [0dd7925bb0d4d28f9d3eee777daee843b1beaa14] | committer: Nicolas Pomepuy

Invoke publishState() on video player seek

> https://code.videolan.org/videolan/vlc-android/commit/0dd7925bb0d4d28f9d3eee777daee843b1beaa14
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index d9aeeb98f..cc53e83c9 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -268,7 +268,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
 
         override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
             if (!isFinishing && fromUser && service?.isSeekable == true) {
-                seek(progress.toLong())
+                seek(progress.toLong(), fromUser)
                 overlayDelegate.showInfo(Tools.millisToString(progress.toLong()), 1000)
             }
             if (fromUser) {
@@ -1545,15 +1545,15 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
         }
     }
 
-    fun seek(position: Long) {
-        service?.let { seek(position, it.length) }
+    fun seek(position: Long, fromUser: Boolean = false) {
+        service?.let { seek(position, it.length, fromUser) }
     }
 
-    internal fun seek(position: Long, length: Long) {
+    internal fun seek(position: Long, length: Long, fromUser: Boolean = false) {
         service?.let { service ->
             forcedTime = position
             lastTime = service.time
-            service.seek(position, length.toDouble())
+            service.seek(position, length.toDouble(), fromUser)
             service.playlistManager.player.updateProgress(position)
         }
     }



More information about the Android mailing list