¿Cómo insertar videos Vine en Amp HTML?


amp-vine


Insertar vídeos de Vine en sus archivos HTML AMP

1 Código

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

2 Disposición

Inserte el siguiente script amp-vine justo abajo del <head>


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

3 Uso básico

Una inserción Embed del video Vine tiene la misma anchura y altura. Usted puede encontrar el código ID del video Vine en la dirección URL de la misma.

Código

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

Demostración



Disposición responsive

Diseño responsive funciona muy bien. En ese caso se puede utilizar cualquier valor de height y width, siempre y cuando sean los mismos.

Código

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

Demostración


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-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

Comentarios

Disqus

Disqus comments:


Facebook

Facebook comments: