• audio音频和video视频标签的使用


    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
        <script>
            var v=document.getElementsByTagName("video");
            function clickV()
            {
                if(v.paused)
                {
                    v.play();
                }
                else
                {
                    v.pause();
                }
            }
            function clickBig()
            {
                v.width=1000px;
                v.height=800px;
    
            }
            function clickSmall()
            {
                v.width=300px;
                v.height=300px;
            }
        </script>
    </head>
    <body>
    
    <!--html5音频播放-->
    <audio id="auto" src="1.mp3" controls="controls">你的浏览器不支持</audio><br/>
    <button onclick="clickA()">播放/暂停</button>        <br/>
    <script>
        var a=document.getElementById("auto");
        function clickA()
        {
            if(a.paused)
            {
                a.play();
            }
            else
            {
                a.pause();
            }
        }
    
    </script>
    
    
    <video id="video" src="a.mp4" controls="controls" width="800px" height="600px"></video>
    <!--html5视频播放
    浏览器不支持的话可以先把视频格式转换为ogg格式
    -->
    <video controls="controls">
        <source src="a.mp4">
        <source src="a.ogg">
    </video>
    <button onclick="clickV()">播放/暂停</button>        <br/>
    <button onclick="clickBig()">放大</button>        <br/>
    <button onclick="clickSmall()">缩小</button>        <br/>
    
    </body>
    </html>
  • 相关阅读:
    android数据恢复
    UVA 690 Pipeline Scheduling
    2017 国庆湖南 Day4
    2017 国庆湖南 Day5
    2017 国庆湖南 Day6
    2017国庆 清北学堂 北京综合强化班 Day1
    2017 国庆湖南Day2
    bzoj 2962 序列操作
    UVA 818 Cutting Chains
    UVA 211 The Domino Effect
  • 原文地址:https://www.cnblogs.com/linhong/p/4221966.html
Copyright © 2020-2023  润新知