Advertisement
Kraust

Webm and Gifv

Jun 5th, 2015
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (enableWebm === "type-2") {
  2.  
  3.     $('a[href$=".webm"], a[href$=".WebM"], a[href$=".webM"], a[href$=".webM"], a[href$=".gifv"]').each(function(index, value) {
  4.         var href = $(this).attr("href");
  5.        
  6.         $(this).after(" <button id='webm-" + index +"' class='btn' style='padding-left:3px;padding-right:3px;padding-top:1px;padding-bottom:1px'><i class='icon icon-play-circle'></i></button><div id='webm-image-" + index + "'><video controls loop><source src=\"" + href.replace(".gifv", ".webm") + "\" type=\'video/webm; codecs=\"vp8, vorbis\"\'></video></div>");
  7.        
  8.         $("#webm-image-" + index).hide();
  9.        
  10.         $("#webm-" + index).click(function() {
  11.             $("#webm-image-" + index).toggle();
  12.         });
  13.        
  14.     });
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement