fix: добавлена кнопка открытия видео на YouTube если iframe не работает
This commit is contained in:
parent
0bca7c69f5
commit
a658dbf38d
@ -710,8 +710,14 @@
|
||||
|
||||
function openVideo(id) {
|
||||
const ex = exercises.find(e => e.id === id);
|
||||
const videoUrl = ex.video.replace('/embed/', '/watch?v=');
|
||||
document.getElementById('modal-title').textContent = ex.name;
|
||||
document.getElementById('modal-video').innerHTML = '<iframe width="100%" height="400" src="' + ex.video + '" frameborder="0" allowfullscreen style="border-radius:12px;"></iframe>';
|
||||
document.getElementById('modal-video').innerHTML =
|
||||
'<div style="text-align:center;">' +
|
||||
'<iframe width="100%" height="400" src="' + ex.video + '?rel=0&modestbranding=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="border-radius:12px;"></iframe>' +
|
||||
'<p style="margin-top:15px; font-size:14px; opacity:0.8;">Если видео не загружается, открой на YouTube:</p>' +
|
||||
'<a href="' + videoUrl + '" target="_blank" style="display:inline-block; margin-top:10px; padding:12px 24px; background:linear-gradient(135deg, #00d9ff, #00ff88); color:#1a1a2e; text-decoration:none; border-radius:30px; font-weight:600;">▶ Открыть на YouTube</a>' +
|
||||
'</div>';
|
||||
document.getElementById('modal-desc').textContent = ex.desc;
|
||||
document.getElementById('video-modal').classList.add('active');
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user