-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat: parse out Location element and return the first one #102
Conversation
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.
Code looks good, had a question regarding multiple locations.
src/inheritAttributes.js
Outdated
const mpdAttributes = parseAttributes(mpd); | ||
const mpdBaseUrls = buildBaseUrls([ manifestUri ], findChildren(mpd, 'BaseURL')); | ||
|
||
mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0; | ||
mpdAttributes.NOW = NOW; | ||
mpdAttributes.clientOffset = clientOffset; | ||
|
||
return flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls))); | ||
if (locations.length) { | ||
mpdAttributes.location = getContent(locations[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.
I see in the spec that location can be specified 0
to n
times. I think that means that we could have multiple locations, would it make more sense to follow the spec here and support multiple?
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.
I was going to say since we aren't going to support it in VHS right now, what's the point, but making it return an array from here isn't that hard and would mean that we or others wouldn't need an mpd-parser update should we want to start supporting multiple Location elements.
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.
Making the change, I'll then update VHS to just get the first one (for now, at least)
TODO: