<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[38985] trunk/src: Themes: Enable video in custom headers.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/38985">38985</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/38985","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>joemcgill</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-10-27 21:50:56 +0000 (Thu, 27 Oct 2016)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Themes: Enable video in custom headers.

This adds the ability for themes to add support for videos in custom headers
by passing `'video' => true` as an argument when adding theme support for
custom headers.

Custom video headers are managed through the ?\226?\128?\156Header Visuals?\226?\128?\157 (i.e. ?\226?\128?\156Header Image?\226?\128?\157)
panel in the Customizer where you can select a video from the media library or set a
URL to an external video (YouTube for now) for use in custom headers.

This introduces several new functions:

`has_header_video()` ?\226?\128?\147 Check whether a header video is set or not.
`get_header_video_url()` ?\226?\128?\147 Retrieve header video URL for custom header.
`the_header_video_url()` ?\226?\128?\147 Display header video URL.
`get_header_video_settings()` ?\226?\128?\147 Retrieve header video settings.
`has_custom_header()` ?\226?\128?\147 Check whether a custom header is set or not.
`get_custom_header_markup()` ?\226?\128?\147 Retrieve the markup for a custom header.
`the_custom_header_markup()` ?\226?\128?\147 Print the markup for a custom header.

And a new file, `wp-includes/js/wp-custom-header.js` that handles loading videos
in custom headers.

This also enables video headers in the Twenty Seventeen and Twenty Fourteen themes.

Props davidakennedy, celloexpressions, bradyvercher, laurelfulford, joemcgill.
Fixes <a href="https://core.trac.wordpress.org/ticket/38172">#38172</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpcontentthemestwentyfourteenfunctionsphp">trunk/src/wp-content/themes/twentyfourteen/functions.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteenheaderphp">trunk/src/wp-content/themes/twentyfourteen/header.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteeninccustomheaderphp">trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteeninccustomizerphp">trunk/src/wp-content/themes/twentyfourteen/inc/customizer.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteenjsfunctionsjs">trunk/src/wp-content/themes/twentyfourteen/js/functions.js</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteenstylecss">trunk/src/wp-content/themes/twentyfourteen/style.css</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenassetscssie8css">trunk/src/wp-content/themes/twentyseventeen/assets/css/ie8.css</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenfooterphp">trunk/src/wp-content/themes/twentyseventeen/footer.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenheaderphp">trunk/src/wp-content/themes/twentyseventeen/header.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeeninccustomheaderphp">trunk/src/wp-content/themes/twentyseventeen/inc/custom-header.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeeninccustomizerphp">trunk/src/wp-content/themes/twentyseventeen/inc/customizer.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeeninctemplatefunctionsphp">trunk/src/wp-content/themes/twentyseventeen/inc/template-functions.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeenstylecss">trunk/src/wp-content/themes/twentyseventeen/style.css</a></li>
<li><a href="#trunksrcwpcontentthemestwentyseventeentemplatepartsheaderheaderimagephp">trunk/src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizeheaderimagecontrolphp">trunk/src/wp-includes/customize/class-wp-customize-header-image-control.php</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
<li><a href="#trunksrcwpincludesthemephp">trunk/src/wp-includes/theme.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjswpcustomheaderjs">trunk/src/wp-includes/js/wp-custom-header.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpcontentthemestwentyfourteenfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfourteen/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfourteen/functions.php  2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyfourteen/functions.php    2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -434,7 +434,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $classes[] = 'group-blog';
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( get_header_image() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( get_header_image() || function_exists( 'has_header_video' ) && has_header_video() ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $classes[] = 'header-image';
</span><span class="cx" style="display: block; padding: 0 10px">        } elseif ( ! in_array( $GLOBALS['pagenow'], array( 'wp-activate.php', 'wp-signup.php' ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $classes[] = 'masthead-fixed';
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteenheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfourteen/header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfourteen/header.php     2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyfourteen/header.php       2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <body <?php body_class(); ?>>
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="page" class="hfeed site">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <?php if ( get_header_image() ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( function_exists( 'has_header_video' ) && has_header_video() ) : ?>
+               <div id="site-header">
+                       <?php the_custom_header_markup(); ?>
+               </div>
+       <?php elseif ( get_header_image() ) : ?>
</ins><span class="cx" style="display: block; padding: 0 10px">         <div id="site-header">
</span><span class="cx" style="display: block; padding: 0 10px">                <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
</span><span class="cx" style="display: block; padding: 0 10px">                        <img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteeninccustomheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php  2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php    2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,6 +40,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'width'                  => 1260,
</span><span class="cx" style="display: block; padding: 0 10px">                'height'                 => 240,
</span><span class="cx" style="display: block; padding: 0 10px">                'flex-height'            => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'video'                  => true,
</ins><span class="cx" style="display: block; padding: 0 10px">                 'wp-head-callback'       => 'twentyfourteen_header_style',
</span><span class="cx" style="display: block; padding: 0 10px">                'admin-head-callback'    => 'twentyfourteen_admin_header_style',
</span><span class="cx" style="display: block; padding: 0 10px">                'admin-preview-callback' => 'twentyfourteen_admin_header_image',
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteeninccustomizerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfourteen/inc/customizer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfourteen/inc/customizer.php     2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyfourteen/inc/customizer.php       2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,9 +16,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentyfourteen_customize_register( $wp_customize ) {
</span><span class="cx" style="display: block; padding: 0 10px">        // Add postMessage support for site title and description.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
-       $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
-       $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wp_customize->get_setting( 'blogname' )->transport          = 'postMessage';
+       $wp_customize->get_setting( 'blogdescription' )->transport   = 'postMessage';
+       $wp_customize->get_setting( 'header_textcolor' )->transport  = 'postMessage';
+       $wp_customize->get_setting( 'header_image' )->transport      = 'postMessage';
+       $wp_customize->get_setting( 'header_image_data' )->transport = 'postMessage';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        if ( isset( $wp_customize->selective_refresh ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $wp_customize->selective_refresh->add_partial( 'blogname', array(
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteenjsfunctionsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfourteen/js/functions.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfourteen/js/functions.js        2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyfourteen/js/functions.js  2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,16 +95,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                if ( _window.width() > 781 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        var mastheadHeight = $( '#masthead' ).height(),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                toolbarOffset, mastheadOffset;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         mastheadOffset;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( mastheadHeight > 48 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                body.removeClass( 'masthead-fixed' );
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        mastheadOffset = $( '#site-header' ).height();
+
</ins><span class="cx" style="display: block; padding: 0 10px">                         if ( body.is( '.header-image' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                toolbarOffset  = body.is( '.admin-bar' ) ? $( '#wpadminbar' ).height() : 0;
-                               mastheadOffset = $( '#masthead' ).offset().top - toolbarOffset;
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                // Recaculate the header height when a custom header loads.
+                               $( 'body' ).on( 'wp-custom-header-video-loaded', function() {
+                                       mastheadOffset = $( '#site-header' ).height();
+                               } );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                                 _window.on( 'scroll.twentyfourteen', function() {
</span><span class="cx" style="display: block; padding: 0 10px">                                        if ( _window.scrollTop() > mastheadOffset && mastheadHeight < 49 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                body.addClass( 'masthead-fixed' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,6 +117,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                body.removeClass( 'masthead-fixed' );
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                } );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                               // Update masthead offset after a selective refresh.
+                               if ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh ) {
+                                       wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() {
+                                               mastheadOffset = $( '#site-header' ).height();
+                                       } );
+                               }
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteenstylecss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyfourteen/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyfourteen/style.css      2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyfourteen/style.css        2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -88,6 +88,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> video {
</span><span class="cx" style="display: block; padding: 0 10px">        display: inline-block;
</span><span class="cx" style="display: block; padding: 0 10px">        max-width: 100%;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        height: auto;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> html {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -608,6 +609,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">        max-width: 100%;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+#wp-custom-header iframe,
+#wp-custom-header video {
+       margin-bottom: -8px;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> p > embed,
</span><span class="cx" style="display: block; padding: 0 10px"> p > iframe,
</span><span class="cx" style="display: block; padding: 0 10px"> p > object,
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenassetscssie8css"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/assets/css/ie8.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/assets/css/ie8.css    2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyseventeen/assets/css/ie8.css      2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,6 +68,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">        padding: 45px 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.has-header-image .custom-header-image img,
+.has-header-image .custom-header-image video {
+       left: 0;
+       top: 0;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .site-title {
</span><span class="cx" style="display: block; padding: 0 10px">        font-size: 36px;
</span><span class="cx" style="display: block; padding: 0 10px">        font-weight: bolder;
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenfooterphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/footer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/footer.php    2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyseventeen/footer.php      2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,31 +14,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        </div><!-- #content -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         </div><!-- #content -->
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <footer id="colophon" class="site-footer" role="contentinfo">
-               <div class="wrap">
-                       <?php
-                       get_template_part( 'template-parts/footer/footer', 'widgets' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <footer id="colophon" class="site-footer" role="contentinfo">
+                       <div class="wrap">
+                               <?php
+                               get_template_part( 'template-parts/footer/footer', 'widgets' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if ( has_nav_menu( 'social' ) ) : ?>
-                               <nav class="social-navigation" role="navigation" aria-label="<?php _e( 'Footer Social Links Menu', 'twentyseventeen' ); ?>">
-                                       <?php
-                                               wp_nav_menu( array(
-                                                       'theme_location' => 'social',
-                                                       'menu_class'     => 'social-links-menu',
-                                                       'depth'          => 1,
-                                                       'link_before'    => '<span class="screen-reader-text">',
-                                                       'link_after'     => '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ),
-                                               ) );
-                                       ?>
-                               </nav><!-- .social-navigation -->
-                       <?php endif;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         if ( has_nav_menu( 'social' ) ) : ?>
+                                       <nav class="social-navigation" role="navigation" aria-label="<?php _e( 'Footer Social Links Menu', 'twentyseventeen' ); ?>">
+                                               <?php
+                                                       wp_nav_menu( array(
+                                                               'theme_location' => 'social',
+                                                               'menu_class'     => 'social-links-menu',
+                                                               'depth'          => 1,
+                                                               'link_before'    => '<span class="screen-reader-text">',
+                                                               'link_after'     => '</span>' . twentyseventeen_get_svg( array( 'icon' => 'chain' ) ),
+                                                       ) );
+                                               ?>
+                                       </nav><!-- .social-navigation -->
+                               <?php endif;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        get_template_part( 'template-parts/footer/site', 'info' );
-                       ?>
-               </div><!-- .wrap -->
-       </footer><!-- #colophon -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         get_template_part( 'template-parts/footer/site', 'info' );
+                               ?>
+                       </div><!-- .wrap -->
+               </footer><!-- #colophon -->
+       </div><!-- .site-content-contain -->
</ins><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #page -->
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wp_footer(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/header.php    2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyseventeen/header.php      2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,4 +49,5 @@
</span><span class="cx" style="display: block; padding: 0 10px">        endif;
</span><span class="cx" style="display: block; padding: 0 10px">        ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <div id="content" class="site-content">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="site-content-contain">
+               <div id="content" class="site-content">
</ins></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeeninccustomheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/inc/custom-header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/inc/custom-header.php 2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyseventeen/inc/custom-header.php   2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,6 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'width'              => 2000,
</span><span class="cx" style="display: block; padding: 0 10px">                'height'             => 1200,
</span><span class="cx" style="display: block; padding: 0 10px">                'flex-height'        => true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'video'              => true,
</ins><span class="cx" style="display: block; padding: 0 10px">                 'wp-head-callback'   => 'twentyseventeen_header_style',
</span><span class="cx" style="display: block; padding: 0 10px">        ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeeninccustomizerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/inc/customizer.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/inc/customizer.php    2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyseventeen/inc/customizer.php      2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,9 +13,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @param WP_Customize_Manager $wp_customize Theme Customizer object.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function twentyseventeen_customize_register( $wp_customize ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
-       $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
-       $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $wp_customize->get_setting( 'blogname' )->transport          = 'postMessage';
+       $wp_customize->get_setting( 'blogdescription' )->transport   = 'postMessage';
+       $wp_customize->get_setting( 'header_textcolor' )->transport  = 'postMessage';
+       $wp_customize->get_setting( 'header_image' )->transport      = 'postMessage';
+       $wp_customize->get_setting( 'header_image_data' )->transport = 'postMessage';
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $wp_customize->selective_refresh->add_partial( 'blogname', array(
</span><span class="cx" style="display: block; padding: 0 10px">                'selector' => '.site-title a',
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeeninctemplatefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/inc/template-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/inc/template-functions.php    2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyseventeen/inc/template-functions.php      2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,7 +35,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Add a class if there is a custom header.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( has_header_image() ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( has_header_image() || has_header_video() && is_front_page() ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 $classes[] = 'has-header-image';
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeenstylecss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/style.css     2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyseventeen/style.css       2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1314,6 +1314,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        border-top: 1px solid #eee;
</span><span class="cx" style="display: block; padding: 0 10px">        font-size: 16px;
</span><span class="cx" style="display: block; padding: 0 10px">        font-size: 1rem;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        position: relative;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> .navigation-top .wrap {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1555,8 +1556,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> .site-branding {
</span><span class="cx" style="display: block; padding: 0 10px">        padding: 1em 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        position: relative;
</ins><span class="cx" style="display: block; padding: 0 10px">         -webkit-transition: margin-bottom 0.2s;
</span><span class="cx" style="display: block; padding: 0 10px">        transition: margin-bottom 0.2s;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        z-index: 3;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> .site-branding a {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1650,15 +1653,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> .custom-header-image {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        background-position: center center;
-       background-repeat: no-repeat;
-       -webkit-background-size: cover;
-       background-size: cover;
</del><span class="cx" style="display: block; padding: 0 10px">         bottom: 0;
</span><span class="cx" style="display: block; padding: 0 10px">        left: 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        overflow: hidden;
</ins><span class="cx" style="display: block; padding: 0 10px">         position: absolute;
</span><span class="cx" style="display: block; padding: 0 10px">        right: 0;
</span><span class="cx" style="display: block; padding: 0 10px">        top: 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        width: 100%;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> .custom-header-image:before {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1674,12 +1675,37 @@
</span><span class="cx" style="display: block; padding: 0 10px">        left: 0;
</span><span class="cx" style="display: block; padding: 0 10px">        position: absolute;
</span><span class="cx" style="display: block; padding: 0 10px">        right: 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        z-index: 2;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image {
-       background-position: center bottom;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.has-header-image .custom-header-image img,
+.has-header-image .custom-header-image video,
+.has-header-image .custom-header-image iframe {
+       position: fixed;
+       height: auto;
+       left: 50%;
+       max-width: 1000%;
+       min-height: 100%;
+       min-width: 100%;
+       min-width: 100vw; /* vw prevents 1px gap on left that 100% has */
+       width: auto;
+       top: 50%;
+       -ms-transform: translateX(-50%) translateY(-50%);
+       -moz-transform: translateX(-50%) translateY(-50%);
+       -webkit-transform: translateX(-50%) translateY(-50%);
+       transform: translateX(-50%) translateY(-50%);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image img {
+       bottom: 0;
+       position: absolute;
+       top: auto;
+       -ms-transform: translateX(-50%) translateY(0);
+       -moz-transform: translateX(-50%) translateY(0);
+       -webkit-transform: translateX(-50%) translateY(0);
+       transform: translateX(-50%) translateY(0);
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> body:not(.has-header-image) .custom-header-image {
</span><span class="cx" style="display: block; padding: 0 10px">        padding: 5% 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1777,6 +1803,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ## Regular Content
</span><span class="cx" style="display: block; padding: 0 10px"> --------------------------------------------------------------*/
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.site-content-contain {
+       background-color: #fff;
+       position: relative;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .site-content {
</span><span class="cx" style="display: block; padding: 0 10px">        padding: 2.5em 0 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2642,7 +2673,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> # Media
</span><span class="cx" style="display: block; padding: 0 10px"> --------------------------------------------------------------*/
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-img {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+img,
+video {
</ins><span class="cx" style="display: block; padding: 0 10px">         height: auto; /* Make sure images are scaled correctly. */
</span><span class="cx" style="display: block; padding: 0 10px">        max-width: 100%; /* Adhere to container width. */
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3287,7 +3319,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        .has-header-image.twentyseventeen-front-page .custom-header,
</span><span class="cx" style="display: block; padding: 0 10px">        .has-header-image.home.blog .custom-header {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                display: block;
</del><span class="cx" style="display: block; padding: 0 10px">                 min-height: 0;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3296,6 +3327,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                position: relative;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        .twentyseventeen-front-page.has-header-image .custom-header-image,
+       .home.blog.has-header-image .custom-header-image {
+               height: 0;
+               position: relative;
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image {
</span><span class="cx" style="display: block; padding: 0 10px">                bottom: 0;
</span><span class="cx" style="display: block; padding: 0 10px">                height: auto;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3305,13 +3342,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                top: 0;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        .twentyseventeen-front-page.has-header-image .custom-header-image,
-       .home.blog.has-header-image .custom-header-image {
-               height: 0;
-               padding-top: 66%;
-               position: relative;
-       }
-
</del><span class="cx" style="display: block; padding: 0 10px">         .custom-logo-link {
</span><span class="cx" style="display: block; padding: 0 10px">                padding-right: 2em;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3591,7 +3621,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                height: 1200px;
</span><span class="cx" style="display: block; padding: 0 10px">                height: 100vh;
</span><span class="cx" style="display: block; padding: 0 10px">                max-height: 100%;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                padding: 10% 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         overflow: hidden;
+               /* padding: 10% 0; */
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        .twentyseventeen-front-page.has-header-image .custom-header-image:before,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3938,11 +3969,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> @media screen and ( min-width: 55em ) {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        .twentyseventeen-front-page.has-header-image .custom-header-image,
-       .home.blog.has-header-image .custom-header-image {
-               background-attachment: fixed;
-       }
-
</del><span class="cx" style="display: block; padding: 0 10px">         .panel-image {
</span><span class="cx" style="display: block; padding: 0 10px">                background-attachment: fixed;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyseventeentemplatepartsheaderheaderimagephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php        2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php  2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,12 +14,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">        $header_image = get_header_image();
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Check if Custom Header image has been added.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        if ( ! empty( $header_image ) ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( has_custom_header() ) :
+       ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <div class="custom-header-image" style="background-image: url(<?php echo esc_url( $header_image ); ?>)"></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <?php // Output the full custom header - video and/or image fallback. ?>
+               <div class="custom-header-image">
+                       <?php the_custom_header_markup(); ?>
+               </div>
</ins><span class="cx" style="display: block; padding: 0 10px">                 <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        <?php else : ?>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px">                 <?php // Otherwise, show a blank header. ?>
</span><span class="cx" style="display: block; padding: 0 10px">                <div class="custom-header-simple">
</span><span class="cx" style="display: block; padding: 0 10px">                        <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizemanagerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-customize-manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-manager.php      2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-includes/class-wp-customize-manager.php        2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,6 +363,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_section_templates' ), 1 );
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'customize_controls_print_footer_scripts', array( $this, 'render_control_templates' ), 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                // Export header video settings with the partial response.
+               add_filter( 'customize_render_partials_response', array( $this, 'export_header_video_settings' ), 10, 3 );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 // Export the settings to JS via the _wpCustomizeSettings variable.
</span><span class="cx" style="display: block; padding: 0 10px">                add_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_pane_settings' ), 1000 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3249,12 +3252,54 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /* Custom Header */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                if ( current_theme_supports( 'custom-header', 'video' ) ) {
+                       $title = __( 'Header Visuals' );
+                       $description = __( 'If you add a video, the image will be used as a fallback while the video loads.' );
+                       $width = absint( get_theme_support( 'custom-header', 'width' ) );
+                       $height = absint( get_theme_support( 'custom-header', 'height' ) );
+                       if ( $width && $height ) {
+                               /* translators: %s: header size in pixels */
+                               $control_description = sprintf( __( 'Upload your video in <code>.mp4</code> format and minimize its file size for best results. Your theme recommends dimensions of %s pixels.' ),
+                                       sprintf( '<strong>%s &times; %s</strong>', $width, $height )
+                               );
+                       } elseif ( $width ) {
+                               /* translators: %s: header width in pixels */
+                               $control_description = sprintf( __( 'Upload your video in <code>.mp4</code> format and minimize its file size for best results. Your theme recommends a width of %s pixels.' ),
+                                       sprintf( '<strong>%s</strong>', $width )
+                               );
+                       } else {
+                               /* translators: %s: header height in pixels */
+                               $control_description = sprintf( __( 'Upload your video in <code>.mp4</code> format and minimize its file size for best results. Your theme recommends a height of %s pixels.' ),
+                                       sprintf( '<strong>%s</strong>', $height )
+                               );
+                       }
+               } else {
+                       $title = __( 'Header Image' );
+                       $description = '';
+                       $control_description = '';
+               }
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->add_section( 'header_image', array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'title'          => __( 'Header Image' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'title'          => $title,
+                       'description'    => $description,
</ins><span class="cx" style="display: block; padding: 0 10px">                         'theme_supports' => 'custom-header',
</span><span class="cx" style="display: block; padding: 0 10px">                        'priority'       => 60,
</span><span class="cx" style="display: block; padding: 0 10px">                ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $this->add_setting( 'header_video', array(
+                       'theme_supports'    => array( 'custom-header', 'video' ),
+                       'transport'         => 'postMessage',
+                       'sanitize_callback' => 'absint',
+                       'validate_callback' => array( $this, '_validate_header_video' ),
+               ) );
+
+               $this->add_setting( 'external_header_video', array(
+                       'theme_supports'    => array( 'custom-header', 'video' ),
+                       'transport'         => 'postMessage',
+                       'sanitize_callback' => 'esc_url',
+                       'validate_callback' => array( $this, '_validate_external_header_video' ),
+               ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->add_setting( new WP_Customize_Filter_Setting( $this, 'header_image', array(
</span><span class="cx" style="display: block; padding: 0 10px">                        'default'        => get_theme_support( 'custom-header', 'default-image' ),
</span><span class="cx" style="display: block; padding: 0 10px">                        'theme_supports' => 'custom-header',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3265,8 +3310,30 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'theme_supports' => 'custom-header',
</span><span class="cx" style="display: block; padding: 0 10px">                ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $this->add_control( new WP_Customize_Media_Control( $this, 'header_video', array(
+                       'theme_supports' => array( 'custom-header', 'video' ),
+                       'label'          => __( 'Header Video' ),
+                       'description'    => $control_description,
+                       'section'        => 'header_image',
+                       'mime_type'      => 'video',
+               ) ) );
+
+               $this->add_control( 'external_header_video', array(
+                       'theme_supports' => array( 'custom-header', 'video' ),
+                       'type'           => 'url',
+                       'description'    => __( 'Or, enter a YouTube or Vimeo URL:' ),
+                       'section'        => 'header_image',
+               ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 $this->add_control( new WP_Customize_Header_Image_Control( $this ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $this->selective_refresh->add_partial( 'custom_header', array(
+                       'selector'            => '#wp-custom-header',
+                       'render_callback'     => 'the_custom_header_markup',
+                       'settings'            => array( 'header_video', 'external_header_video', 'header_image' ), // The image is used as a video fallback here.
+                       'container_inclusive' => true,
+               ) );
+
</ins><span class="cx" style="display: block; padding: 0 10px">                 /* Custom Background */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $this->add_section( 'background_image', array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3705,6 +3772,71 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Export header video settings to facilitate selective refresh.
+        *
+        * @since 4.7.0
+        *
+        * @param array $response Response.
+        * @param WP_Customize_Selective_Refresh $selective_refresh Selective refresh component.
+        * @param array $partials Array of partials.
+        * @return array
+        */
+       public function export_header_video_settings( $response, $selective_refresh, $partials ) {
+               if ( isset( $partials['header_video'] ) || isset( $partials['external_header_video'] ) ) {
+                       $response['custom_header_settings'] = get_header_video_settings();
+               }
+
+               return $response;
+       }
+
+       /**
+        * Callback for validating the header_video value.
+        *
+        * Ensures that the selected video is less than 8MB and provides an error message.
+        *
+        * @since 4.7.0
+        *
+        * @param WP_Error $validity
+        * @param mixed $value
+        * @return mixed
+        */
+       public function _validate_header_video( $validity, $value ) {
+               $video = get_attached_file( absint( $value ) );
+               if ( $video ) {
+                       $size = filesize( $video );
+                       if ( 8 < $size / pow( 1024, 2 ) ) { // Check whether the size is larger than 8MB.
+                               $validity->add( 'size_too_large', __( 'This video file is too large to use as a header video. Try a shorter video or optimize the compression settings and re-upload a file that is less than 8MB. Or, upload your video to YouTube and link it with the option below.' ) );
+                       }
+                       if ( '.mp4' !== substr( $video, -4 ) && '.mov' !== substr( $video, -4 ) ) { // Check for .mp4 or .mov format, which (assuming h.264 encoding) are the only cross-browser-supported formats.
+                               $validity->add( 'invalid_file_type', __( 'Only <code>.mp4</code> or <code>.mov</code> files may be used for header video. Please convert your video file and try again, or, upload your video to YouTube and link it with the option below.' ) );
+                       }
+               }
+               return $validity;
+       }
+
+       /**
+        * Callback for validating the external_header_video value.
+        *
+        * Ensures that the provided URL is for YouTube or Vimeo.
+        *
+        * @since 4.7.0
+        *
+        * @param WP_Error $validity
+        * @param mixed $value
+        * @return mixed
+        */
+       public function _validate_external_header_video( $validity, $value ) {
+               $video = esc_url( $value );
+               if ( $video ) {
+                       if ( ! preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video )
+                            && ! preg_match( '#^https?://(.+\.)?vimeo\.com/.*#', $video ) ) {
+                               $validity->add( 'invalid_url', __( 'Please enter a valid YouTube or Vimeo video URL.' ) );
+                       }
+               }
+               return $validity;
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Callback for rendering the custom logo, used in the custom_logo partial.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * This method exists because the partial object and context data are passed
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizeheaderimagecontrolphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/customize/class-wp-customize-header-image-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-header-image-control.php       2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-includes/customize/class-wp-customize-header-image-control.php 2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -166,9 +166,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $height = absint( get_theme_support( 'custom-header', 'height' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                ?>
</span><span class="cx" style="display: block; padding: 0 10px">                <div class="customize-control-content">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <p class="customizer-section-intro">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <?php if ( current_theme_supports( 'custom-header', 'video' ) ) {
+                               echo '<span class="customize-control-title">' . $this->label . '</span>';
+                       } ?>
+                       <p class="customizer-section-intro customize-control-description">
</ins><span class="cx" style="display: block; padding: 0 10px">                                 <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if ( $width && $height ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         if ( current_theme_supports( 'custom-header', 'video' ) ) {
+                                       _e( 'While you can crop images to your liking after clicking <strong>Add new image</strong>, we recommend matching the size of your video.' );
+                               } elseif ( $width && $height ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                         /* translators: %s: header size in pixels */
</span><span class="cx" style="display: block; padding: 0 10px">                                        printf( __( 'While you can crop images to your liking after clicking <strong>Add new image</strong>, your theme recommends a header size of %s pixels.' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                                sprintf( '<strong>%s &times; %s</strong>', $width, $height )
</span></span></pre></div>
<a id="trunksrcwpincludesjswpcustomheaderjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/wp-includes/js/wp-custom-header.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/wp-custom-header.js                              (rev 0)
+++ trunk/src/wp-includes/js/wp-custom-header.js        2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,149 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+(function( window, $, settings ) {
+
+       function wpCustomHeader() {
+               var handlers = {
+                       nativeVideo: {
+                               test: function( settings ) {
+                                       var video = document.createElement( 'video' );
+                                       return video.canPlayType( settings.mimeType );
+                               },
+                               callback: nativeHandler
+                       },
+                       youtube: {
+                               test: function( settings ) {
+                                       return 'video/x-youtube' === settings.mimeType;
+                               },
+                               callback: youtubeHandler
+                       }
+               };
+
+               function initialize() {
+                       settings.container = document.getElementById( 'wp-custom-header' );
+
+                       if ( supportsVideo() ) {
+                               for ( var id in handlers ) {
+                                       var handler = handlers[ id ];
+
+                                       if ( handlers.hasOwnProperty( id ) && handler.test( settings ) ) {
+                                               handler.callback( settings );
+                                               break;
+                                       }
+                               }
+
+                               $( 'body' ).trigger( 'wp-custom-header-video-loaded' );
+                       }
+               }
+
+               function supportsVideo() {
+                       // Don't load video on small screens. @todo: consider bandwidth and other factors.
+                       if ( window.innerWidth < settings.minWidth  || window.innerHeight < settings.minHeight ) {
+                               return false;
+                       }
+
+                       return true;
+               }
+
+               return {
+                       handlers: handlers,
+                       initialize: initialize,
+                       supportsVideo: supportsVideo
+               };
+       }
+
+       function nativeHandler( settings ) {
+               var video = document.createElement( 'video' );
+
+               video.id = 'wp-custom-header-video';
+               video.autoplay = 'autoplay';
+               video.loop = 'loop';
+               video.muted = 'muted';
+               video.width = settings.width;
+               video.height = settings.height;
+
+               video.addEventListener( 'click', function() {
+                       if ( video.paused ) {
+                               video.play();
+                       } else {
+                               video.pause();
+                       }
+               });
+
+               settings.container.innerHTML = '';
+               settings.container.appendChild( video );
+               video.src = settings.videoUrl;
+       }
+
+       function youtubeHandler( settings ) {
+               // @link http://stackoverflow.com/a/27728417
+               var VIDEO_ID_REGEX = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/,
+                       videoId = settings.videoUrl.match( VIDEO_ID_REGEX )[1];
+
+               function loadVideo() {
+                       var YT = window.YT || {};
+
+                       YT.ready(function() {
+                               var video = document.createElement( 'div' );
+                               video.id = 'wp-custom-header-video';
+                               settings.container.innerHTML = '';
+                               settings.container.appendChild( video );
+
+                               new YT.Player( video, {
+                                       height: settings.height,
+                                       width: settings.width,
+                                       videoId: videoId,
+                                       events: {
+                                               onReady: function( e ) {
+                                                       e.target.mute();
+                                               },
+                                               onStateChange: function( e ) {
+                                                       if ( YT.PlayerState.ENDED === e.data ) {
+                                                               e.target.playVideo();
+                                                       }
+                                               }
+                                       },
+                                       playerVars: {
+                                               autoplay: 1,
+                                               controls: 0,
+                                               disablekb: 1,
+                                               fs: 0,
+                                               iv_load_policy: 3,
+                                               loop: 1,
+                                               modestbranding: 1,
+                                               //origin: '',
+                                               playsinline: 1,
+                                               rel: 0,
+                                               showinfo: 0
+                                       }
+                               });
+                       });
+               }
+
+               if ( 'YT' in window ) {
+                       loadVideo();
+               } else {
+                       var tag = document.createElement( 'script' );
+                       tag.src = 'https://www.youtube.com/player_api';
+                       tag.onload = function () { loadVideo(); };
+                       document.getElementsByTagName( 'head' )[0].appendChild( tag );
+               }
+       }
+
+       window.wp = window.wp || {};
+       window.wp.customHeader = new wpCustomHeader();
+       document.addEventListener( 'DOMContentLoaded', window.wp.customHeader.initialize, false );
+
+       if ( 'customize' in window.wp ) {
+               wp.customize.selectiveRefresh.bind( 'render-partials-response', function( response ) {
+                       if ( 'custom_header_settings' in response ) {
+                               settings = response.custom_header_settings;
+                       }
+               });
+
+               wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
+                       if ( 'custom_header' === placement.partial.id ) {
+                               window.wp.customHeader.initialize();
+                       }
+               });
+       }
+
+})( window, jQuery, window._wpCustomHeaderSettings || {} );
</ins></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php   2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-includes/script-loader.php     2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -479,6 +479,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        $scripts->add( 'customize-nav-menus', "/wp-admin/js/customize-nav-menus$suffix.js", array( 'jquery', 'wp-backbone', 'customize-controls', 'accordion', 'nav-menu' ), false, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">        $scripts->add( 'customize-preview-nav-menus', "/wp-includes/js/customize-preview-nav-menus$suffix.js", array( 'jquery', 'wp-util', 'customize-preview', 'customize-selective-refresh' ), false, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        $scripts->add( 'wp-custom-header', "/wp-includes/js/wp-custom-header$suffix.js", array(), false, 1 );
+
</ins><span class="cx" style="display: block; padding: 0 10px">         $scripts->add( 'accordion', "/wp-admin/js/accordion$suffix.js", array( 'jquery' ), false, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
</span></span></pre></div>
<a id="trunksrcwpincludesthemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme.php   2016-10-27 20:52:20 UTC (rev 38984)
+++ trunk/src/wp-includes/theme.php     2016-10-27 21:50:56 UTC (rev 38985)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1264,6 +1264,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                'thumbnail_url' => '',
</span><span class="cx" style="display: block; padding: 0 10px">                'width'         => get_theme_support( 'custom-header', 'width' ),
</span><span class="cx" style="display: block; padding: 0 10px">                'height'        => get_theme_support( 'custom-header', 'height' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                'video'         => get_theme_support( 'custom-header', 'video' ),
</ins><span class="cx" style="display: block; padding: 0 10px">         );
</span><span class="cx" style="display: block; padding: 0 10px">        return (object) wp_parse_args( $data, $default );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1311,6 +1312,138 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Check whether a header video is set or not.
+ *
+ * @since 4.7.0
+ *
+ * @see get_header_video_url()
+ *
+ * @return bool Whether a header video is set or not.
+ */
+function has_header_video() {
+       return (bool) get_header_video_url();
+}
+
+/* Retrieve header video URL for custom header.
+ *
+ * Uses a local video if present, or falls back to an external video. Returns false if there is no video.
+ *
+ * @since 4.7.0
+ *
+ * @return string|false
+ */
+function get_header_video_url() {
+       $id = absint( get_theme_mod( 'header_video' ) );
+       $url = esc_url( get_theme_mod( 'external_header_video' ) );
+
+       if ( ! $id && ! $url ) {
+               return false;
+       }
+
+       if ( $id ) {
+               // Get the file URL from the attachment ID.
+               $url = wp_get_attachment_url( $id );
+       }
+
+       return esc_url_raw( set_url_scheme( $url ) );
+}
+
+/**
+ * Display header video URL.
+ *
+ * @since 4.7.0
+ */
+function the_header_video_url() {
+       $video = get_header_video_url();
+       if ( $video ) {
+               echo esc_url( $video );
+       }
+}
+
+/**
+ * Retrieve header video settings.
+ *
+ * @since 4.7.0
+ *
+ * @return array
+ */
+function get_header_video_settings() {
+       $header     = get_custom_header();
+       $video_url  = get_header_video_url();
+       $video_type = wp_check_filetype( $video_url, wp_get_mime_types() );
+
+       $settings = array(
+               'mimeType'  => '',
+               'posterUrl' => get_header_image(),
+               'videoUrl'  => $video_url,
+               'width'     => absint( $header->width ),
+               'height'    => absint( $header->height ),
+               'minWidth'  => 900,
+               'minHeight' => 500,
+       );
+
+       if ( preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video_url ) ) {
+               $settings['mimeType'] = 'video/x-youtube';
+       } elseif ( preg_match( '#^https?://(.+\.)?vimeo\.com/.*#', $video_url ) ) {
+               $settings['mimeType'] = 'video/x-vimeo';
+       } elseif ( ! empty( $video_type['type'] ) ) {
+               $settings['mimeType'] = $video_type['type'];
+       }
+
+       return apply_filters( 'header_video_settings', $settings );
+}
+
+/**
+ * Check whether a custom header is set or not.
+ *
+ * @since 4.7.0
+ *
+ * @return bool True if a custom header is set. False if not.
+ */
+function has_custom_header() {
+       if ( has_header_image() || ( is_front_page() && has_header_video() ) ) {
+               return true;
+       }
+
+       return false;
+}
+
+/**
+ * Retrieve the markup for a custom header.
+ *
+ * @since 4.7.0
+ *
+ * @return string|false The markup for a custom header on success. False if not.
+ */
+function get_custom_header_markup() {
+       if ( ! has_custom_header() ) {
+               return false;
+       }
+
+       return sprintf(
+               '<div id="wp-custom-header" class="wp-custom-header">%s</div>',
+               get_header_image_tag()
+       );
+}
+
+/**
+ * Print the markup for a custom header.
+ *
+ * @since 4.7.0
+ */
+function the_custom_header_markup() {
+       if ( ! $custom_header = get_custom_header_markup() ) {
+               return;
+       }
+       echo $custom_header;
+
+       if ( has_header_video() && is_front_page() ) {
+               wp_enqueue_script( 'wp-custom-header' );
+               wp_localize_script( 'wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings() );
+       }
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * Retrieve background image for custom background.
</span><span class="cx" style="display: block; padding: 0 10px">  *
</span><span class="cx" style="display: block; padding: 0 10px">  * @since 3.0.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1732,6 +1865,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'wp-head-callback' => '',
</span><span class="cx" style="display: block; padding: 0 10px">                                'admin-head-callback' => '',
</span><span class="cx" style="display: block; padding: 0 10px">                                'admin-preview-callback' => '',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                'video' => false,
</ins><span class="cx" style="display: block; padding: 0 10px">                         );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $jit = isset( $args[0]['__jit'] );
</span></span></pre>
</div>
</div>

</body>
</html>