1$(".videoEach video").each(function() { 2 $(this).removeAttr('controls'); 3}); 4 5//æ°é»ç¨¿ä»¶åºå ææ¾æé® 6$(function () { 7 if ($(".videoEach video").length) { 8 var Click = "click" || "touchstart"; 9 $('.videoEach video').each(function () { 10 $(this).wrap("<div class='video-main'></div>"); 11 let videoWidth = $(this).width(); 12 let videoHeight = $(this).height(); 13 $(this).closest('.video-main').append('<div class="video-pic" style="width:' + videoWidth + 'px;height:' + videoHeight + 'px;"><img src="' + $(this).attr('poster') + '" /><div class="video-icon"></div></div>'); 14 if (!$(this).attr('poster')) { 15 $(this).closest('.video-main').find('.video-pic img').hide(); 16 } 17 }) 18 $('.videoEach').delegate('.video-icon', Click, function () { 19 $(this).closest('.video-main').find('video').attr('poster', ''); 20 $(this).closest('.video-main').find('video').attr('controls', 'controls'); 21 22 $(this).hide(); 23 $(this).closest('.video-main').find('video').css('opacity', 1); 24 $(this).closest('.video-main').find('.video-pic').hide(); 25 26 $('video').each(function (i,e){ 27 $('video')[i].pause(); 28 }); 29 $(this).closest('.video-main').find('video')[0].play(); 30 }) 31 $('video').on('play', function () { 32 var current = this; 33 $('video').each(function () { 34 if (this != current) { 35 this.pause(); 36 } 37 }); 38 }); 39 40 // è·åææ.video-mainå ç´ 41 const videoMainElements = document.querySelectorAll('.video-main'); 42 // 为æ¯ä¸ªå ç´ æ·»å äºä»¶çå¬ 43 videoMainElements.forEach(element => { 44 // é¼ æ è¿å ¥äºä»¶ï¼å¯¹åºhoverç第ä¸ä¸ªåè°ï¼ 45 element.addEventListener('mouseenter', () => { 46 const video = element.querySelector('video'); 47 if (video) { 48 video.setAttribute('controls', 'controls'); 49 } 50 }); 51 52 // é¼ æ 离å¼äºä»¶ï¼å¯¹åºhoverç第äºä¸ªåè°ï¼ 53 element.addEventListener('mouseleave', () => { 54 const video = element.querySelector('video'); 55 if (video) { 56 video.removeAttribute('controls'); 57 } 58 }); 59 }); 60 } 61})
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.