jquery HTML5 video playback control code _jquery

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.