Embed a player on an AMP page
See how you can embed the player on an AMP page
Embed player on an AMP page
Our player can be used on Google AMP pages by adding the below embed code.
To load the player on AMP page, make sure to include the following script on the page
<script async custom-element="<<amp_element>>" src="https://cdn.ampproject.org/v0/<<brid_amp_script>>"></script>
<amp-<<player_class>>-player
data-partner="PARTNER_ID"
data-player="PLAYER_ID"
data-video="VIDEO_ID"
layout="responsive"
width="480"
height="270"
>
</amp-<<player_class>>-player>
List of parameters that are supported in AMP embed code
Parameter name | Description |
---|---|
data-partner | Id of the partner (website) |
data-player | id of the player used |
data-video | id of the video used |
data-playlist | if playlist is used insted of the video you should supply playlist id |
data-outstream | if outstream unit is used you should supply id of the outstream unit |
data-dynamic | Parameter used to specify type of dynamic playlist, e.g. latest, channel, tag. |
Sticky player on AMP
You can use sticky player on AMP pages by adding the dock
parameter into the embed code.
<amp-<<player_class>>-player
data-partner="PARTNER_ID"
data-player="PLAYER_ID"
data-video="VIDEO_ID"
layout="responsive"
width="480"
height="270"
dock
>
</amp-<<player_class>>-player>
Requires amp-video-docking extension. If this attribute is present and the video is playing manually, the video will be "minimized" and fixed to a corner or an element when the user scrolls out of the video component's visual area.
To read more about docking extension read here.
Updated over 3 years ago