Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.87 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. video player: show / hide arrow
  2. var video = $("#myvideo").get(0);
  3. $(".video-arrow").click(function(){
  4.     if (video.paused) {
  5.         video.play();
  6.         $(this).hide();
  7.     }  
  8.     else{
  9.         video.pause();
  10.         $(this).show();
  11.     }
  12. });
  13.  
  14. <div class="video">
  15.         <video id="myvideo" title="My amazing video" poster="images/banner-r-img.png"  preload="auto" controls>
  16.             <source src="videos/intro.mp4" type="video/mp4" />
  17.             <source src="videos/intro.ogv" type="video/ogg" />
  18.             <source src="videos/intro.webm" type="video/webm" />
  19.              Video tag not supported. Download the video <a href="movie.webm">here</a>.
  20.     </video>
  21. </div>
  22.  
  23. .video-arrow{
  24.     width:121px;
  25.     height:120px;
  26.     background: url(../images/video-arrow.png) no-repeat;  
  27.     position:absolute;
  28.     left:655px;
  29.     top:122px;
  30.     z-index:100;
  31.     cursor:pointer;
  32. }