Воспроизвести Видео
Подскажите как...
<div id="video" onclick="hideshow();">asdasd</div> <div id="frame"><iframe src="https://www.youtube.com/embed/lK0xZ81_DNM" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe></div> Есть такая структура есть такой скрипт... function hideshow() { document.getElementById("video").style="display:no ne"; document.getElementById("frame").style="opacity:1; "; };.... Что нужно дописать или изменить что бы при клике сразу воспроизводилось видео?:help: |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="video" onclick="hideshow()">Старт</div>
<br>
<div >
<iframe id="frame" src="https://www.youtube.com/embed/lK0xZ81_DNM" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</div>
<script>
function hideshow() {
var video = document.getElementById('frame');
var src = video.getAttribute('src');
var srcResult = src + '?rel=0&showinfo=0&autoplay=1';
video.setAttribute('src', srcResult);
};
</script>
</body>
</html>
|
Спасибо....Добра Вам
|
| Часовой пояс GMT +3, время: 19:40. |