B4X:
Dim jo As JavaObject = Player
Dim TrackGroups As JavaObject = jo.GetFieldJO("player").RunMethod("getCurrentTrackGroups", Null)
For i = 0 To TrackGroups.GetField("length") - 1
Dim TrackGroup As JavaObject = TrackGroups.RunMethod("get", Array(i))
For j = 0 To TrackGroup.GetField("length") - 1
Dim Format As JavaObject = TrackGroup.RunMethodJO("getFormat", Array(j))
Log(Format)
Log(Format.GetField("label") & ":" & Format.GetField("sampleMimeType")) '音轨和字幕语言名称
Log(Format.GetField("id") )
Next
Next
The above code is the new method in the latest release of addoExoPlayer and i want to use the Player.SetTextLanguage2(??) function.
The format contains lots of data and you can obtain them by using Format.GetField("???"). It currently shows 3 types of fields examples (Label, SampleMimeType and id).
These are the formats retrieved.Player_GetVideoTextLanguages2
(Format) Format(1, null, null, video/avc, avc1.4D4028, -1, en, [1920, 1080, -1.0, null], [-1, -1])
null:video/avc
(Format) Format(2, null, null, audio/mp4a-latm, mp4a.40.2, -1, pt, [-1, -1, -1.0, null], [6, 48000])
null:audio/mp4a-latm
(Format) Format(3, null, null, application/x-subrip, null, -1, tr, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(4, null, null, application/x-subrip, null, -1, bg, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(5, null, null, application/x-subrip, null, -1, lv, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(6, null, null, application/x-subrip, null, -1, sk, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(7, null, null, application/x-subrip, null, -1, uk, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(8, null, null, application/x-subrip, null, -1, pt, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(9, null, null, application/x-subrip, null, -1, no, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(10, null, null, application/x-subrip, null, -1, da, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(11, null, null, application/x-subrip, null, -1, sv, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(12, null, null, application/x-subrip, null, -1, et, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(13, Traditional, null, application/x-subrip, null, -1, und, [-1, -1, -1.0, null], [-1, -1])
Traditional:application/x-subrip
(Format) Format(14, null, null, application/x-subrip, null, -1, lt, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(15, null, null, application/x-subrip, null, -1, ko, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(16, null, null, application/x-subrip, null, -1, sl, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(17, Traditional, null, application/x-subrip, null, -1, zh, [-1, -1, -1.0, null], [-1, -1])
Traditional:application/x-subrip
(Format) Format(18, null, null, application/x-subrip, null, -1, nl, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(19, null, null, application/x-subrip, null, -1, hu, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(20, SDH, null, application/x-subrip, null, -1, en, [-1, -1, -1.0, null], [-1, -1])
SDH:application/x-subrip
(Format) Format(21, null, null, application/x-subrip, null, -1, hbs-hrv, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(22, null, null, application/x-subrip, null, -1, pl, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(23, null, null, application/x-subrip, null, -1, fi, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(24, null, null, application/x-subrip, null, -1, he, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(25, null, null, application/x-subrip, null, -1, is, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(26, null, null, application/x-subrip, null, -1, cs, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(27, null, null, application/x-subrip, null, -1, el, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(28, null, null, application/x-subrip, null, -1, ar, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
(Format) Format(29, null, null, application/x-subrip, null, -1, en, [-1, -1, -1.0, null], [-1, -1])
null:application/x-subrip
Question 1: What is the field name for en, ar, el, is?
Question 2: Is there a documentation to point me to the right direction with field names?
Question 3: What is und? is that similar to auto?
Thanks in advance