ntroduction

Use amp-video to embed videos into your AMP HTML files. Video source files must be served via HTTPS.

Setup

Import the amp-video component.

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

Basic usage

A simple video with controller. amp-video supports the following formats: mp4, webm, ogg together with all the formats supported by the HTML5 video tag including HLS.

 
<amp-video width="480"
  height="270"
  src="/static/samples/video/tokyo.mp4"
  poster="/static/samples/img/tokyo.jpg"
  layout="responsive"
  controls>
  <div fallback>
    <p>Your browser doesn't support HTML5 video.</p>
  </div>
  <source type="video/mp4"
    src="/static/samples/video/tokyo.mp4">
  <source type="video/webm"
    src="/static/samples/video/tokyo.webm">
</amp-video>

Autoplay

Setting autoplay will automatically play/pause the video as it is

scrolled into/out of view on supported browsers.

The video is automatically muted before autoplay starts, when the user

taps the video, the video is unmuted.

If the user has interacted with the video

(e.g., mutes/unmutes, pauses/resumes, etc.), and the video is scrolled in

or out of view, the state of the video remains as how the user left it.

具体AMP视频案例:https://iprog-programmer.chinaobd2.com/

谷歌AM HTML视频代码amp-video示例的更多相关文章

  1. html5播放mp4视频代码

    1.nginx支持flv和mp4格式播放 默认yum安装nginx centos7安装nginx时候应该是默认安装nginx_mod_h264_streaming模块的 # nginx -V查看是否安 ...

  2. 安安视频网anan.video为您提供免费高清视频

    安安视频网anan.video为您提供免费高清视频,最新电影,电视剧,动漫,微电影,纪录片,音乐MV在线观看(高清):安安视频网,一个干净的视频在线播放网站,百万高清影视,视频在线观看. 安安视频网整 ...

  3. kindeditor自定义插件插入视频代码

    kindeditor自定义插件插入视频代码 1.添加插件js 目录:/kindeditor/plugins/diy_video/diy_video.js KindEditor.plugin('diy_ ...

  4. 视频转换器 Wondershare Video Converter Ultimate v11.5.1 中文便携版

    Wondershare Video Converter Ultimate 是万兴公司出品的一款多功能音视频转换.DVD 刻录软件.视频下载软件.有了它,您可以随时随地观看.下载.编辑.转换.刻录视频, ...

  5. 手机端wap站网页播放腾讯视频代码

    <div class="detail-con clear"> <div id="mod_player_wrap" class="mo ...

  6. H5外包团队:使用HTML5播放短视频代码分享

    滑动代码 /** * 滑动处理 */ function Touch() { this.init(); } Touch.fn = Touch.prototype; Touch.fn.init = fun ...

  7. 页面中插入视频的方法---video/embed/iframe总结

    1. video标签 当前主流的方法当然是HTML5中的video标签了,但是 当前,video 元素只支持三种视频格式: Ogg = 带有 Theora 视频编码和 Vorbis 音频编码的 Ogg ...

  8. 使用Quicktime 实现视频直播(Live video using Quicktime) (转)

    Quicktime是一个跨浏览器的播放插件,可以实现RTSP视频直播,可用于电视直播或视频监控平台.本文主要讲了关于播放器如何实现直播.事件响应.播放器全屏.动态修改播放路径等问题. 需要准备的软件: ...

  9. js数组特定位置元素置空,非null和undefined,实现echarts现状图效果;谷歌格式化压缩js代码

    一.想要实现eCharts线状图表的断点效果,如图(后来又查到数据格式为data:['-', 2, 3,'-' , 5, 6, 7]:也可以断点显示) 这种效果,在设置数据的时候应该是这样: data ...

随机推荐

  1. rsync 安装

    #!/bin/bash #root running ] then echo "must is root running" exit fi if [ -e /etc/rsyncd.c ...

  2. IntelliJ IDEA 使提示不区分大小写

    File ==> Settings ==> Editor ==> General ==> Code Completion 第一行 Match case 将默认勾选去掉

  3. Valgrind与内存问题

    1 简介 "Valgrind是一款用于内存调试.内存泄漏检测以及性能分析的软件开发工具.Valgrind这个名字取自北欧神话中英灵殿的入口. Valgrind的最初作者是Julian Sew ...

  4. 网络编程-Python高级语法-闭包

    什么叫闭包?通俗来说就是函数里嵌套函数,从表现形式来看,内部函数引用外部函数的作用域里的变量,那么内部函数就称为闭包 举例说明: 1.闭包=函数块+定义函数时的环境,inner就是函数块,x就是环境 ...

  5. Python中何时使用断言

    这个问题是如何在一些场景下使用断言表达式,通常会有人误用它,所以我决定写一篇文章来说明何时使用断言,什么时候不用. 为那些还不清楚它的人,Python的assert是用来检查一个条件,如果它为真,就不 ...

  6. 2019-2-14SQLserver中function函数和存储过程、触发器、CURSOR

    Sqlserver 自定义函数 Function使用介绍 前言:         在SQL server中不仅可以可以使用系统自带的函数(时间函数.聚合函数.字符串函数等等),还可以根据需要自定义函数 ...

  7. 2017-10-22—发光二极管

    LED与 LD的差别在工作原理上的差别:LED是利用注入有源区的载流子自发辐射复合发光,而LD是受激辐射复合发光.在结构上的差别:LD有光学谐振腔,使产生的光子在腔内振荡放大,LED没有谐振腔.性能上 ...

  8. 作用域和闭包(二)this

    this 要在执行时才确认,定义时无法确认 1. 作为构造函数执行 2. 作为对象属性执行 3.作为普通函数执行 4. call,apply,bind 改变this

  9. IOS开发中获取当前WIFI的名字

            ifs = [self fetchSSIDInfo]; ssid = [ifs objectForKey:@"SSID"]; self.sSIDTxt.textFi ...

  10. rabbitmq应用

    #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun ""& ...