<?php
/**
 * The template to display the background video in the header
 *
 * @package PANTRY
 * @since PANTRY 1.0.14
 */
$pantry_header_video = pantry_get_header_video();
$pantry_embed_video  = '';
if ( ! empty( $pantry_header_video ) && ! pantry_is_from_uploads( $pantry_header_video ) ) {
	if ( pantry_is_youtube_url( $pantry_header_video ) && preg_match( '/[=\/]([^=\/]*)$/', $pantry_header_video, $matches ) && ! empty( $matches[1] ) ) {
		?><div id="background_video" data-youtube-code="<?php echo esc_attr( $matches[1] ); ?>"></div>
		<?php
	} else {
		?>
		<div id="background_video"><?php pantry_show_layout( pantry_get_embed_video( $pantry_header_video ) ); ?></div>
		<?php
	}
}
