sanitize_text_field( $attributes['uid'] ),
'autoplay' => (int) $attributes['autoplay'],
'loop' => (int) $attributes['loop'],
'muted' => (int) $attributes['muted'],
'controls' => (int) $attributes['controls'],
'modestbranding' => (int) $attributes['modestbranding'],
'cc_load_policy' => (int) $attributes['cc_load_policy'],
'iv_load_policy' => (int) $attributes['iv_load_policy'],
'hl' => sanitize_text_field( $attributes['hl'] ),
'cc_lang_pref' => sanitize_text_field( $attributes['cc_lang_pref'] )
);
$featured = $videos[0]; // Featured Video
?>
thumbnails->default ) ) {
$image_src = $video->thumbnails->default->url;
}
if ( 75 == (int) $attributes['player_ratio'] ) { // 4:3 ( default - 120x90, high - 480x360, standard - 640x480 )
if ( isset( $video->thumbnails->high ) ) {
$image_src = $video->thumbnails->high->url;
}
}
if ( 56.25 == (float) $attributes['player_ratio'] ) { // 16:9 ( medium - 320x180, maxres - 1280x720 )
if ( isset( $video->thumbnails->medium ) ) {
$image_src = $video->thumbnails->medium->url;
}
}
// Player
$tag = 'div';
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
$tag = 'iframe';
}
printf(
'<%1$s class="ayg-player-iframe" width="100%%" height="100%%" src="%2$s/embed/%3$s" data-id="%3$s" data-image="%4%s" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>%1$s>',
$tag,
ayg_get_youtube_domain(),
esc_attr( $featured->id ),
esc_attr( $image_src )
);
?>
title ); ?>
description ) ) : ?>