Каталог файловtilda-video-processor-1.0.js
901 var elHeight = window.getComputedStyle(el).height || 0;902 t_videoprocessor__updateVideoHeight(videoWrapper, elHeight, 'kinescope');903 }, 100)904 );905 906 el.style.backgroundImage = null;907}908 909/**910 * Process VK video911 * @param {HTMLElement} el - Element containing VK video912 * @param {Object} params - Options for video processing
История файла и сравнение версий
* @param {string} params ['cover-height'] - Video height
914 * @param {boolean} params ['video-noloop'] - Flag indicating whether to loop the video 916function t_videoprocessor__processVkVideo(el, params) { 917 var url = el.getAttribute('data-content-video-url-vkvideo'); 918 var noloop = params['video-noloop']; 921 el.style.backgroundImage = null; 925 url = url.replace(/https:\/\/(vk\.com|vk\.ru|vkvideo\.ru)\/video/, ''); 926 var urlParts = url.split('_'); 927 var hash = el.getAttribute('data-content-video-hash-vkvideo') || ''; 931 'https://vkvideo.ru/video_ext.php?oid=' + 936 (hash ? '&hash=' + hash : '') + 938 (!noloop ? '&loop=1' : ''); 939 var iframe = t_videoprocessor__getIframeHtml(embedUrl); 940 el.insertAdjacentElement('beforeend', iframe); 942 t_onFuncLoad('t_loadJsFile', () => { 943 t_loadJsFile('https://vkvideo.ru/js/api/videoplayer.js', () => { 944 t_onFuncLoad('VK', () => { 945 const player = VK.VideoPlayer(iframe); 947 player.on('inited', function () { 951 elHeight = window.getComputedStyle(el).height || 0; 952 t_videoprocessor__updateVideoHeight(el, elHeight, 'vk'); 955 if ('IntersectionObserver' in window) { 956 var iframeVideoObserver = new IntersectionObserver(function (entries) { 957 entries.forEach(function (entry) { 959 var target = entry.target; 960 if (target === iframe) { 961 var doCommand = entry.isIntersecting ? player.play : player.pause; 966 iframeVideoObserver.observe(iframe); 972 t_onReady(function () { 973 var elHeight = window.getComputedStyle(el).height || 0; 974 t_videoprocessor__updateVideoHeight(el, elHeight, 'vk'); 978 'coverHeightUpdated', 980 var elHeight = window.getComputedStyle(el).height || 0; 981 t_videoprocessor__updateVideoHeight(el, elHeight, 'vk'); 986 window.addEventListener( 988 t_throttle(function () { 989 var elHeight = window.getComputedStyle(el).height || 0; 990 t_videoprocessor__updateVideoHeight(el, elHeight, 'vk'); 993 el.style.backgroundImage = null; 997 * some analog of promise 998 * we cannot use here t_onFuncLoad, because after getting YT object, we need check is YT.Player is ready to use 1000 * @param {String} obj - if obj is object