mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
test: implemented and temporarily set aside the implementation of a customLoadController
This commit is contained in:
parent
dee60e5e8f
commit
10aae5fa15
2 changed files with 22 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ import androidx.media3.cast.CastPlayer
|
|||
import androidx.media3.cast.SessionAvailabilityListener
|
||||
import androidx.media3.common.*
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.exoplayer.DefaultLoadControl
|
||||
import androidx.media3.exoplayer.ExoPlayer
|
||||
import androidx.media3.exoplayer.source.DefaultMediaSourceFactory
|
||||
import androidx.media3.session.*
|
||||
|
|
@ -207,6 +208,7 @@ class MediaService : MediaLibraryService(), SessionAvailabilityListener {
|
|||
.setAudioAttributes(AudioAttributes.DEFAULT, true)
|
||||
.setHandleAudioBecomingNoisy(true)
|
||||
.setWakeMode(C.WAKE_MODE_NETWORK)
|
||||
// .setLoadControl(initializeLoadControl())
|
||||
.build()
|
||||
}
|
||||
|
||||
|
|
@ -291,6 +293,17 @@ class MediaService : MediaLibraryService(), SessionAvailabilityListener {
|
|||
})
|
||||
}
|
||||
|
||||
private fun initializeLoadControl(): DefaultLoadControl {
|
||||
return DefaultLoadControl.Builder()
|
||||
.setBufferDurationsMs(
|
||||
60_000,
|
||||
120_000,
|
||||
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS,
|
||||
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS
|
||||
)
|
||||
.build()
|
||||
}
|
||||
|
||||
private fun setPlayer(oldPlayer: Player?, newPlayer: Player) {
|
||||
if (oldPlayer === newPlayer) return
|
||||
oldPlayer?.stop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue