fengchuanyu 8 月之前
父节点
当前提交
73fe320fca
共有 3 个文件被更改,包括 64 次插入0 次删除
  1. 39 0
      7_HTML5/3_媒体标签.html
  2. 25 0
      7_HTML5/4_canvas.html
  3. 二进制
      7_HTML5/media/song.mp3

+ 39 - 0
7_HTML5/3_媒体标签.html

@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        video{
+            /* width: 200px; */
+        }
+    </style>
+</head>
+<body>
+    <a href="https://www.runoob.com/tags/ref-av-dom.html">dom控制</a>
+    <video id="videotag" width="200" src="./media/media.mp4"  ></video>
+    <button id="paly-btn">播放</button>
+    <button onclick="pausedFun()" id="paused-btn">暂停</button>
+   
+   <audio id="audio-dom" src="./media/song.mp3" ></audio>
+   
+   <script>
+        var audioDom = document.getElementById("audio-dom");
+        var oVideo = document.getElementById("videotag");
+        var playBtn = document.getElementById("paly-btn");
+        var pausedBtn = document.getElementById("paused-btn");
+        playBtn.onclick = function(){
+            // oVideo.play();
+            audioDom.play()
+        }
+        function pausedFun(){
+            oVideo.pause();
+        }
+        oVideo.onplay = function(e){
+            console.log("hello")
+        }
+
+   </script>
+</body>
+</html>

+ 25 - 0
7_HTML5/4_canvas.html

@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        canvas{
+            background-color: #000;
+        }
+    </style>
+</head>
+<body>
+    <canvas id="canv" width="400" height="400"></canvas>
+    <script>
+        var oCan = document.getElementById("canv");
+        var can = oCan.getContext("2d");
+        can.strokeStyle="white";
+        can.moveTo(10,10);
+        can.lineTo(200,200);
+        can.lineTo(100,300);
+        can.stroke();
+    </script>
+</body>
+</html>

二进制
7_HTML5/media/song.mp3