mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
Prevent controls from disappearing while scrubbing
This commit is contained in:
parent
fb0054d15e
commit
0821ac66db
@ -45,6 +45,7 @@ import com.google.android.exoplayer2.ui.AspectRatioFrameLayout
|
|||||||
import com.google.android.exoplayer2.ui.CaptionStyleCompat
|
import com.google.android.exoplayer2.ui.CaptionStyleCompat
|
||||||
import com.google.android.exoplayer2.ui.StyledPlayerView
|
import com.google.android.exoplayer2.ui.StyledPlayerView
|
||||||
import com.google.android.exoplayer2.ui.SubtitleView
|
import com.google.android.exoplayer2.ui.SubtitleView
|
||||||
|
import com.google.android.exoplayer2.ui.TimeBar
|
||||||
import com.google.android.exoplayer2.util.RepeatModeUtil
|
import com.google.android.exoplayer2.util.RepeatModeUtil
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
@ -183,6 +184,19 @@ internal class CustomExoPlayerView(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// prevent the controls from disappearing while scrubbing the time bar
|
||||||
|
binding.exoProgress.addListener(object : TimeBar.OnScrubListener {
|
||||||
|
override fun onScrubStart(timeBar: TimeBar, position: Long) {
|
||||||
|
cancelHideControllerTask()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onScrubMove(timeBar: TimeBar, position: Long) {
|
||||||
|
cancelHideControllerTask()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onScrubStop(timeBar: TimeBar, position: Long, canceled: Boolean) {}
|
||||||
|
})
|
||||||
|
|
||||||
playerViewModel?.isFullscreen?.observe(viewLifecycleOwner!!) { isFullscreen ->
|
playerViewModel?.isFullscreen?.observe(viewLifecycleOwner!!) { isFullscreen ->
|
||||||
if (isFullscreen) {
|
if (isFullscreen) {
|
||||||
windowHelper?.setFullscreen()
|
windowHelper?.setFullscreen()
|
||||||
|
Loading…
Reference in New Issue
Block a user