Closed tuxxon closed 4 years ago
The mapped track info is only available after the player has been prepared. Even in this case, the information is not directly available and you need to use Player.EventListener.onTracksChanged()
to make sure getCurrentMappedTrackInfo()
is not null.
Also, the preferred language should ideally be selected before the player is prepared.
Therefore, you should:
1) select the preferred language,
2) call player.prepare()
,
3) retrieve the mapped track info though a listener.
If it is not possible because you need the available languages to select the preferred language, you can set the preferred language later but it is less performent as the player may already have loaded the subtitles in another language. You also need to make sure that the player does not start playing in another language before you set the preferred language.
I am appreciated for your comment and gonna try this.
@kim-vde
Hello.
Once I try to show the subtitles at the beginning, I got some problems in the following code,
My code is
In this code, the problem is where getCurrentMappedTrackInfo() is null.
I want to receive events on onCues(List\<Cue> cues) as soon as the player begins. Please let me know how to show the subtitles at the beginning.