Pages

14 April 2020

Embending YouTube videos in this AMP template

The script required for AMP Youtube is not included in the template. First include it either in the template or in the post.

<script async="" custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script>


Include the above code in the html section of the post or in the template of your blog.

<amp-youtube data-videoid="SGDwb3OeelQ" layout="responsive" width="480" height="270">
</amp-youtube>

In the above code, modify the video id and include it where you want your video to appear. You will get a resposive video like the one shown below


Ref: amp-youtube Doumentation