Changing
setPreferredAudioLanguage
For
setPreferredTextLanguage
Subtitles can be displayed, selecting by the type of language.
And if that code is executed with the variable NULL, the subtitle is currently hidden.
Private Sub SetPreferredTextLanguage(Language As String)
Dim jo As JavaObject = player1
Dim TrackSelector As JavaObject = jo.GetField("trackSelector")
TrackSelector.RunMethod("setParameters", Array( _
TrackSelector.RunMethodJO("buildUponParameters", Null) _
.RunMethod("setPreferredTextLanguage", Array(Language))))
End Sub
But there is a small problem with this video is that it has 2 subtitles of the same language, you only select the first one, you cannot choose the second.
In the getCurrentTrackGroups list, order the tracks by an ID, it would be a good option to be able to select the tracks that the video contains by the ID, since it is the only value among all of them that the video contains.
Greetings and thanks