0

I have to put video on website.I put video links from youtube on my website. I use iframe. And don't see any video. I see only screen with names of videos, but not a video.I use links which youtube gives. What can be a problem? Should I use something more in my code? I have to add something in meta to use iframe?

.central-container{
    margin-left: 18.75%;
    margin-right: 18.75%;
    height: 100%;
}
.container-for-all-videos{  
    width: 100%;    
    height: 100%;
    margin-top: 30px;
}
.container-for-video{
    margin: 10px;
    width: 46%;
    min-width: 250px;   
}
.container-for-video h4{
    margin-top: 10px;
    text-align: center;
}
@media (min-width: 978px){
    .container-for-video:nth-child(odd){
        float: left;    
    }
    .container-for-video:nth-child(even){
        float: right;    
    }
    
}
@media (min-width: 440px){
    .bottom-info-container{
        
        margin: 50px auto 150px auto;          
    }
}
@media (max-width: 978px){   
    
    .container-for-video{
        margin-left: auto;
        margin-right: auto;

    }
}  
<div class="central-container">
            <div class="container-for-all-videos">
                <div class="container-for-video">
                    <iframe src="https://www.youtube.com/watch?v=_N1z37KqpCc" width="100%" height="auto" frameborder="0" allowfullscreen>
                    </iframe>
                    <h4>ד"ר אלדר על ניתוחים בריאטריים</h4>
                </div>
                <div class="container-for-video">
                        <iframe src="https://www.youtube.com/watch?v=rAwB17JTIgs" width="100%" height="auto" frameborder="0" allowfullscreen>
                        </iframe>
                        <h4>ד"ר אלדר מתארח אצל אלונה פרידמן על ניתוחים בריאטריים</h4>
                </div>
                <div class="container-for-video">
                        <iframe src="https://www.youtube.com/watch?v=PMHpU-f3Kzo" width="100%" height="auto" frameborder="0" allowfullscreen>
                        </iframe>
                        <h4>ניתוח שרוול קיבה ע"י ד"ר אלדר</h4>
                </div>
                <div class="container-for-video">
                        <iframe src="https://www.youtube.com/watch?v=0ij0poiNEvw" width="100%" height="auto" frameborder="0" allowfullscreen>
                        </iframe>
                        <h4>ראיון נוסף של ד"ר אלדר אצל אלונה פרידמן</h4>
                </div>
                <div class="container-for-video">
                        <iframe src="https://www.youtube.com/watch?v=rfF-1tyG_uI&t=21s" width="100%" height="auto" frameborder="0" allowfullscreen>
                        </iframe>
                        <h4>ד"ר אלדר על תוצאות ארוכות טווח של ניתוחים בריאטריים</h4>
                </div>
                <div class="container-for-video">
                        <iframe src="https://www.youtube.com/watch?v=_N1z37KqpCc" width="100%" height="auto" frameborder="0" allowfullscreen>
                        </iframe>
                        <h4>ד"ר אלדר על ניתוחים בריאטריים</h4>
                </div>

            </div>

2
  • 1
    How do you call your website? With http:// or https:// ?
    – Reporter
    Commented Oct 18, 2017 at 13:45
  • I still didn't put it on a server. So, it doesn't have http:// or https:// . But for the video I tried both of them.
    – Noa
    Commented Oct 18, 2017 at 13:47

1 Answer 1

2

You have to go to youtube.com and click share then embed and copy the iframe source without doing it, it wont work as youtube as iframe block

.central-container{
    margin-left: 18.75%;
    margin-right: 18.75%;
    height: 100%;
}
.container-for-all-videos{  
    width: 100%;    
    height: 100%;
    margin-top: 30px;
}
.container-for-video{
    margin: 10px;
    width: 46%;
    min-width: 250px;   
}
.container-for-video h4{
    margin-top: 10px;
    text-align: center;
}
@media (min-width: 978px){
    .container-for-video:nth-child(odd){
        float: left;    
    }
    .container-for-video:nth-child(even){
        float: right;    
    }
    
}
@media (min-width: 440px){
    .bottom-info-container{
        
        margin: 50px auto 150px auto;          
    }
}
@media (max-width: 978px){   
    
    .container-for-video{
        margin-left: auto;
        margin-right: auto;

    }
}  
<div class="central-container">
            <div class="container-for-all-videos">
                <div class="container-for-video">
                    <iframe width="560" height="315" src="https://www.youtube.com/embed/rAwB17JTIgs" frameborder="0" allowfullscreen></iframe>
                    <h4>ד"ר אלדר על ניתוחים בריאטריים</h4>
                </div>
                <div class="container-for-video">
                        <iframe width="560" height="315" src="https://www.youtube.com/embed/rAwB17JTIgs" frameborder="0" allowfullscreen></iframe>
                        
                        <h4>ד"ר אלדר מתארח אצל אלונה פרידמן על ניתוחים בריאטריים</h4>
                </div>
                <div class="container-for-video">
                        <iframe width="560" height="315" src="https://www.youtube.com/embed/rAwB17JTIgs" frameborder="0" allowfullscreen></iframe>
                        <h4>ניתוח שרוול קיבה ע"י ד"ר אלדר</h4>
                </div>
                <div class="container-for-video">
                        <iframe width="560" height="315" src="https://www.youtube.com/embed/rAwB17JTIgs" frameborder="0" allowfullscreen></iframe>
                        <h4>ראיון נוסף של ד"ר אלדר אצל אלונה פרידמן</h4>
                </div>
                <div class="container-for-video">
                        <iframe width="560" height="315" src="https://www.youtube.com/embed/rAwB17JTIgs" frameborder="0" allowfullscreen></iframe>
                        <h4>ד"ר אלדר על תוצאות ארוכות טווח של ניתוחים בריאטריים</h4>
                </div>
                <div class="container-for-video">
                        <iframe width="560" height="315" src="https://www.youtube.com/embed/rAwB17JTIgs" frameborder="0" allowfullscreen></iframe>
                        <h4>ד"ר אלדר על ניתוחים בריאטריים</h4>
                </div>

            </div>

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.