How to get the preview image from HLS(live stream) data source

Viewed 96
  • I have 2 data sources one is MP4 and another HLS
  • Both data sources are stored on the server
  • I am able to generate the preview from an MP4 source using a metadata retriever

code to get a preview from mp4

val metaDataRetriever = MediaMetadataRetriever()
metaDataRetriever.setDataSource(url,HashMap())

val timeInMilliSecond = 20000

val request = Glide.with(context)
    .load(metaDataRetriever.getFrameAtTime(timeInMilliSecond))
    .override(thumbNailWidth, height)
    .centerCrop()
  • But If I give the HLS data source, I am not able to get the preview

Question: How to get the preview image from HLS data source

1 Answers

I ended up using the MP4 preview itself

  • Anyone looking for something similar and check this --> link
  • I have not to use the above link but maybe it will help
Related