Google AMP amp-jwplayer
Опубликовано: 12 Апреля, 2022
Для встраивания jwplayer в AMP HTML существует компонент amp-jwplayer, который отображает jwplayer, размещенный в облаке.
Required Scripts: Importing the amp-jwplayer component into the header
HTML
< script async custom-element = "amp-jwplayer" </ script > |
Атрибуты:
- data-player-id: буквенно-цифровой идентификатор, найденный в разделе проигрывателя JW player.
- data-playlist-id / data-media-id: буквенно-цифровой идентификатор списка воспроизведения, найденный в разделе содержимого проигрывателя JW, необходимо указать любой идентификатор списка воспроизведения или идентификатор мультимедиа.
- автовоспроизведение: если указано, воспроизведение видео начинается сразу после загрузки.
Example:
HTML
<!doctype html> < html > < head > < meta charset = "utf-8" > < title >Google AMP amp-jwplayer</ title > < script async src = </ script > <!-- Import the `amp-jwplayer` component in the header.--> < script async custom-element = "amp-jwplayer" </ script > < link rel = "canonical" href = < meta name = "viewport" content = "width=device-width,minimum-scale=1,initial-scale=1" > < style amp-boilerplate> body { -webkit-animation: -amp-start 8s steps(1, end) 0s 1 normal both; -moz-animation: -amp-start 8s steps(1, end) 0s 1 normal both; -ms-animation: -amp-start 8s steps(1, end) 0s 1 normal both; animation: -amp-start 8s steps(1, end) 0s 1 normal both; } @-webkit-keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } @-moz-keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } @-ms-keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } @-o-keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } @keyframes -amp-start { from { visibility: hidden } to { visibility: visible } } </ style > < noscript > < style amp-boilerplate> body { -webkit-animation: none; -moz-animation: none; -ms-animation: none; animation: none } </ style > </ noscript > </ head > < body > < amp-jwplayer data-media-id = "BZ6tc0gy" data-player-id = "uoIbMPm3" layout = "responsive" width = "16" height = "9" > </ amp-jwplayer > </ body > </ html > |
Выход: