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