PageSourceSearch

https://v2.cri.cn/resource/c89e53c6-0bc7-45ca-ac11-a385002d7d11/2026/video/js.js.js

js cri.cn collected 2026-09-24 07:49:46 UTC 2,079 bytes, 61 lines download raw bytes

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.