Некодим© 2020-2026 Некодим
Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.
Журнал изменений История Git Файлы Tilda MCP Каталог файловtilda-t937-videoplaylist-1.0.js Следить за файлом 201 playlistLink.insertAdjacentElement('beforeend', playlistNumber);202 playlistLink.insertAdjacentElement('beforeend', playlistTitle);203 playlistLink.insertAdjacentElement('beforeend', playlistTime);204 item.insertAdjacentElement('beforeend', playlistLink);205 206 item.addEventListener('mousemove', function (e) {207 var currentItem = e.target.closest('.t937__playlist-item');208 currentItem.style.backgroundColor = styles.linkBgColor.length ? styles.linkBgColor : '#F0F0F0';209 });210 211 item.addEventListener('mouseout', function (e) {История файла и сравнение версий var currentItem = e.target.closest('.t937__playlist-item');
213 currentItem.style.backgroundColor = '';218 if (container) container.insertAdjacentElement('beforeend', item);222 function t937_renderVideoFrame(data, activeVideoId, recid) {223 var rec = document.getElementById('rec' + recid);226 var container = rec ? rec.querySelector('.t937__video') : null;227 var height = container ? container.offsetWidth * 0.5625 : 0;228 if (container) container.classList.remove('t937__video_empty');231 /* check that data[activeVideoId] is video, not a section */232 for (var i = activeVideoId - 1; i < data.length; i++) {235 t937_renderDescription(video, recid);240 var optionsIframe = {242 type: video ? video.type : '',245 if (!data.length || !video || !video.type) {246 if (container) container.classList.add('t937__video_empty');247 frame = document.createElement('div');248 frame.classList.add('t937__system-message');249 frame.textContent = !data.length ? t937_translate('noData') : t937_translate('wrongFormat');250 } else if (video.type === 'youtube') {251 var regex = /youtu(?:.*\/v\/|.*v=|\.be\/)([A-Za-z0-9_-]{11})/;253 id = video.url.match(regex);254 if (id !== null) id = id[1];256 optionsIframe.src = 'https://www.youtube.com/embed/' + id + '?rel=0&fmt=18&html5=1&enablejsapi=1';257 frame = t937_createIframe(optionsIframe);258 } else if (video.type === 'vimeo') {259 var idMatch = /vimeo[^/]*\/(\d+)\/?(\w*)\/?/i.exec(video.url);260 id = idMatch ? idMatch[1] : null;261 var hash = idMatch ? '?h=' + idMatch[2] : null;262 var timecodeMatch = /#t=(\d*h)?(\d*m)?\d*s$/i.exec(video.url);263 var timecode = timecodeMatch ? '/' + timecodeMatch[0] : '';266 if (container) container.classList.add('t937__video_empty');267 frame = document.createElement('div');268 frame.classList.add('t937__system-message');269 frame.textContent = t937_translate('wrongFormat');271 optionsIframe.src = 'https://player.vimeo.com/video/' + id + hash + timecode;272 frame = t937_createIframe(optionsIframe);274 } else if (video.type === 'kinescope') {275 var regExp = /kinescope\.io\/(?:embed\/|pl\/)?([a-zA-Z0-9-]+)/;276 var match = video.url.match(regExp);277 var videoId = match ? match[1] : false;279 optionsIframe.src = 'https://kinescope.io/embed/' + videoId;280 frame = t937_createIframe(optionsIframe);281 } else if (video.type === 'rutube') {282 var regExp = /(?:https?:\/\/)?(?:www\.)?(?:rutube\.ru\/(?:shorts|video|play\/embed|embed|video\/private)\/)([a-f0-9]{32})(?:\/\?p=([a-zA-Z0-9_-]+))?/;283 var match = video.url.match(regExp);284 var videoId = match ? match[1] : false;285 var videoHash = match ? match[2] : false;287 optionsIframe.src = 'https://rutube.ru/embed/' + videoId + (videoHash ? '?p=' + videoHash : '');288 frame = t937_createIframe(optionsIframe);289 } else if (video.type === 'vkvideo') {290 var regExp = /(?:video|video_ext\.php\?oid=|clip=?|)(-?\d+)_(\d+)|oid=(-?\d+)&id=(\d+)(?:.*?hash=([a-f0-9]+))?/;291 var match = video.url.match(regExp);297 oid = match[1] || match[3];298 id = match[2] || match[4];300 if (!videoHash && match[5]) videoHash = match[5];