( ! empty( $options[ 'background_video' ] ) ) ? 'mp4:' . esc_url( $options[ 'background_video' ] ) : null, 'ogv' => ( ! empty( $options[ 'background_video_ogv' ] ) ) ? 'ogv:' . esc_url( $options[ 'background_video_ogv' ] ) : null, 'webm' => ( ! empty( $options[ 'background_video_webm' ] ) ) ? 'webm:' . esc_url( $options[ 'background_video_webm' ] ) : null, 'poster' => ( ! empty( $image_url ) ) ? 'poster:' . esc_url( $image_url ) : null ); // Add our videos to a string $video_output = array(); foreach( $video_types as $video => $val ) { $video_output[] = $val; } $video = null; // Video variable if ( $video_enabled && '' !== $options[ 'content' ] ) { $ext = ( ! empty( $image_url ) ) ? pathinfo( $image_url, PATHINFO_EXTENSION ) : false; $video_options = array(); if ( $ext ) { $video_options[ 'posterType' ] = 'posterType:' . $ext; } else { $video_options[ 'posterType' ] = 'posterType: none'; } $video_options[ 'className' ] = 'className:generate-page-header-video'; if ( apply_filters( 'generate_page_header_video_loop', true ) ) { $video_options[ 'loop' ] = 'loop:true'; } else { $video_options[ 'loop' ] = 'loop:false'; } if ( apply_filters( 'generate_page_header_video_muted', true ) ) { $video_options[ 'muted' ] = 'muted:true'; } else { $video_options[ 'muted' ] = 'muted:false'; } $video_options[ 'autoplay' ] = 'autoplay:false'; $video = sprintf( ' data-vide-bg="%1$s" data-vide-options="%2$s"', implode( ', ', array_filter( $video_output ) ), implode( ', ', array_filter( $video_options ) ) ); } // Write a class if we're merging the header $combined_content = ( '' !== $options[ 'merge' ] ) ? ' generate-combined-page-header' : ''; // If content is set, show it if ( '' !== $options[ 'content' ] && false !== $options[ 'content' ] ) { printf( '