Expose text adaptation's role
eduter opened this issue · 4 comments
We currently have these two text adaptations in our manifest, but we can't reliably tell them apart, because role
is not exposed by the API.
<AdaptationSet id="3" contentType="text" mimeType="text/vtt" lang="sv">
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="caption" />
<Label>Svenska</Label>
<Representation id="11" bandwidth="0">
<BaseURL>text/text-0.vtt</BaseURL>
</Representation>
</AdaptationSet>
<AdaptationSet id="4" contentType="text" mimeType="text/vtt" lang="sv">
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main" />
<Label>Svensk Översättning</Label>
<Representation id="12" bandwidth="0">
<BaseURL>text/text-1.vtt</BaseURL>
</Representation>
</AdaptationSet>
This is the output we get from Player.prototype.getAvailableTextTracks()
:
[
{
"language": "sv",
"normalized": "swe",
"closedCaption": false,
"id": "3",
"active": true,
"label": "Svenska"
},
{
"language": "sv",
"normalized": "swe",
"closedCaption": false,
"id": "4",
"active": false,
"label": "Svensk Översättning"
}
]
It would be nice if ITextTrack
had a role
field.
Hi @eduter,
From what I understand, the "caption" track should normally have its closedCaption
attribute set to true
.
Better detecting closed caption is part of the future v3.30.0 that we're currently testing.
Can you check with the pre-release rx-player@3.30.0-dev.2023022200
? It is the last iteration of the release we're testing.
The new isCaptioning
function from v3.30.0 solves our problem 👍
https://github.com/canalplus/rx-player/blob/release/v3.30.0-dev.2023022200/src/parsers/manifest/dash/common/parse_adaptation_sets.ts#L115
Is the decision to not expose role to make ITextTrack
manifest format agnostic?
Is the decision to not expose role to make ITextTrack manifest format agnostic?
That was the main idea yes. Also to simplify the API by pre-parsing the meaning of those attributes (for example captioning can be indicated through several ways even in DASH)
The v3.30.0
is now officially released! You should have correct caption detection now.
I'm closing this issue, do not hesitate to re-open it if you still have a problem