JQuery HTML5 video playback control core code:
<video class= "Pause" Controls poster= "Images/vedio.jpg" width= "663" height= "373" >
<source src= "video/" Defone3.8_1.mp4 "type=" Video/mp4 >
your browser does not support html5!
</video>
<script type= "Text/javascript" >
$ (' video '). Click (function () {
if $ (this). Hasclass (' pause ')) {
$ ("video"). Trigger ("Play");
$ (this). Removeclass (' pause ');
$ (this). addclass (' play ');
} else {
$ ("video"). Trigger ("pause");
$ (this). Removeclass (' play ');
$ (this). addclass (' pause ');
}
);
</script>
If you want an official user to play the environment, we recommend using tools such as Jplayer
<script type= "Text/javascript" src= ". /.. /lib/jquery.min.js "></script>
<script type=" Text/javascript "src=". /.. /dist/jplayer/jquery.jplayer.min.js "></script>
<script type=" Text/javascript ">
//<![ cdata[
$ (document). Ready (function () {
$ ("#jquery_jplayer_1"). Jplayer ({
ready:function (event) {
$ (this). Jplayer ("Setmedia", {
title: "Bubble",
m4a: "HTTP://JPLAYER.ORG/AUDIO/M4A/MIAOW-07-BUBBLE.M4A",
OGA: "Http://jplayer.org/audio/ogg/Miaow-07-Bubble.ogg"
});
},
Swfpath: ". /.. /dist/jplayer ",
supplied:" M4A, oga ",
wmode:" Window ",
usestateclassskin:true,
autoblur:false ,
smoothplaybar:true,
keyenabled:true,
remainingduration:true,
toggleduration:true
}) ;
});
]]>
</script>
Download Address: http://www.jb51.net/jiaoben/32245.html
Jplayer is a completely free and open source (MIT) jquery Multimedia Library plugin (now also a Zepto plugin) written by JavaScript Jplayer allows you to quickly write a cross-platform support for audio and video playback of a Web page. Jplayer's rich API allows you to create a personalized multimedia application, so you get more and more community members to support and encourage.