-
Notifications
You must be signed in to change notification settings - Fork 793
Add support for description audio tracks in HLS #1019
Add support for description audio tracks in HLS #1019
Conversation
… of 'public.accessibility.describes-video')
If/when PR 14 gets pulled into m3u8-parser and released, I'll update the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Might be good to have a couple tests though (probably easiest to have audioTrackKind_ as a function outside of MPC's class and can export it to make testing it in isolation easier).
src/master-playlist-controller.js
Outdated
let kind = properties.default ? 'main' : 'alternative'; | ||
|
||
if (properties.characteristics) { | ||
if (properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but can just have one conditional:
if (properties.characteristics &&
properties.characteristics.indexOf('public.accessibility.describes-video') >= 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - I wasn't sure how to deal with the line getting too long! I'll change that.
src/master-playlist-controller.js
Outdated
|
||
if (properties.characteristics) { | ||
if (properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) { | ||
kind = 'main-desc'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for there to be two tracks with 'public.accessibility.describes-video' (something like an alt-desc
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory that's possible; I'd assume it would need to follow the same rules as, say, a CAPTIONS or SUBTITLES tracks:
https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.4.1.1:
All EXT-X-MEDIA tags in a Playlist MUST meet the following
constraints:o All EXT-X-MEDIA tags in the same Group MUST have different NAME
attributes.o A Group MUST NOT have more than one member with a DEFAULT
attribute of YES.o All members of a Group whose AUTOSELECT attribute has a value of
YES MUST have LANGUAGE [RFC5646] attributes with unique values.
So you could tell them apart by name
(label
) and language
. But it wouldn't change the audio track's kind
. Is that what you were wondering about?
I'll take a look at how to set up some tests. |
Add test for correctly setting alternative audio kinds
Thanks for the contribution @OwenEdwards |
Description
An audio track can be included in an HLS mux which contains description for blind or low-vision users. This track is indicated by including a
CHARACTERISTICS
key, with valuepublic.accessibility.describes-video
.This PR, and m3u8-parser PR 14, mark the
kind
of the audio track to indicate that it ismain-desc
(main and description), so that the player can specifically handle this track in a different way.Please describe the change as necessary.
Use CHARACTERISTICS of an audio track when determining its
kind
.Requirements Checklist