Add seek buttons for videos longer than 30s.

This commit is contained in:
Nicholas
2022-10-18 16:00:12 -04:00
committed by Alex Hart
parent 7f4e964ec8
commit 32fbbf2b55
5 changed files with 36 additions and 13 deletions

View File

@@ -222,7 +222,7 @@ public class VideoPlayer extends FrameLayout {
super.setOnClickListener(l);
}
public @Nullable View getControlView() {
public @Nullable PlayerControlView getControlView() {
return this.exoControls;
}

View File

@@ -61,6 +61,8 @@ class SimpleExoPlayerPool(context: Context) : ExoPlayerPool<ExoPlayer>(MAXIMUM_R
override fun createPlayer(): ExoPlayer {
return ExoPlayer.Builder(context)
.setMediaSourceFactory(mediaSourceFactory)
.setSeekBackIncrementMs(SEEK_INTERVAL.inWholeMilliseconds)
.setSeekForwardIncrementMs(SEEK_INTERVAL.inWholeMilliseconds)
.build()
}
@@ -68,6 +70,7 @@ class SimpleExoPlayerPool(context: Context) : ExoPlayerPool<ExoPlayer>(MAXIMUM_R
private const val MAXIMUM_RESERVED_PLAYERS = 1
private const val MAXIMUM_SUPPORTED_PLAYBACK_PRE_23 = 6
private const val MAXIMUM_SUPPORTED_PLAYBACK_PRE_23_LOW_MEM = 3
private val SEEK_INTERVAL = 15.seconds
}
}