How to click on the div to start the video in iframe?
Closed due to the fact that the issue is too general fori1ton , user194374, Akina , Yuri , aleksandr barakin participants 3 Feb '17 at 15:27 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
- and where is the video link? can see html - L. Vadim
- Link youtubovskaya - ілай bender
|
2 answers
No, you can not influence iframe via javascript on your site. You need to use youtube api that affect the video player.
|
Link in the diva, when you click on the div, the video in the frame works.
document.getElementById('video').onclick = function(){ document.getElementById('frm').src= document.getElementById('video').innerHTML; } <div id="video">https://www.youtube.com/embed/hv5_p7-Wdqw?rel=0&autoplay=1</div> <iframe id="frm" width="560" height="315" src="" frameborder="0" allowfullscreen></iframe> |