AMP Conf 2020: Save the date!
AMP

重要:此组件不支持您目前所选格式 stories!

amp-jwplayer

Displays a cloud-hosted JW Player.

Required Scripts

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

Examples

Displays a cloud-hosted JW Player.

Example

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>

Attributes

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.)
data-content-search Denotes the type of the playlist. If contextual article matching is desired, use the value __CONTEXTUAL__. If a search playlist is desired, input a keyword or phrase used to generate the search playlist.
data-content-backfill Ensures that a search or contextual playlist always returns a result. If there are no relevant results for the given query, this parameter ensures that a list of trending videos are served instead. (Boolean with default: true)
common attributes This element includes common attributes extended to AMP components.

Validation

See amp-jwplayer rules in the AMP validator specification.

需要更多帮助?

You've read this document a dozen times but it doesn't really cover all of your questions? Maybe other people felt the same: reach out to them on Stack Overflow.

前往 Stack Overflow
找到一个 bug 或者缺失某项功能?

AMP 项目强烈鼓励您参与其中并作出贡献!我们希望您能成为我们开源社区的持续参与者,但我们也欢迎您对热衷问题做出单次贡献。

前往 GitHub