%s', arve_get_var_dump( $options ) );
}
$show_options_debug = false;
}
$pre_style = ''
. 'background-color: #111;'
. 'color: #eee;'
. 'font-size: 15px;'
. 'white-space: pre-wrap;'
. 'word-wrap: break-word;';
if ( ! empty( $_GET['arve-debug-attr'] ) ) {
$html .= sprintf(
'
attr[%s]: %s
',
esc_attr( $pre_style ),
esc_html( $_GET['arve-debug-attr'] ),
arve_get_var_dump( $atts[ $_GET['arve-debug-attr'] ] )
);
}
if ( isset( $_GET['arve-debug-atts'] ) ) {
$html .= sprintf( '$atts: %s
', esc_attr( $pre_style ), arve_get_var_dump( $input_atts ) );
$html .= sprintf( '$arve: %s
', esc_attr( $pre_style ), arve_get_var_dump( $atts ) );
}
if ( isset( $_GET['arve-debug-html'] ) ) {
$html .= sprintf( '%s
', esc_attr( $pre_style ), esc_html( $input_html ) );
}
return $html;
}
function arve_build_meta_html( $atts ) {
$meta = '';
if ( ! empty( $atts['sources'] ) ) {
$first_source = arve_get_first_array_value( $atts['sources'] );
$meta .= sprintf( '', esc_attr( $first_source['src'] ) );
}
if ( ! empty( $atts['iframe_src'] ) ) {
$meta .= sprintf( '', esc_attr( $atts['iframe_src'] ) );
}
if ( ! empty( $atts['upload_date'] ) ) {
$meta .= sprintf( '', esc_attr( $atts['upload_date'] ) );
}
if ( ! empty( $atts['duration'] ) ) {
$meta .= sprintf( '', esc_attr( $atts['duration'] ) );
}
if( ! empty( $atts['img_src'] ) ) :
if( in_array( $atts['mode'], array( 'lazyload', 'lazyload-lightbox' ) ) ) {
$meta .= sprintf(
'
',
arve_attr( array(
'class' => 'arve-thumbnail',
'data-object-fit' => true,
'itemprop' => 'thumbnailUrl',
'src' => $atts['img_src'],
'srcset' => ! empty( $atts['img_srcset'] ) ? $atts['img_srcset'] : false,
#'sizes' => '(max-width: 700px) 100vw, 1280px',
'alt' => __( 'Video Thumbnail', ARVE_SLUG ),
) )
);
} else {
$meta .= sprintf(
'',
arve_attr( array(
'itemprop' => 'thumbnailUrl',
'content' => $atts['img_src'],
) )
);
}
endif;
if ( ! empty( $atts['title'] ) && in_array( $atts['mode'], array( 'lazyload', 'lazyload-lightbox' ) ) && empty( $atts['hide_title'] ) ) {
$meta .= '' . trim( $atts['title'] ) . '
';
} elseif( ! empty( $atts['title'] ) ) {
$meta .= sprintf( '', esc_attr( trim( $atts['title'] ) ) );
}
if ( ! empty( $atts['description'] ) ) {
$meta .= '' . esc_html( trim( $atts['description'] ) ) . '';
}
return $meta;
}
function arve_build_promote_link_html( $arve_link ) {
if ( $arve_link ) {
return sprintf(
'%s',
esc_url( 'https://nextgenthemes.com/plugins/advanced-responsive-video-embedder-pro/' ),
esc_attr( __( 'Embedded with ARVE Advanced Responsive Video Embedder WordPress plugin', ARVE_SLUG) ),
esc_html__( 'ARVE', ARVE_SLUG )
);
}
return '';
}
function arve_arve_embed_container( $html, $atts ) {
$attr['class'] = 'arve-embed-container';
if ( false === $atts['aspect_ratio'] ) {
$attr['style'] = 'height:auto;padding:0';
} else {
$attr['style'] = sprintf( 'padding-bottom:%F%%', arve_aspect_ratio_to_percentage( $atts['aspect_ratio'] ) );
}
return sprintf( '%s
', arve_attr( $attr ), $html );
}
function arve_arve_wrapper( $html, $atts ) {
$element = ( 'link-lightbox' == $atts['mode'] ) ? 'span' : 'div';
return sprintf(
'<%s%s>%s%s>',
$element,
arve_attr( $atts['wrapper_attr'] ),
$html,
$element
);
}
function arve_video_or_iframe( $atts ) {
switch( $atts['provider'] ) {
case 'veoh':
return arve_create_object( $atts );
break;
case 'html5':
return arve_create_video_tag( $atts );
break;
default:
return arve_create_iframe_tag( $atts );
break;
}
}
/**
*
*
* @since 2.6.0
*/
function arve_create_iframe_tag( $a ) {
if ( in_array( $a['mode'], array( 'lazyload', 'lazyload-lightbox', 'link-lightbox' ) ) ) {
$html = sprintf(
'',
arve_attr( arve_prefix_array_keys( 'data-', $a['iframe_attr'] ) )
);
} else {
$html = sprintf( '', arve_attr( $a['iframe_attr'] ) );
}
return apply_filters( 'arve_iframe_tag', $html, $a, $a['iframe_attr'] );
}
function arve_create_video_tag( $a ) {
$html = sprintf(
'',
arve_attr( $a['video_attr'] ),
$a['video_sources_html'],
$a['video_tracks_html']
);
return apply_filters( 'arve_video_tag', $html, $a, $a['video_attr'] );
}
function arve_create_object_tag( $a ) {
$html = sprintf(
'',
arve_attr( $a['video_attr'] ),
$a['video_sources_html'],
$a['video_tracks_html']
);
return apply_filters( 'arve_video_tag', $html, $a, $a['video_attr'] );
}
function arve_error( $message ) {
return sprintf(
'%s %s
',
__('ARVE Error:', ARVE_SLUG ),
$message
);
}
function arve_output_errors( $atts ) {
$errors = '';
foreach ( $atts as $key => $value ) {
if( is_wp_error( $value ) ) {
$errors .= arve_error( $value->get_error_message() );
}
}
return $errors;
}