Skip to content

Commit

Permalink
Merge pull request ampproject#2385 from mkhatib/amp-yt-lazy
Browse files Browse the repository at this point in the history
Render amp-youtube lazily.
  • Loading branch information
mkhatib committed Mar 2, 2016
2 parents 95ee178 + 0e81baa commit 0f6c15a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions extensions/amp-youtube/0.1/amp-youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class AmpYoutube extends AMP.BaseElement {
return isLayoutSizeDefined(layout);
}

/** @override */
renderOutsideViewport() {
return false;
}

/** @override */
buildCallback() {
const width = this.element.getAttribute('width');
Expand Down
1 change: 0 additions & 1 deletion extensions/amp-youtube/0.1/test/test-amp-youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,5 @@ describe('amp-youtube', () => {
yt.implementation_.documentInactiveCallback();
expect(yt.implementation_.pauseVideo_.called).to.be.true;
});

});
});

0 comments on commit 0f6c15a

Please sign in to comment.