amp-o2-player
Cara mudah untuk Memasukkan pemain o2 di Blog AMP Html. Anda dapat menemukan pemutaran video dari disini, serta dokumentasi bantuan dapat ditemukan di GitHub
1 Kode pembuka
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
2 Disposisi
Masukkan script berikut tepat di bawah <head>
<script async custom-element="amp-o2-player" src="https://cdn.ampproject.org/v0/amp-o2-player-0.1.js"></script>
3 Uso básico
Untuk memasukkan pemain, pemain o2 di halaman Anda AMP Html perlu menambahkan tag amp-02-player dengan dua parameter wajib:
1 data-pid
2 data-vid or data-bcid
- Parameter yang didukung lainnya adalah:
data-bid
data-macro
layout ( direkomendasikan untuk menggunakan respons )
width ( menentukan rasio aspek pemain )
height( menentukan rasio aspek pemain )
Codenya
<amp-o2-player data-pid="579a115aa01b4d2db062aa85"
data-bcid="579a115aa01b4d2db062aa85"
data-macros="m.playback=click"
layout="responsive"
width="480"
height="270">
</amp-o2-player>
Demonya
A continuación la estructura completa del código
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-o2-player" src="https://cdn.ampproject.org/v0/amp-o2-player-0.1.js"></script>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<link rel="canonical" href="https://ampbyexample.com/components/amp-o2-player/" >
<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-o2-player data-pid="579a115aa01b4d2db062aa85"
data-bcid="579a115aa01b4d2db062aa85"
data-macros="m.playback=click"
layout="responsive"
width="480"
height="270">
</amp-o2-player>
</body>
</html>