get_render_attribute_string( 'playlist_container' ) ); ?>>
$video ) {
if ( 'playlist' === $source ) {
$id = $video->snippet->resourceId->videoId;
} else {
if ( ! isset( $video->id->videoId ) ) {
continue;
}
$id = $video->id->videoId;
}
if ( 'playlist' === $source && 'public' !== $video->status->privacyStatus ) {
continue;
}
if ( $limit_counter === $limit ) {
break;
}
++$limit_counter;
$video_url = sprintf( 'https://www.youtube.com/watch?v=%s', $id );
$video_params = $this->get_video_params( $video_url );
$link = $video_params['link'];
$size = $settings['premium_video_box_yt_thumbnail_size'];
$thumbnails_url = sprintf( 'url(\'https://i.ytimg.com/vi/%s/%s.jpg\')', $id, $size );
$related = $settings['premium_video_box_suggested_videos'];
$mute = $settings['premium_video_box_mute'];
$loop = $settings['premium_video_box_loop'];
$playsinline = $settings['play_inline'];
$options = '&rel=';
$options .= 'yes' === $related ? '1' : '0';
$options .= '&mute=';
$options .= 'yes' === $mute ? '1' : '0';
$options .= '&loop=';
$options .= 'yes' === $loop ? '1' : '0';
$options .= '&playsinline=';
$options .= 'yes' === $playsinline ? '1' : '0';
if ( $settings['premium_video_box_start'] ) {
$options .= '&start=' . $settings['premium_video_box_start'];
}
if ( $settings['premium_video_box_end'] ) {
$options .= '&end=' . $settings['premium_video_box_end'];
}
if ( 'yes' === $settings['youtube_videos_title'] ) {
$video_title = $video->snippet->title;
$vid_title_tag = Helper_Functions::validate_html_tag( $settings['youtube_videos_title_tag'] );
}
$title_link = 'yes' === $settings['youtube_videos_title_link'] ? '
' : '';
$link_close = 'yes' === $settings['youtube_videos_title_link'] ? '' : '';
if ( 'yes' === $lightbox ) {
$lightbox_key = 'video_lightbox_' . $id;
$lightbox_options = array(
'privacy' => 'yes',
);
if ( 'elementor' === $settings['video_lightbox_style'] ) {
$this->add_render_attribute(
'video_container' . $id,
array(
'data-elementor-open-lightbox' => 'yes',
'data-elementor-lightbox' => wp_json_encode( $lightbox_options ),
'data-elementor-lightbox-video' => $link,
'data-elementor-lightbox-slideshow' => count( $playlist_videos ) > 1 ? $this->get_id() : false,
)
);
} else {
$rel = sprintf( 'prettyPhoto[premium-videobox-%s]', $this->get_id() );
$this->add_render_attribute(
'video_lightbox_container' . $id,
array(
'class' => 'premium-vid-lightbox-container',
'data-rel' => $rel,
'href' => $link . $options . '&autoplay=1&iframe=true',
)
);
}
} else {
$this->add_render_attribute(
'video_container' . $id,
array(
'data-src' => $link . $options,
)
);
}
$this->add_render_attribute(
'video_container' . $id,
array(
'class' => 'premium-video-box-video-container',
)
);
$this->add_render_attribute(
'container' . $id,
array(
'id' => 'premium-video-box-container-' . $id,
'class' => 'premium-video-box-container',
)
);
if ( 'yes' === $settings['privacy_mode'] ) {
$link = str_replace( '.com', '-nocookie.com', $link );
}
$this->add_render_attribute(
'image_container' . $id,
array(
'style' => 'background-image:' . $thumbnails_url,
'class' => array(
'premium-video-box-image-container',
$settings['premium_video_box_img_effect'],
),
)
);
$this->add_render_attribute( 'mask' . $id, 'class', 'premium-video-box-trigger' );
if ( 'yes' === $settings['mask_video_box_switcher'] ) {
$this->add_render_attribute( 'container' . $id, 'data-pa-mask', 'true' );
$this->add_render_attribute( 'mask' . $id, 'class', 'premium-video-box-mask-media' );
if ( 'blur' === $settings['premium_video_box_img_effect'] ) {
$this->add_render_attribute( 'image_container' . $id, 'class', 'premium-video-box-mask-media' );
}
if ( '' !== $settings['mask_shape_video_box']['url'] && 'yes' === $settings['video_box_shadow'] ) {
$this->add_render_attribute( 'container' . $id, 'class', 'premium-video-box-mask-filter' );
}
}
?>
get_render_attribute_string( 'container' . $id ) ); ?>>
get_render_attribute_string( 'mask' . $id ) ); ?>>
get_render_attribute_string( 'image_container' . $id ) ); ?> >
< class="premium-youtube-vid-title" > >