-
Notifications
You must be signed in to change notification settings - Fork 6k
Open
Labels
Description
I'm using ExoPlayer for RTSP streaming video.
When I initially set the mediaSource and prepare the player, the video starts to play after ~10sec.
So, the video is already 10 sec behind the edge of the stream.
I use a listener like this:
override fun onPlaybackStateChanged(state: Int) {
super.onPlaybackStateChanged(state)
if (state == Player.STATE_READY) {
val bufferedPosition = exoPlayer.bufferedPosition
exoPlayer.seekTo(bufferedPosition)
}
}
in order to seek to the end of the stream once the video starts to play.
This cause a delay of another 10 seconds that the video freezes (due to buffering) but at the end the player almost is synced to the end of the stream.
I use this configuration for load control and livePlaybackSpeedControl:
val loadControl = DefaultLoadControl.Builder()
.setBufferDurationsMs(
400,
3000,
400,
400
)
.build()
val livePlaybackSpeedControl = DefaultLivePlaybackSpeedControl.Builder()
.setFallbackMinPlaybackSpeed(0.5f)
.setFallbackMaxPlaybackSpeed(1.5f)
.build()
Is there anything I can do to minimize these 10 seconds delays?
Thanks in advance!