Skip to content
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

Merged
merged 5 commits into from
Aug 12, 2020

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Aug 7, 2020

TODO:

  • Add a test to verify that location gets parsed properly.

Copy link
Contributor

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

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]);
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

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)

@gkatsev gkatsev merged commit 967e5e6 into main Aug 12, 2020
RomeroDiver pushed a commit to Arc-Soft/mpd-parser that referenced this pull request Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants