10/14/2016

Cara memasukkan Video amp-vine dalam AMP Html


amp-vine


Masukkan Vine video ke file HTML AMP Anda

1 Kode

<!doctype html>
<html ⚡>
<head>
  <meta charset="utf-8">
  <script async src="https://cdn.ampproject.org/v0.js"></script>

2 Disposisi

Masukkan skrip amp-vine berikut tepat di bawah <head>


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

3 Uso Penggunaan dasar

Masukkan Embed dari video Vine memiliki lebar dan tinggi yang sama. Anda dapat menemukan kode ID dari video yang saya masukkan di URL-nya.

Kode

<amp-vine width="400"
      height="400"
      data-vineid="MdKjXez002d">
  </amp-vine>

Demo



Tata letak responsive

Desain responsif bekerja dengan sangat baik. Dalam hal ini Anda dapat menggunakan nilai tinggi dan lebar apa pun, asalkan sama.

Código

<amp-vine width="1"
      height="1"
      layout=responsive
      data-vineid="MdKjXez002d">
  </amp-vine>

Demo


Full struktur kode lengkap


<!doctype html>
<html ⚡>
<head>
  <meta charset="utf-8">
  <script async src="https://cdn.ampproject.org/v0.js"></script>

 <script async custom-element="amp-vine" src="https://cdn.ampproject.org/v0/amp-vine-0.1.js"></script>
 <link rel="canonical" href="https://ampbyexample.com/components/amp-vine/">
  <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-vine width="400"
      height="400"
      data-vineid="MdKjXez002d">
  </amp-vine>

 <amp-vine width="1"
      height="1"
      layout=responsive
      data-vineid="MdKjXez002d">
  </amp-vine>
</body>
</html>



Share:

Related post

You Might Also Like:

Disqus comments:


Facebook comments: