[wp-trac] [WordPress Trac] #39893: Header Media: YouTube Embed Does Not Fill Screen

WordPress Trac noreply at wordpress.org
Wed Aug 1 14:20:59 UTC 2018


#39893: Header Media: YouTube Embed Does Not Fill Screen
--------------------------+------------------------------
 Reporter:  cingrosso     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  4.7.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by domainsupport):

 Hi @bradyvercher, I saw that you said it wasn't working yet for the
 horizontal. I've edited your JS code slightly (you probably won't want to
 use jQuery but I'm sure you'll see what I've done) and it now works
 replacing ...

 {{{
                         } else {
                                 iframe.style.height = containerWidth * 9 /
 16 + 'px';
                                 iframe.style.width = containerWidth +
 'px';
                         }
 }}}

 ... with ...

 {{{
                         } else {
                                 iframe.style.height = containerWidth * 9 /
 16 + 'px';
                                 var containingContainerHeight =
 (containerWidth * 9 / 16) - jQuery('.navigation-top').height();
                                 jQuery('.admin-bar.twentyseventeen-front-
 page.has-header-video .custom-header-
 media').height(containingContainerHeight);
                                 jQuery('.has-header-image.twentyseventeen-
 front-page .custom-header, .has-header-video.twentyseventeen-front-page
 .custom-header').height(containingContainerHeight);
                                 iframe.style.width = containerWidth +
 'px';
                         }
 }}}

 Hope that helps.

 Oliver

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/39893#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list