feat: add language selector to audio player

This commit is contained in:
ThetaDev 2023-03-19 01:15:36 +01:00
parent 051b64cd17
commit 079f78a339
12 changed files with 241 additions and 98 deletions

View file

@ -188,6 +188,14 @@ public final class ListHelper {
videoOnlyStreams, ascendingOrder, preferVideoOnlyStreams);
}
/**
* Filter the list of audio streams and return a list with the preferred stream for
* each audio track. Streams are sorted with the preferred language in the first position.
*
* @param context the context to search for the track to give preference
* @param audioStreams the list of audio streams
* @return the sorted, filtered list
*/
public static List<AudioStream> getFilteredAudioStreams(
@NonNull final Context context,
@Nullable final List<AudioStream> audioStreams) {