|
@@ -0,0 +1,24 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <title>Document</title>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+ <!-- <video src="./media/media.mp4" width="400" id="video1"></video> -->
|
|
|
+ <audio src="./media/song.mp3" onplay="playFun()"></audio>
|
|
|
+ <button>播放</button>
|
|
|
+ <script>
|
|
|
+ var video = document.getElementById('video1');
|
|
|
+ var audio = document.getElementsByTagName('audio')[0];
|
|
|
+ var btn = document.getElementsByTagName('button')[0];
|
|
|
+ btn.onclick = function(){
|
|
|
+ audio.play();
|
|
|
+ }
|
|
|
+ function playFun(){
|
|
|
+ console.log('播放了');
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>
|