Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Add support for description audio tracks in HLS #1019

Conversation

OwenEdwards
Copy link
Member

@OwenEdwards OwenEdwards commented Feb 17, 2017

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 value public.accessibility.describes-video.

This PR, and m3u8-parser PR 14, mark the kind of the audio track to indicate that it is main-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

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

@OwenEdwards
Copy link
Member Author

OwenEdwards commented Feb 18, 2017

If/when PR 14 gets pulled into m3u8-parser and released, I'll update the package.json file to reflect the version of that package that is needed to support this.

Copy link
Contributor

@gesinger gesinger left a 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).

let kind = properties.default ? 'main' : 'alternative';

if (properties.characteristics) {
if (properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) {
Copy link
Contributor

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)

Copy link
Member Author

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.


if (properties.characteristics) {
if (properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) {
kind = 'main-desc';
Copy link
Contributor

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)?

Copy link
Member Author

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?

@OwenEdwards
Copy link
Member Author

I'll take a look at how to set up some tests.

@mjneil mjneil merged commit bfa1fbf into videojs:master Mar 9, 2017
@mjneil
Copy link
Contributor

mjneil commented Mar 9, 2017

Thanks for the contribution @OwenEdwards

@OwenEdwards OwenEdwards deleted the enhancement/support-description-audio-tracks branch March 13, 2017 07:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants