Description | An amp-jwplayer component displays a cloud-hosted JW Player. |
Availability | Stable |
Required Script | <script async custom-element="amp-jwplayer" src="https://cdn.ampproject.org/v0/amp-jwplayer-0.1.js"></script> |
Supported Layouts | fill, fixed, fixed-height, flex-item, nodisplay, responsive |
Examples | jwplayer.amp.html |
The width
and height
attributes determine the aspect ratio of the player embedded in responsive layouts.
Example:
<amp-jwplayer
data-player-id="aBcD1234"
data-media-id="5678WxYz"
layout="responsive"
width="16" height="9">
</amp-jwplayer>
Non-responsive layout is also supported.
Example:
<amp-jwplayer
data-player-id="aBcD1234"
data-playlist-id="5678WxYz"
width="160" height="90">
</amp-jwplayer>
data-player-id
JW Platform player id. This is an 8-digit alphanumeric sequence that can be found in the Players section in your JW Player Dashboard. (Required)
data-media-id
The JW Platform media id. This is an 8-digit alphanumeric sequence that can be found in the Content section in your JW Player Dashboard. (Required if data-playlist-id
is not defined.)
data-playlist-id
The JW Platform playlist id. This is an 8-digit alphanumeric sequence that can be found in the Playlists section in your JW Player Dashboard. If both data-playlist-id
and data-media-id
are specified, data-playlist-id
takes precedence. (Required if data-media-id
is not defined.)
See amp-jwplayer rules in the AMP validator specification.