2801*/2802function t_feed__getVideoIframeHtml(videoType, params) {2803if (!videoType) return '';28042805const { videoId: id, videoHash: hash, videoTime: time, vkOID, videoParams } = params;28062807const videoTypeConfig = {2808youtube: {2809baseUrl: `https://www.youtube.com/embed/${id}`,2810params: ['rel=0', 'fmt=18', 'html5=1', 'showinfo=0', 'muted=1', 'enable', time && `start=${time}`],2811},2812
vimeo: { baseUrl: `https://player.vimeo.com/video/${id}`, params: ['title=0', 'byline=0', 'portrait=0', 'badge=0', 'color=ffffff', 'muted=1', hash && `h=${hash}`], hashtag: time ? `#t=${time}` : '', }, kinescope: { baseUrl: `https://kinescope.io/embed/${id}`, params: ['muted=1', time && `t=${time}`], }, rutube: { baseUrl: `https://rutube.ru/embed/${id}`, params: ['muted=1', time && `t=${time}`, hash && `p=${hash}`], }, vkvideo: { baseUrl: 'https://vkvideo.ru/video_ext.php', params: [ 'js_api=1', 'hd=2', 'muted=1', `id=${id}`, `oid=${vkOID}`, hash && `hash=${hash}`, time && `t=${time}`, ], }, }; const config = videoTypeConfig[videoType]; if (!config) return ''; const { baseUrl, params: hashQueryArr, hashtag = '' } = config; if (videoParams) { hashQueryArr.push(videoParams); } const hashQueryStr = hashQueryArr.filter(param => param).join('&'); const src = `${baseUrl}?${hashQueryStr}${hashtag}`; return createIframeHtml(src); /** * Создает и возвращает элемент iframe * @param {string} src - URL для iframe. * @param {Record<string, string>} [attrs] - Дополнительные атрибуты для iframe. * @returns {string} - Возвращает элемент iframe. */ function createIframeHtml(src, attrs) { const iframe = document.createElement('iframe'); iframe.src = src; iframe.classList.add('t-slds__frame'); iframe.width = '100%'; iframe.height = '100%'; iframe.frameBorder = '0'; iframe.allowFullscreen = true; // Поддержка разными браузерами iframe.setAttribute('mozallowfullscreen', 'true'); iframe.setAttribute('msallowfullscreen', 'true'); iframe.setAttribute('oallowfullscreen', 'true'); iframe.setAttribute('webkitallowfullscreen', 'true'); iframe.scrolling = 'no'; iframe.allow = 'clipboard-write; fullscreen; picture-in-picture; encrypted-media; gyroscope; accelerometer;'; // Применение всех атрибутов из объекта attrs for (let key in attrs) { if (attrs.hasOwnProperty(key)) { iframe.setAttribute(key, attrs[key]); } } return iframe.outerHTML; }}function t_feed_drawPostPopupGallery(recid, opts, post) { var galleryItems = JSON.parse(post.mediadata); var galleryControl = typeof opts.gallery != 'undefined' ? opts.gallery.control : ''; var withArrowsClass = galleryControl !== 'dots' ? ' t-slds__witharrows' : ''; var str = ''; str += '<div class="t-slds" style="visibility: hidden;">' + '<div class="t-container t-slds__main">' + '<div class="t-slds__container t-width t-margin_auto">' + '<div class="t-slds__items-wrapper ' + withArrowsClass + '" data-slider-transition="" data-slider-with-cycle="true" data-slider-correct-height="true" data-auto-correct-mobile-width="false" aria-roledescription="carousel">'; galleryItems.forEach(function (item, i) { var activeClass = i == 0 ? ' t-slds__item_active' : ''; var zoomClass = opts.popup_opts.zoom ? ' t-zoomable' : ''; var zoomTarget = opts.popup_opts.zoom ? ' data-zoomable="yes" data-img-zoom-url="' + item.img + '"' : ''; str +=