0

Hi (The question is at the bottom ) I have a list of links :

li><a href="#">003 - What is rogramming and C#</a></li>
<li><a href="#">004 - unity interface</a></li>
<li><a href="#">005 - creating primitives</a></li>
<li><a href="#">006 - adding components</a></li>

And an iframe that play default one:

       <div class="embed-responsive embed-responsive-16by9" >
        <iframe class="embed-responsive-item"src="https://www.youtube.com/embed/4vdvlATlxLo" frameborder="0" allowfullscreen> </iframe>
        </div>

notice that I have changed the link so it will work -".com/embed/4vdvlATlxLo" Another thig i did is put stuff in the css someone from this forums did so it will work (otherwise it will not show):

.vid {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}

.vid iframe,
.vid object,
.vid embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

The question is:

1 ) How can I have it so when someone press a link from the list it will switch the embeded video

2 ) how can I still keep the video private only on youtube

thanks !

  • 3
    Possible duplicate of [Changing iframe src with Javascript](http://stackoverflow.com/questions/3730159/changing-iframe-src-with-javascript). That answer contains a solution without using JavaScript. – Derek Mar 22 '16 at 21:15
  • i can't understand what he did there – Amit Ravid Mar 23 '16 at 00:32
  • In [this answer](http://stackoverflow.com/a/17596773/1855126), the name attribute from the iframe is used as the target attribute of the anchor tag. Thus, the link is opened in the iframe rather than the window. – Derek Mar 23 '16 at 15:54

0 Answers0