title: Play/Pause HTML5 video using Jquery
body: <p>I would like to play/pause video using jquery.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>(function ($) {
      // plugin definition
      $.fn.htmlvideo = function (options) {
          // build main options before element iteration
          var defaults = {
              theme: 'normal',
          };
          var options = $.extend(defaults, options);
          // iterate and reformat each matched element
          return this.each(function () {
              var $htmlvideo = $(this);
  
              addvideo();
              addcontrols();
  
  
              function addvideo() {
                  var addvideo = $('&lt;video width="1000"&gt;&lt;source src="http://devfiles.myopera.com/articles/2642/sintel-trailer.ogv" type="video/ogg; codecs="theora, vorbis""&gt;&lt;source src="http://devfiles.myopera.com/articles/2642/sintel-trailer.mp4" type="video/mp4; codecs="avc1.42E01E, mp4a.40.2""&gt;&lt;/video&gt;');
                  $(addvideo).appendTo('#video');
              }
  
              function addcontrols() {
                  var controls = $('&lt;div id="controls" class="controls"&gt;&lt;button id="playbtn" class="playbtn"&gt;&lt;/button&gt;&lt;/div&gt;');
                  $(controls).appendTo('#controlspane');
              }
  
              $('.playbtn').click(function () {
                 //Here I need to make the video play
              });
  
  
          });
      };
  })(jQuery);
  </code></pre>