'How to set HLS stream non seekable in exoplayer?

I want to stop seeking on my live radio HLS stream. By default HLS is seekable in exoplayer.

How to set it non-seekable.

Would it reduce downloading or memroy usage?

I tried this one too:

HlsMediaSource hlsMediaSource =
new HlsMediaSource.Factory(dataSourceFactory)
    .setAllowChunklessPreparation(false)
    .createMediaSource(MediaItem.fromUri(hlsUri));

source: https://exoplayer.dev/hls.html -> Disabling chunkless preparation

But it not stop seeking on HLS stream



Sources

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

Source: Stack Overflow

Solution Source