-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for non-standard DASH label attribute #811
Changes from 3 commits
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 |
---|---|---|
|
@@ -957,11 +957,13 @@ shaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) { | |
var language = | ||
shaka.util.LanguageUtils.normalize(elem.getAttribute('lang') || 'und'); | ||
|
||
var label = elem.getAttribute('label'); | ||
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. I was unable to find any mention of this attribute in the DASH spec (2014) or the latest DASH-IF-IOP (v4.0). I don't object to you adding it, though. Please add a comment that this is a non-standard attribute supported by Kaltura. |
||
|
||
// Parse Representations into Streams. | ||
var representations = XmlUtils.findChildren(elem, 'Representation'); | ||
var streams = representations | ||
.map(this.parseRepresentation_.bind( | ||
this, context, contentProtection, kind, language, main)) | ||
this, context, contentProtection, kind, language, label, main)) | ||
.filter(function(s) { return !!s; }); | ||
|
||
if (streams.length == 0) { | ||
|
@@ -1018,6 +1020,7 @@ shaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) { | |
* @param {shaka.dash.ContentProtection.Context} contentProtection | ||
* @param {(string|undefined)} kind | ||
* @param {string} language | ||
* @param {string} label | ||
* @param {boolean} isPrimary | ||
* @param {!Element} node | ||
* @return {?shakaExtern.Stream} The Stream, or null when there is a | ||
|
@@ -1026,7 +1029,7 @@ shaka.dash.DashParser.prototype.parseAdaptationSet_ = function(context, elem) { | |
* @private | ||
*/ | ||
shaka.dash.DashParser.prototype.parseRepresentation_ = function( | ||
context, contentProtection, kind, language, isPrimary, node) { | ||
context, contentProtection, kind, language, label, isPrimary, node) { | ||
var XmlUtils = shaka.util.XmlUtils; | ||
var ContentType = shaka.util.ManifestParserUtils.ContentType; | ||
|
||
|
@@ -1105,6 +1108,7 @@ shaka.dash.DashParser.prototype.parseRepresentation_ = function( | |
encrypted: contentProtection.drmInfos.length > 0, | ||
keyId: keyId, | ||
language: language, | ||
label: label, | ||
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. Please add this new field to the definition of the |
||
type: context.adaptationSet.contentType, | ||
primary: isPrimary, | ||
trickModeVideo: null, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,7 @@ describe('DashParser Manifest', function() { | |
' <Representation bandwidth="50" width="576" height="432" />', | ||
' </AdaptationSet>', | ||
' <AdaptationSet mimeType="text/vtt"', | ||
' lang="es">', | ||
' lang="es" label="spanish">', | ||
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. Thank you for updating the tests! |
||
' <Role value="caption" />', | ||
' <Role value="main" />', | ||
' <Representation bandwidth="100" />', | ||
|
@@ -176,6 +176,7 @@ describe('DashParser Manifest', function() { | |
.primary() | ||
.addTextStream(jasmine.any(Number)) | ||
.language('es') | ||
.label('spanish') | ||
.primary() | ||
.anySegmentFunctions() | ||
.anyInitSegment() | ||
|
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.
updateLanguageOptions_
updates the list of languages in the demo. You should not be changing this method.Instead, you should be changing the formatting in the list of tracks.
Everything else looks good, so I'm going to go ahead and run tests on the build bot. If all tests pass, I will fix the demo UI myself when I merge.
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.
Tests are failing, so I will leave it to you to make updates.
For the demo app, please revert changes in this file and look at the
formatters
map inupdateTrackOptions_
. That is where you should add labels to the track list. Here's a suggestion: