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

amp-ima-video: Added support for track child elements. #9827

Merged
merged 2 commits into from Jun 14, 2017
Merged

amp-ima-video: Added support for track child elements. #9827

merged 2 commits into from Jun 14, 2017

Conversation

shawnbuso
Copy link
Contributor

Copy link
Contributor

@honeybadgerdontcare honeybadgerdontcare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validator changes look good.

const sources = JSON.parse(data.sources);
sources.forEach(source => {
videoPlayer.appendChild(htmlToElement(source));
if (data.childElements) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet repurposing! 💯

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love me some reusable code :D

// Save the first source and first track to preconnect.
if (child.tagName == 'SOURCE' && !this.preconnectSource_) {
this.preconnectSource_ = child.src;
} else if (child.tagName == 'TRACK' && !this.preconnectTrack_) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please update the .md file to reflect that track and source children are supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, done.

@aghassemi aghassemi merged commit 3d89237 into ampproject:master Jun 14, 2017
@Gregable
Copy link
Member

These validator changes should be live everywhere within an hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants