<?php
/**
 * The template to display the background video in the header
 *
 * @package TOOTH FAIRY
 * @since TOOTH FAIRY 1.0.14
 */
$tooth_fairy_header_video = tooth_fairy_get_header_video();
$tooth_fairy_embed_video  = '';
if ( ! empty( $tooth_fairy_header_video ) && ! tooth_fairy_is_from_uploads( $tooth_fairy_header_video ) ) {
	if ( tooth_fairy_is_youtube_url( $tooth_fairy_header_video ) && preg_match( '/[=\/]([^=\/]*)$/', $tooth_fairy_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 tooth_fairy_show_layout( tooth_fairy_get_embed_video( $tooth_fairy_header_video ) ); ?></div>
		<?php
	}
}
