I am using ExoPlayer in an app to play audio, by calling it using the URL of the audio file stored in Firebase.
When I press a button, I want the player to fetch the song given in its “source” attribute, and start playing. When using WiFi connection, the player fetches the audio file instantly and starts playing the audio. But when using Mobile data connection, there is delay in this process for the player to load the song.
When there is delay in loading process, I am unable to convey the user, that the song is being loaded. I did not find a solution for showing the loading progress of the ExoPlayer.
I would like to get the function of loading progress method or something like that. But the only method related to LOADING is the “is Loading” attribute.
I tried the method you suggested. It can be used to show the users, audio is loading. But the else statement in the block is always executed when the status of player changes. I have statements for finding total duration of the audio in seconds, and other few statements to be executed after loading the audio file. These statements will not work properly using the suggested method.
Is there way to know when the loading process is completed, so as to execute other statements along with starting the player?