'Android ExoPLayer AudioTrack Underrun Occurred

I am playing with Exoplayer.

I have an exoplayer in RecyclerView, and only show one exoplayer at adapter position 0.

The exoplayer plays hls files which are on the server side.

My issue is that when exoplayer playing first time, it sometimes pauses and resumes with the error below.

E/EventLogger: audioTrackUnderrun [eventTime=5.26, mediaPos=1.23, window=0, period=0, 61568, 320, 2760]

here is my dependencies

def exoplayer_version = '2.14.1'
implementation "com.google.android.exoplayer:exoplayer:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-hls:$exoplayer_version"

this is my code snippet

player = SimpleExoPlayer.Builder(mContext!!, DefaultRenderersFactory(mContext!!)                               
                 .setLoadControl(DefaultLoadControl())
                 .setTrackSelector(DefaultTrackSelector(mContext!!))
                 .build()

(player as SimpleExoPlayer).addAnalyticsListener(EventLogger(trackSelector))

player?.apply {
      val dataSourceFactory = DefaultDataSourceFactory(mContext!!)
      val hlsMediaSource: HlsMediaSource = HlsMediaSource.Factory(dataSourceFactory)
                                .setAllowChunklessPreparation(true)
                                .createMediaSource(MediaItem.fromUri(data.url))

(this as SimpleExoPlayer).setMediaSource(hlsMediaSource)
prepare()
repeatMode = REPEAT_MODE_ONE
playWhenReady = true

how can i tackle this issue?

guide me please.



Solution 1:[1]

This issue is related to network connection speed. You should make sure your network state is fine.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MinYoung Lee