Guenni007

custom

Sep 27th, 2021
772
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($){
  2.     $('.avia-video[data-original_url*="youtube"]').addClass('youtube-iframe');
  3.     $('.avia-video.youtube-iframe').each(function() {
  4.     regex = /(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/;
  5.     var ID = $(this).attr("data-original_url").match(regex)[1];
  6.     var previewThumb = $(this).css('background-image');
  7.     var ThumbUrl = previewThumb.replace(/^url\(['"](.+)['"]\)/, '$1');
  8.     });
  9. })(jQuery);
RAW Paste Data