How can I use custom labels for audio or subtitle tracks?

In some scenarios, you want more control over the labels for subtitle and audio tracks as they are displayed in the player UI. The default behavior of the Bitmovin Player SDKs is, that the labels are inferred from the DASH or HLS manifest in which the tracks are defined. To be able to override this default behavior, we created the LabelingConfig.

The following code snippet shows, how the LabelingConfig can be used to override the default labels for subtitle tracks in the Android SDK:

val sourceConfig = SourceConfig.fromUrl("http://bitdash-a.akamaihd.net/content/sintel/sintel.mpd")
sourceConfig.labelingConfig = LabelingConfig(subtitleLabeler = { subtitleTrack ->
    // TODO: Return the label
    null
})

player.load(sourceConfig)
SourceConfig sourceConfig = SourceConfig.fromUrl("http://bitdash-a.akamaihd.net/content/sintel/sintel.mpd");
LabelingConfig labelingConfig = new LabelingConfig();
labelingConfig.setSubtitleLabeler(subtitleTrack -> {
    // TODO: Return the label
    return null;
});
sourceConfig.setLabelingConfig(labelingConfig);

player.load(sourceConfig);