amp-facebook
Introduction
The amp-facebook
component allows embedding both Facebook 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...
<amp-facebook width="552" height="303" layout="responsive" data-href="https://www.facebook.com/zuck/posts/10102593740125791">
</amp-facebook>
Video
Here is a sample for a Facebook video embed.
<amp-facebook width="552" height="310" layout="responsive" data-href="https://www.facebook.com/zuck/videos/10102509264909801/">
</amp-facebook>
Video with card
Setting data-embed-as="video" will embed the video with the accompanying card.
<amp-facebook width="552" height="310" layout="responsive" data-embed-as="video" data-href="https://www.facebook.com/zuck/videos/10102509264909801/">
</amp-facebook>
Video without card
Setting data-embed-as="post" will embed the video without the accompanying card.
<amp-facebook width="552" height="310" layout="responsive" data-embed-as="post" data-href="https://www.facebook.com/zuck/videos/10102509264909801/">
</amp-facebook>
Se le spiegazioni riportate in questa pagina non rispondono a tutte le tue domande, non esitare a contattare altri utenti AMP per discutere il tuo caso d'uso specifico.
Vai a Stack Overflow Ci sono funzioni non descritte?Il progetto AMP invita tutti a partecipare e dare il proprio contributo! Ci auguriamo che tu possa partecipare regolarmente alla nostra community open source, ma saremo anche lieti di ricevere eventuali contributi una-tantum sulle questioni che ti interessano.
Modifica esempio in GitHub-
Written by @sebastianbenz