Expected behavior
Use LANGUAGE as the primary label for audio tracks, and fallback to NAME.
Additional context
Today we simply take NAME, lowercase it, uppercase the first character and use that as the label. While this works for assets that are produced with Mixwave (eg; the NAME is set as uppercase language by the packager), this will fail when we play playlists from elsewhere.
The parser does not take the language attribute into account, it doesn't exist on the Media type.
When we stringify a MediaPlaylist, let's add the LANGUAGE tag to EXT-X-MEDIA. This'll be the next logical step after we implemented this feature in the (lexical) parser.
The player should use the language tag provided by the underlying HLS.js instance. We should also not lowercase the name / capitalize the first letter, as this is too specific for assets that are not produced by Mixwave. We did this because we wanted to have a textual representation of a track but this'll no longer be needed since we're going to rely on LANGUAGE.
Fallback to NAME as-is, since LANGUAGE is defined optional in the spec.
I'm not too sure about this, but I think the packager does NOT populate the LANGUAGE tag. We should look into this, since the source (meta.json file) does contain a notion of which language is for which track.
Describe the bug We don't take
LANGUAGE
into account forEXT-X-MEDIA
tags. Run this playlist, https://storage.googleapis.com/shaka-demo-assets/angel-one-hls/hls.m3u8, in the player and you'll notice that the names of the audio tracks in player are not correct.Expected behavior Use
LANGUAGE
as the primary label for audio tracks, and fallback toNAME
.Additional context Today we simply take
NAME
, lowercase it, uppercase the first character and use that as the label. While this works for assets that are produced with Mixwave (eg; theNAME
is set as uppercase language by the packager), this will fail when we play playlists from elsewhere.See
EXT-X-MEDIA
-LANGUAGE
in the HLS spec: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bisExtra
LANGUAGE
.language
attribute into account, it doesn't exist on theMedia
type.MediaPlaylist
, let's add theLANGUAGE
tag toEXT-X-MEDIA
. This'll be the next logical step after we implemented this feature in the (lexical) parser.LANGUAGE
.NAME
as-is, sinceLANGUAGE
is defined optional in the spec.LANGUAGE
tag. We should look into this, since the source (meta.json
file) does contain a notion of which language is for which track.