# Youtube video not showing in banner

**URL:** <https://meta.discourse.org/t/youtube-video-not-showing-in-banner/43562>\
**Category:** Feature\
**Created:** [2016年五月2日 16:55 UTC](https://meta.discourse.org/t/youtube-video-not-showing-in-banner/43562 "2016-05-02T16:55:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrdiscourse](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@mrdiscourse](https://meta.discourse.org/u/mrdiscourse)\
**Post date:** [2016年五月2日 16:55 UTC](https://meta.discourse.org/t/youtube-video-not-showing-in-banner/43562/1 "2016-05-02T16:55:45Z")

</div>

My banner works fine. Just added a youtube video and it appears embedded on a regular page but the banner only doesnt show the youtube box at all.

Do I have to embed the raw youtube code instead?

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2016年五月2日 21:19 UTC](https://meta.discourse.org/t/youtube-video-not-showing-in-banner/43562/2 "2016-05-02T21:19:02Z")

</div>

Hmm, yeah, embeds are not really supported in the banner. We’d have to think of enhancing the feature.

---

<div class="post-metadata">

**Author:** ![mrdiscourse](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@mrdiscourse](https://meta.discourse.org/u/mrdiscourse)\
**Post date:** [2016年五月3日 00:04 UTC](https://meta.discourse.org/t/youtube-video-not-showing-in-banner/43562/3 "2016-05-03T00:04:42Z")

</div>

I worked around it by customising my html with a bit of jquery to inject a youtube embed code:

So in the custom header:

```
<script>

function readyFn( jQuery ) {
    
    // check if sign up button showing
    if ( $('.sign-up-button').length ) {
        
         $('#banner-content').prepend("<div style='float:right; margin:0 auto'><iframe src='https://www.youtube.com/embed/ou6uUpu7Fy8?autoplay=0&rel=0&showinfo=0' frameborder=\"0\" allowfullscreen></iframe></div>");
    };
};

// when the entire window loads up:
$( window ).load( readyFn );

```

---

<div class="post-metadata">

**Author:** ![mrdiscourse](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@mrdiscourse](https://meta.discourse.org/u/mrdiscourse)\
**Post date:** [2016年五月3日 01:26 UTC](https://meta.discourse.org/t/youtube-video-not-showing-in-banner/43562/4 "2016-05-03T01:26:37Z")

</div>

Only thing is the jquery only runs on the first load of the site so video disappears if you navigate to any of the topics ☹

---

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [2016年五月3日 02:24 UTC](https://meta.discourse.org/t/youtube-video-not-showing-in-banner/43562/5 "2016-05-03T02:24:36Z")

</div>

If you use this plugin you can add a Youtube iframe to the banner post:  
[https://github.com/scossar/whitelist-iframe](https://github.com/scossar/whitelist-iframe)
