diff --git a/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt b/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt index c244449..cd8188f 100644 --- a/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt +++ b/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt @@ -19,7 +19,9 @@ import android.widget.ImageView import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.media3.common.MediaItem +import androidx.media3.exoplayer.DefaultLoadControl import androidx.media3.exoplayer.ExoPlayer +import androidx.media3.exoplayer.upstream.DefaultAllocator import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.squareup.picasso.Picasso @@ -114,9 +116,19 @@ class ReproductorActivity : AppCompatActivity() { AsyncTask.execute { val video = this.clientVideo.getVideo(this.video.uuid) + // TODO: Make this configurable + val bufferSize = 1024 * 1024 // 1mb + val allocator = DefaultAllocator(true, bufferSize) + val loadControl = DefaultLoadControl.Builder() + .setAllocator(allocator) + .build() + runOnUiThread { try { - player = ExoPlayer.Builder(this.baseContext).build() + player = ExoPlayer.Builder(this.baseContext) + .setSeekBackIncrementMs(10000) + .setSeekForwardIncrementMs(10000) + .setLoadControl(loadControl).build() exoPlayer.player = player println("----- video --------")