Hello everybody
first of all thanks for any information or help you can provide
I wanted to know without the new version of Exoplayer 2.13 available for B4A, could you help me how to create a code for the selection of subtitles or change of audio track that comes in the same video
using this code
I manage to see that this video has
I would like to be able to select a subtitle or an audio track change, both to add and to remove them
I send an example of what I want
regards
first of all thanks for any information or help you can provide
I wanted to know without the new version of Exoplayer 2.13 available for B4A, could you help me how to create a code for the selection of subtitles or change of audio track that comes in the same video
using this code
B4X:
Sub Globals
Dim VIDEOS_TRACK_GROUP_INDEX As Int
Dim TrackGroups As JavaObject
End Sub
Sub Player_TrackChanged
Dim jo As JavaObject = player1
TrackGroups = 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) 'ignore
Dim mime As String = Format.GetField("sampleMimeType")
If mime.StartsWith("video") Then
If VIDEOS_TRACK_GROUP_INDEX = 0 Then VIDEOS_TRACK_GROUP_INDEX = i
End If
Next
Next
End Sub
I manage to see that this video has
I would like to be able to select a subtitle or an audio track change, both to add and to remove them
I send an example of what I want
regards