var elHeight = window.getComputedStyle(el).height || 0;
814 t_videoprocessor__updateVideoHeight(el, elHeight, 'rutube'); 818 'coverHeightUpdated', 820 var elHeight = window.getComputedStyle(el).height || 0; 821 t_videoprocessor__updateVideoHeight(el, elHeight, 'rutube'); 826 window.addEventListener( 828 t_throttle(function () { 829 var elHeight = window.getComputedStyle(el).height || 0; 830 t_videoprocessor__updateVideoHeight(el, elHeight, 'rutube'); 834 if ('IntersectionObserver' in window) { 835 var iframeVideoObserver = new IntersectionObserver(function (entries) { 836 entries.forEach(function (entry) { 837 var target = entry.target; 838 if (target === iframe) { 839 var command = entry.isIntersecting ? 'play' : 'pause'; 840 t_videoprocessor__doRutubeCommand(iframe, command); 844 iframeVideoObserver.observe(iframe); 848function t_videoprocessor__doRutubeCommand(iframe, command) { 849 iframe.contentWindow.postMessage(JSON.stringify({ type: 'player:' + command, data: {} }), '*'); 853 * Process Kinescope video 854 * @param {HTMLElement} el - Element containing Kinescope video 855 * @param {Object} params - Options for video processing 856 * @param {string} params ['cover-height'] - Video height 857 * @param {boolean} params['video-noloop'] - Flag indicating whether to loop the video 859function t_videoprocessor__processKinescopeVideo(el, params) { 860 var id = el.getAttribute('data-content-video-url-kinescope'); 863 el.style.backgroundImage = null; 867 var noloop = params['video-noloop']; 868 var url = t_videoprocessor__getIframeVideoUrl('kinescope', id, null, noloop); 871 el.style.backgroundImage = null; 875 var videoWrapper = document.createElement('div'); 876 videoWrapper.classList.add('t-cover__video__wrapper'); 877 videoWrapper.style.height = params['cover-height']; 879 var iframe = t_videoprocessor__getIframeHtml(url); 881 videoWrapper.insertAdjacentElement('beforeend', iframe); 882 el.insertAdjacentElement('beforeend', videoWrapper); 884 t_onReady(function () { 885 var elHeight = window.getComputedStyle(el).height || 0; 886 t_videoprocessor__updateVideoHeight(videoWrapper, elHeight, 'kinescope'); 890 'coverHeightUpdated', 892 var elHeight = window.getComputedStyle(el).height || 0; 893 t_videoprocessor__updateVideoHeight(videoWrapper, elHeight, 'kinescope'); 898 window.addEventListener( 900 t_throttle(function () {