1jQuery(function($) { 2 var blocks = $('.wp-block-embed'); 3 blocks.each(function() { 4 var block = $(this); 5 var embedHTML = block.find('script.html-template').html(); 6 block.find('a.embed').on('click', function() { 7 block.trigger('theme:media-play'); 8 return false; 9 }) 10 11 block.on('theme:media-play', function() { 12 if (embedHTML && !block.hasClass('media-loaded')) { 13 block.find('.wp-block-embed__wrapper').append('<div class="media-embed">'+embedHTML.replace(/src="([^"]*)"/, 'src="$1&autoplay=1"')+'</div>'); 14 block.addClass('media-loaded'); 15 } else { 16 console.log('Media not loaded') 17 } 18 }) 19 block.on('theme:media-remove', function() { 20 block.find('.media-embed').remove(); 21 block.removeClass('media-loaded'); 22 }) 23 }) 24})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.