Каталог файловtilda-t937-videoplaylist-1.0.js
301 }302 303 optionsIframe.src = 'https://vkvideo.ru/video_ext.php?oid=' + oid + '&id=' + id + '&hd=2' + (videoHash ? '&hash=' + videoHash : '');304 frame = t937_createIframe(optionsIframe);305 } else if (video.type === 'boomstream') {306 optionsIframe.src = video.url;307 frame = t937_createIframe(optionsIframe);308 } else if (video.type === 'iframe') {309 optionsIframe.src = video.url;310 frame = t937_createIframe(optionsIframe);311 } else if (video.type === 'mp4' || video.type === 'webm') {312
История файла и сравнение версий
frame = document.createElement('video');
313 frame.classList.add('t937__video-frame'); 314 frame.classList.add('t937__video-frame_html5'); 315 frame.controls = true; 316 frame.title = 'html5-player'; 317 frame.style.width = '100%'; 318 frame.height = height; 320 var source = document.createElement('source'); 321 var sourceType = 'video/' + video.type; 323 source.src = video.url; 324 source.setAttribute('type', sourceType); 325 frame.insertAdjacentElement('afterbegin', source); 329 container.innerHTML = ''; 330 container.insertAdjacentElement('beforeend', frame); 334function t937_createIframe(options) { 335 var frame = document.createElement('iframe'); 336 var videoClass = 't937__video-frame_' + options.type; 338 frame.classList.add('t937__video-frame'); 339 frame.classList.add(videoClass); 340 frame.width = '100%'; 341 frame.height = options.height; 342 frame.src = options.src; 343 frame.frameBorder = '0'; 344 frame.setAttribute('allowfullscreen', ''); 345 frame.setAttribute('allow', 'autoplay; fullscreen; picture-in-picture; encrypted-media; gyroscope; accelerometer; clipboard-write;'); 350function t937_renderDescription(videoData, recid) { 351 var rec = document.getElementById('rec' + recid); 352 var wrapper = rec ? rec.querySelector('.t937__col_description') : null; 353 var titleContainer = wrapper ? wrapper.querySelector('.t937__video-title') : null; 354 var descriptionContainer = wrapper ? wrapper.querySelector('.t937__video-description') : null; 356 if (wrapper) wrapper.classList.add('t937__col_hidden'); 357 if (titleContainer) titleContainer.innerHTML = ''; 358 if (descriptionContainer) descriptionContainer.innerHTML = ''; 360 if (!videoData.description) return; 362 if (wrapper) wrapper.classList.remove('t937__col_hidden'); 363 var title = videoData.title && videoData.title.length ? videoData.title : t937_translate('videoTitle'); 364 descriptionContainer.innerHTML = videoData.description; 365 titleContainer.innerHTML = title; 367 /* var descriptionContent = t937_parseDescription(videoData.description); 369 var titleArray = title.split('<br>'); 370 titleArray.forEach(function (title, i) { 371 var span = document.createElement('span'); 372 span.textContent = title.toString(); 373 var br = document.createElement('br'); 374 titleContainer.appendChild(span); 375 if (i !== titleArray.length - 1) { 376 titleContainer.appendChild(br); 380 Array.prototype.forEach.call(descriptionContent, function (content) { 381 if (descriptionContainer) descriptionContainer.insertAdjacentElement('beforeend', content); 385function t937_renderVideoCount(data, recid, styles) { 386 var rec = document.getElementById('rec' + recid); 387 var subheading = rec ? rec.querySelector('.t937__subheading-title') : null; 388 var icon = rec ? rec.querySelector('.t937__subheading-icon') : null; 390 var color = styles.secondaryColor.length ? styles.secondaryColor.replace('#', '%23') : '%23111111'; 392 if (icon) icon.style.backgroundImage = 'url("data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 16 16\' width=\'16\' height=\'16\'%3E%3Ctitle%3Evideo playlist%3C/title%3E%3Cg class=\'nc-icon-wrapper\' stroke-width=\'1\' fill=' + 393 '\'' + color + '\'' + ' stroke=' + '\'' + color + '\'' + 394 '%3E%3Crect x=\'0.5\' y=\'2.5\' width=\'15\' height=\'12\' rx=\'1\' fill=\'none\' stroke=' + '\'' + color + '\'' + 395 ' stroke-linecap=\'round\' stroke-linejoin=\'round\'/%3E%3Cpolygon points=\'6.5 5.5 11.5 8.5 6.5 11.5 6.5 5.5\' fill=\'none\' stroke-linecap=\'round\' stroke-linejoin=\'round\' data-color=\'color-2\'/%3E%3Cline x1=\'3.5\' y1=\'0.5\' x2=\'12.5\' y2=\'0.5\' fill=\'none\' stroke=' + 396 '\'' + color + '\'' + ' stroke-linecap=\'round\' stroke-linejoin=\'round\'/%3E%3C/g%3E%3C/svg%3E"'; 398 for (var item in data) { 399 if (!data[item].section) {