-
Notifications
You must be signed in to change notification settings - Fork 795
Add support for description audio tracks in HLS #1019
Changes from 2 commits
747e9ab
4bc2b3d
c467ab7
2cf7e1d
3661c94
efd68fb
c3f84f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -551,7 +551,7 @@ export class MasterPlaylistController extends videojs.EventTarget { | |
let properties = mediaGroups.AUDIO[mediaGroup][label]; | ||
let track = new videojs.AudioTrack({ | ||
id: label, | ||
kind: properties.default ? 'main' : 'alternative', | ||
kind: this.audioTrackKind_(properties), | ||
enabled: false, | ||
language: properties.language, | ||
label | ||
|
@@ -568,6 +568,23 @@ export class MasterPlaylistController extends videojs.EventTarget { | |
})[0] || this.activeAudioGroup()[0]).enabled = true; | ||
} | ||
|
||
/** | ||
* Convert the properties of an HLS track into an audioTrackKind. | ||
* | ||
* @private | ||
*/ | ||
audioTrackKind_(properties) { | ||
let kind = properties.default ? 'main' : 'alternative'; | ||
|
||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
So you could tell them apart by |
||
} | ||
} | ||
|
||
return kind; | ||
} | ||
|
||
/** | ||
* Call load on our SegmentLoaders | ||
*/ | ||
|
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:
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.