Video tags and audio tags
<!doctype html><html lang="ZH-CN"> <head> <meta charset="Utf-8" /> <title>Video tags and audio tags</title> <head> <body> <h2>Use of video tags</H2> <!--<video src= "Kobe.mp4" controls= "Controls" > your broken browser can retire, quickly upgrade it! </video> <!--<video controls width= "500px" AutoPlay loop poster= "Dog.jpg" > <source src= "kobe.mp4" type = "Video/mp4"/> <source src= "Movie.ogg" type= "Video/ogg"/> Your broken browser can retire, quickly upgrade it! </video> <h2>APIs using the video tag</H2> <video src="Kobe.mp4" controls= "controls" id=" Video ">Your broken browser can retire, quickly upgrade it!</video> <br/> <input type="button" value="Play" onclick ="PlayVideo ()" /> <input type="button" value="Stop" onclick=" Stopvideo () " /> <input type="button" value="Fast forward 10 seconds" onclick ="forward ()" /> <input type="button" value="Rewind 10 Seconds" onclick="Back () " /> <br/> <input type="button" value="Shut Up" onclick ="Shutup (This)" /> <input type="button" value="Acceleration x2" onclick="Fast ( ) " /> <input type="button" value="Deceleration x2" onclick= "Slow ()" /> <input type="button" value="Normal speed" onclick=" Normal () " /> <br/> <input type="button" value="Louder" onclick ="Up ()" /> <input type="button" value="Whisper " onclick="Down () " /> <script> varVideo=document.getelementbyid ("Video");//Play Video function playvideo(){Video.play (); }//Stop video function stopvideo(){Video.pause (); }//Fast forward 10 seconds function forward(){video.currenttime+=Ten; }//Rewind 10 seconds function back(){video.currenttime-=Ten; }//Mute function shutup(obj){ if(video.muted) {video.muted=false; Obj.value="Shut up."; }Else{video.muted=true; Obj.value="Speak"; } }//Acceleration x2 function fast(){Video.playbackrate=2;//default playback speed is 1}//Deceleration x2 function slow(){Video.playbackrate=1/2; }//Normal speed function normal(){Video.playbackrate=1; }//Speak louder. function up(){video.volume+=0.1;//The range of sound values is 0-1}// Keep your voice down. function down(){video.volume-=0.1;//The range of sound values is 0-1}</script> <h2>Use of audio tags</H2> <audio src="Wow.mp3" controls>Your broken browser can retire, quickly upgrade it!</Audio> </body></html>
Html5-video tags and audio tags