How to get all MediaItems duration in Exoplayer

Solution for How to get all MediaItems duration in Exoplayer
is Given Below:

I have created a SimpleExoPlayer with mediaItems as below

   // convert each model to MediaItems
   fun ExoPlayerModel.toMediaItem(): MediaItem =
   MediaItem.fromUri(this.songUrl.toUri())

  
   // In Service Class
    val simpleExoPlayer = SimpleExoPlayer.Builder(this).build()
    // some codes
    for (model in exoPlayerModelList) {
        simpleExoPlayer.addMediaItem(model.toMediaItem())
    }
    simpleExoPlayer.prepare()

It works fine. I want to get each MediaItems duration so I will able to show it on UI.