amp-facebook

Edit on Github
Open in Playground

Introduction

The amp-facebook component allows embedding both posts and videos into AMP files.

Setup

Import the amp-facebook component

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

Basic Usage

The amp-facebook component only requires the URL of the facebook post...

Example

<amp-facebook width="552"
  height="303"
  layout="responsive"
  data-href="https://www.facebook.com/zuck/posts/10102593740125791">
</amp-facebook>

... or video

Example

<amp-facebook width="552"
  height="310"
  layout="responsive"
  data-href="https://www.facebook.com/zuck/videos/10102509264909801/">
</amp-facebook>

Setting data-embed-as="video" will embed the video without the accompanying card.

Example

<amp-facebook width="552"
  height="310"
  layout="responsive"
  data-embed-as="video"
  data-href="https://www.facebook.com/zuck/videos/10102509264909801/">
</amp-facebook>