<audio src="img/老街旧友故事和酒.mp3" controls="controls">音频播放失败</audio>
1 autoplay="autoplay" loop="loop">
2 source ="img/do.mp3" />
3 >
1 p>播放歌曲》》》 2 ="img/老街旧友故事和酒.mp3" 3 button onClick="display()">播放/暂停button 4 script 5 var audioobj=document.getElementsByTagName("audio)[0];
6 function display(){
7 //判断音乐是否是暂停
8 if(audioobj.paused) audioobj.play();
9 else audioobj.pause();
10 }
11 >
>播放视频》》》2 video controls="controls" width="500px" height="300px" 3 ="img/vivi.mov" 4 ="img/do.mp4" 5 视频播放失败
6 video>
1 document.body.innerHTML="<canvas id=\"canid\" width=\"1000px\" height=\"1900px\"></canvas> "
var canobjx=document.getElementById("canid");
3 resto=canobjx.getContext("2d"4 resto.fillStyle="#FF00FF";//设置颜色
resto.rotate(1);//旋转,参数(角度)
6 resto.translate(300,100);移动
7 resto.scale(2,1);缩放
8 resto.fillRect(0,100,200,300);填充矩形,参数(左上坐标,宽高)
poster="https://img2018.cnblogs.com/blog/....png"
4 var imgx=new Image();
5 imgx.src="img/0.jpg";
6 imgx.onload=function(){
7 resto.drawImage(imgx,200);参数(图片对象,x,y)
8 }