get_video_id($setting) );
$url .= ( empty( $params ) ) ? '?' : '&';
$url .= 'autoplay=1';
if ( 'vimeo_video' == $setting['video_type'] && '' != $setting['vimeo_start_time'] ) {
$time = date( 'H\hi\ms\s', $setting['vimeo_start_time'] );
$url .= '#t=' . $time;
}
return $url;
}
/**
* Returns Video Thumbnail Image.
*
*
*/
public function get_video_thumb( $setting ) {
$id = $this->get_video_id($setting);
if ( '' == $this->get_video_id($setting) ) {
return '';
}
if ( 'custom' == $setting['thumbnail'] ) {
$thumb = $setting['custom_thumb'];
if($thumb !== ''){
$img = apply_filters('ult_get_img_single', $thumb, 'url');
$img_info = esc_url(apply_filters( 'ultimate_images', $img ));
return $img_info;
}
}
else {
if ( 'uv_iframe' == $setting['video_type'] ) {
$thumb = 'https://i.ytimg.com/vi/' . $id . '/' . apply_filters( 'ultv_video_youtube_image_quality', $setting['default_thumb'] ) . '.jpg';
} else {
$vimeo = unserialize( file_get_contents( "https://vimeo.com/api/v2/video/$id.php" ) );
$thumb = str_replace( '_640', '_840', $vimeo[0]['thumbnail_large'] );
}
}
return $thumb;
}
/**
* Get embed params.
*
* Retrieve video widget embed parameters.
*/
public function get_embed_params($setting) {
$params = array();
if ( 'uv_iframe' === $setting['video_type'] ) {
$youtube_options = array( 'autoplay', 'rel', 'controls', 'mute', 'modestbranding' );
foreach ( $youtube_options as $option ) {
if ( 'autoplay' == $option ) {
if ( 'on' === $setting['yt_autoplay'] ) {
$params[ $option ] = '1';
}
continue;
}
if ( 'rel' == $option ) {
$value = ( 'on' === $setting['yt_sugg_video'] ) ? '1' : '0';
$params[ $option ] = $value;
}
if ( 'controls' == $option ) {
$value = ( 'on' === $setting['yt_play_control'] ) ? '1' : '0';
$params[ $option ] = $value;
}
if ( 'mute' == $option ) {
$value = ( 'on' === $setting['yt_mute_control'] ) ? '1' : '0';
$params[ $option ] = $value;
}
if ( 'modestbranding' == $option ) {
$value = ( 'on' === $setting['yt_modest_branding'] ) ? '1' : '0';
$params[ $option ] = $value;
}
$params['start'] = $setting['yt_start_time'];
$params['end'] = $setting['yt_stop_time'];
}
}
if ( 'vimeo_video' === $setting['video_type'] ) {
$vimeo_options = array( 'autoplay', 'loop', 'title', 'portrait', 'byline' );
foreach ( $vimeo_options as $option ) {
if ( 'autoplay' == $option ) {
if ( 'on' === $setting['vimeo_autoplay'] ) {
$params[ $option ] = '1';
}
continue;
}
if ( 'loop' === $option ) {
$value = ( 'on' === $setting['vimeo_loop'] ) ? '1' : '0';
$params[ $option ] = $value;
}
if ( 'title' === $option ) {
$value = ( 'on' === $setting['vimeo_intro_title'] ) ? '1' : '0';
$params[ $option ] = $value;
}
if ( 'portrait' === $option ) {
$value = ( 'on' === $setting['vimeo_intro_portrait'] ) ? '1' : '0';
$params[ $option ] = $value;
}
if ( 'byline' === $option ) {
$value = ( 'on' === $setting['vimeo_intro_byline'] ) ? '1' : '0';
$params[ $option ] = $value;
}
}
$params['color'] = str_replace( '#', '', $setting['vimeo_control_color'] );
$params['autopause'] = '0';
}
return $params;
}
/**
* Returns Vimeo Headers.
*
*
*/
public function get_header_wrap( $setting ) {
if ( 'vimeo_video' != $setting['video_type'] ) {
return;
}
$id = $this->get_video_id( $setting );
$html = "";
if ( isset( $id ) && '' != $id ) {
$vimeo = unserialize( file_get_contents( "https://vimeo.com/api/v2/video/$id.php" ) );
if ( 'on' == $setting['vimeo_intro_portrait'] ||
'on' == $setting['vimeo_intro_title'] ||
'on' == $setting['vimeo_intro_byline']
) {
$html = '
';
if ( 'on' == $setting['vimeo_intro_portrait'] ) {
$html .= '
';
}
if ( 'on' == $setting['vimeo_intro_title'] ||
'on' == $setting['vimeo_intro_byline']
) {
$html .= '';
}
$html .='
';
}
}
return $html;
}
/**
* Render the video
*
*/
public function get_video_embed( $setting, $uid ) {
$id = $this->get_video_id( $setting );
$embed_param = $this->get_embed_params( $setting );
$src = $this->get_url( $setting, $embed_param );
$main_video_style_inline = $main_video_responsive = $html = $style = $hover_color = "";
$device = ( false !== ( stripos( $_SERVER['HTTP_USER_AGENT'], 'iPhone' ) ) ? 'true' : 'false' );
if ( 'uv_iframe' == $setting['video_type'] ) {
$autoplay = ( 'on' == $setting['yt_autoplay'] ) ? '1' : '0';
} else {
$autoplay = ( 'on' == $setting['vimeo_autoplay'] ) ? '1' : '0';
}
if ( 'defaulticon' == $setting['play_source'] ){
$setting['play_size'] = 'width:'.$setting['play_size'].'px';
if( 'uv_iframe' === $setting['video_type'] ){
$html = '';
}
if('vimeo_video' === $setting['video_type'] ){
$html = '';
}
}
else if ( 'icon' == $setting['play_source'] ) {
$setting['play_size'] = 'font-size:'.$setting['play_size'].'px;';
} else {
$thumb = $setting['play_image'];
$imag = apply_filters('ult_get_img_single', $thumb, 'url');
$html = esc_url(apply_filters( 'ultimate_images', $imag ));
}
if( 'image' == $setting['play_source'] )
{
$setting['play_size'] = 'width:'.$setting['play_size'].'px';
}
/* padding */
if( $setting['padding'] != '' ){
$style = $setting['padding'];
}
/* ---- main heading styles ---- */
if($setting['main_video_font_family'] != '')
{
$mvfont_family = get_ultimate_font_family($setting['main_video_font_family']);
if($mvfont_family)
$main_video_style_inline .= 'font-family:\''.$mvfont_family.'\';';
}
// main video font style
$main_video_style_inline .= get_ultimate_font_style($setting['main_video_style']);
// FIX: set old font size before implementing responsive param
if(is_numeric($setting['main_video_font_size'])) { $setting['main_video_font_size'] = 'desktop:'.$setting['main_video_font_size'].'px;'; }
if(is_numeric($setting['main_video_line_height'])) { $setting['main_video_line_height'] = 'desktop:'.$setting['main_video_line_height'].'px;'; }
// responsive {main} video styles
$args = array(
'target' => '.ult-video.'.$uid. ' .ultv-subscribe-bar',
'media_sizes' => array(
'font-size' => $setting['main_video_font_size'],
'line-height' => $setting['main_video_line_height'],
),
);
$main_video_responsive = get_ultimate_vc_responsive_media_css($args);
if($setting['icon_hover_color'] != ''){
$hover_color = 'data-hoverbg='.esc_attr($setting['icon_hover_color']).' ';}
if($setting['default_hover_color'] != ''){
$hover_color .= 'data-defaulthoverbg='.esc_attr($setting['default_hover_color']).' ';}
$output = '
';
$output .= $this->get_header_wrap( $setting );
$output .= '
';
if('image' == $setting['play_source'] ){
$output .= '
.')
';
}
if ( 'defaulticon' == $setting['play_source'] ){
$output .= $html;
}
$output .='
';
if ( 'uv_iframe' == $setting['video_type'] && 'on' == $setting['enable_sub_bar'] ) {
$channel_name = ( '' != $setting['yt_channel_name'] ) ? $setting['yt_channel_name'] : '';
$channel_id = ( '' != $setting['yt_channel_id'] ) ? $setting['yt_channel_id'] : '';
$youtube_text = ( '' != $setting['yt_channel_text'] ) ? $setting['yt_channel_text'] : '';
$subscriber_count = ( 'on' == $setting['show_sub_count'] ) ? 'default' : 'hidden';
if( '' != $setting['yt_text_color'])
{
$yt_txt = 'color:'.$setting['yt_text_color'].';';
}
if( '' != $setting['yt_background_color'])
{
$yt_txt_back = 'background-color:'.$setting['yt_background_color'].';';
}
$output .= '
'.esc_attr($youtube_text).'
';
if( 'channel_name' == $setting['chanel_id_name'] ) {
$output .= '
';
} else if( 'channel_id' == $setting['chanel_id_name'] ) {
$output .= '
';
}
$output .= '
';
}
$output .= '
';
return $output;
}
//Init function for video module
function ultimate_videos_module_init(){
if(function_exists("vc_map")){
vc_map(
array(
"name" => __("Video","ultimate_vc"),
"base" => "ultimate_video",
"class" => "vc_ultimate_video",
"icon" => "vc_ultimate_video",
"category" => "Ultimate VC Addons",
"description" => __("Embed video without sacrificing Page speed.","ultimate_vc"),
"params" => array(
array(
"type" => "ult_param_heading",
"text" => __("Video","ultimate_vc"),
"param_name" => "video_setting",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "dropdown",
"class" => "",
"admin_label" => true,
"heading" => __("Video Type", "ultimate_vc"),
"param_name" => "video_type",
"value" =>
array(
__("YouTube Video","ultimate_vc") => "uv_iframe",
__("Vimeo Video","ultimate_vc") => "vimeo_video",
),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Enter YouTube URL of the Video", "ultimate_vc"),
"param_name" => "u_video_url",
"value" => "https://www.youtube.com/watch?v=HJRzUQMhJMQ",
"description" => __("Make sure you add the actual URL of the video and not the share URL.
Valid : https://www.youtube.com/watch?v=HJRzUQMhJMQ
Invalid : https://youtu.be/HJRzUQMhJMQ ", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Start Time", "ultimate_vc"),
"admin_label" => true,
"param_name" => "yt_start_time",
"value" => "",
"suffix" => "seconds",
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Stop Time", "ultimate_vc"),
"admin_label" => true,
"param_name" => "yt_stop_time",
"value" => "",
"suffix" => "seconds",
"description" => __("You may start / stop the video at any point you would like.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Enter Vimeo URL of the Video", "ultimate_vc"),
"param_name" => "vimeo_video_url",
"value" => "https://vimeo.com/274860274",
"description" => __("Make sure you add the actual URL of the video and not the share URL.
Valid : https://vimeo.com/274860274
Invalid : https://vimeo.com/channels/staffpicks/274860274 ", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("vimeo_video")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Start Time", "ultimate_vc"),
"admin_label" => true,
"param_name" => "vimeo_start_time",
"value" => "",
"suffix" => "seconds",
"dependency" => Array("element" => "video_type","value" => array("vimeo_video")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Aspect Ratio", "ultimate_vc"),
"admin_label" => true,
"param_name" => "aspect_ratio",
"value" =>
array(
__("16:9","ultimate_vc") => "16_9",
__("4:3","ultimate_vc") => "4_3",
__("3:2","ultimate_vc") => "3_2",
),
),
array(
"type" => "ult_param_heading",
"text" => __("Video Option","ultimate_vc"),
"param_name" => "video_option",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Autoplay", "ultimate_vc"),
"param_name" => "yt_autoplay",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
)
),
"description" => __("If autoplay mode is enabled then thumbnail option will never show.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Suggested Video", "ultimate_vc"),
"param_name" => "yt_sugg_video",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Show","ultimate_vc"),
"off" => __("Hide","ultimate_vc"),
)
),
"description" => __("If set to hide - the player will display related videos from the same channel as the video that was just played.
If set to show - the player will display the related videos from the random channels.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Player Control", "ultimate_vc"),
"param_name" => "yt_play_control",
"value" => "on",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Show","ultimate_vc"),
"off" => __("Hide","ultimate_vc"),
)
),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Mute", "ultimate_vc"),
"param_name" => "yt_mute_control",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
)
),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Modest Branding", "ultimate_vc"),
"param_name" => "yt_modest_branding",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
)
),
"description" => __("This option lets you use a YouTube player that does not show a YouTube logo.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Privacy Mode", "ultimate_vc"),
"param_name" => "yt_privacy_mode",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
)
),
"description" => __("When you turn on privacy mode, YouTube won't store information about visitors on your website unless they play the video.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Autoplay", "ultimate_vc"),
"param_name" => "vimeo_autoplay",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
)
),
"description" => __("If autoplay mode is enabled then thumbnail option will never show.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("vimeo_video")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Loop", "ultimate_vc"),
"param_name" => "vimeo_loop",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
)
),
"description" => __("Play the video again when it reaches the end, infinitely.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("vimeo_video")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Intro Title", "ultimate_vc"),
"param_name" => "vimeo_intro_title",
"value" => "on",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Show","ultimate_vc"),
"off" => __("Hide","ultimate_vc"),
)
),
"description" => __("Show the video’s title.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("vimeo_video")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Intro Portrait", "ultimate_vc"),
"param_name" => "vimeo_intro_portrait",
"value" => "on",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Show","ultimate_vc"),
"off" => __("Hide","ultimate_vc"),
)
),
"description" => __("Show the author’s profile image (portrait).", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("vimeo_video")),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Intro Byline", "ultimate_vc"),
"param_name" => "vimeo_intro_byline",
"value" => "on",
"options" => array(
"on" => array(
"label" => "",
"on" => __("Show","ultimate_vc"),
"off" => __("Hide","ultimate_vc"),
)
),
"description" => __("Show the author of the video.", "ultimate_vc"),
"dependency" => Array("element" => "video_type","value" => array("vimeo_video")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Controls Color", "ultimate_vc"),
"param_name" => "vimeo_control_color",
"dependency" => Array("element" => "video_type","value" => array("vimeo_video")),
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"param_name" => "el_class",
"description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "ultimate_vc")
),
array(
"type" => "ult_param_heading",
"text" => __("Thumbnail & Overlay ","ultimate_vc"),
"param_name" => "thum_over",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
"group" => "Thumbnail",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Thumbnail", "ultimate_vc"),
"param_name" => "thumbnail",
"value" =>
array(
__("Default Thumbnail","ultimate_vc") => "default",
__("Custom Thumbnail","ultimate_vc") => "custom",
),
"group" => "Thumbnail",
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Select Custom Thumbnail", "ultimate_vc"),
"param_name" => "custom_thumb",
"value" => "",
"dependency" => Array("element" => "thumbnail","value" => array("custom")),
"group" => "Thumbnail",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Default Thumbnail Size", "ultimate_vc"),
"param_name" => "default_thumb",
"value" =>
array(
__("Maximum Resolution","ultimate_vc") => "maxresdefault",
__("High Quality","ultimate_vc") => "hqdefault",
__("Medium Quality","ultimate_vc") => "mqdefault",
__("Standard Quality","ultimate_vc") => "sddefault",
),
"dependency" => Array("element" => "thumbnail","value" => array("default")),
"group" => "Thumbnail",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Overlay Color", "ultimate_vc"),
"param_name" => "overlay_color",
"group" => "Thumbnail",
),
array(
"type" => "ult_param_heading",
"text" => __("Play Button ","ultimate_vc"),
"param_name" => "playb",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
"group" => "Thumbnail",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Image/Icon", "ultimate_vc"),
"param_name" => "play_source",
"value" =>
array(
__("Default","ultimate_vc") => "defaulticon",
__("Image","ultimate_vc") => "image",
__("Icon","ultimate_vc") => "icon",
),
"group" => "Thumbnail",
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Select Image", "ultimate_vc"),
"param_name" => "play_image",
"value" => "",
"dependency" => Array("element" => "play_source","value" => array("image")),
"group" => "Thumbnail",
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "play_icon",
"value" => "",
"dependency" => Array("element" => "play_source","value" => array("icon")),
// "description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose, you can","ultimate_vc")." ".__('add new here','ultimate_vc').".",
"group" => "Thumbnail",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size", "ultimate_vc"),
"param_name" => "play_size",
"value" => 75,
"min" => 12,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"group" => "Thumbnail",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"value" => "3A3A3A",
"param_name" => "icon_color",
"dependency" => Array("element" => "play_source","value" => array("icon")),
"group" => "Thumbnail",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Hover Color", "ultimate_vc"),
"param_name" => "icon_hover_color",
"dependency" => Array("element" => "play_source","value" => array("icon")),
"group" => "Thumbnail",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"value" => "#1f1f1e",
"param_name" => "default_color",
"dependency" => Array("element" => "play_source","value" => array("defaulticon")),
"group" => "Thumbnail",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Hover Color", "ultimate_vc"),
"param_name" => "default_hover_color",
"dependency" => Array("element" => "play_source","value" => array("defaulticon")),
"group" => "Thumbnail",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Hover Animation", "ultimate_vc"),
"param_name" => "hover_animation",
"value" =>
array(
__("None","ultimate_vc") => "none",
__("Float","ultimate_vc") => "float",
__("Sink","ultimate_vc") => "sink",
__("Wobble Vertical","ultimate_vc") => "wobble-vertical",
),
"group" => "Thumbnail",
),
array(
"type" => "ult_param_heading",
"text" => __("Youtube Subscribe Bar","ultimate_vc"),
"param_name" => "yt_sb_bar",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Enable Subscribe Bar", "ultimate_vc"),
"param_name" => "enable_sub_bar",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"off" => __("No","ultimate_vc"),
"on" => __("Yes","ultimate_vc"),
)
),
"dependency" => Array("element" => "video_type","value" => array("uv_iframe")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Select Channel ID/Channel Name", "ultimate_vc"),
"param_name" => "chanel_id_name",
"value" =>
array(
__("Channel Name","ultimate_vc") => "channel_name",
__("Channel ID","ultimate_vc") => "channel_id",
),
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("YouTube Channel Name", "ultimate_vc"),
"param_name" => "yt_channel_name",
"value" => "TheBrainstormForce",
"description" => __("Click")." ".__("here","ultimate_vc")."".__(" to find your YouTube Channel Name.","ultimate_vc"),
"dependency" => Array("element" => "chanel_id_name","value" => array("channel_name")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("YouTube Channel ID", "ultimate_vc"),
"param_name" => "yt_channel_id",
"value" => "UCtFCcrvupjyaq2lax_7OQQg",
"description" => __("Click")." ".__("here","ultimate_vc")."".__(" to find your YouTube Channel ID.","ultimate_vc"),
"dependency" => Array("element" => "chanel_id_name","value" => array("channel_id")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Subscribe to Channel Text", "ultimate_vc"),
"param_name" => "yt_channel_text",
"value" => "Subscribe to our YouTube Channel",
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "ult_param_heading",
"text" => __("Settings","ultimate_vc"),
"param_name" => "yt_sb_setting",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Show Subscribe count", "ultimate_vc"),
"param_name" => "show_sub_count",
"value" => "off",
"options" => array(
"on" => array(
"label" => "",
"off" => __("No","ultimate_vc"),
"on" => __("Yes","ultimate_vc"),
)
),
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Text Color", "ultimate_vc"),
"param_name" => "yt_text_color",
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "yt_background_color",
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "main_video_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." ".__("add new in the collection here","ultimate_vc").".",
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "main_video_style",
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "main_video_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "main_video_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "ultimate_spacing",
"heading" => __("Padding", "ultimate_vc"),
"param_name" => "padding",
"mode" => "padding",
"unit" => "px",
"positions" => array(
__("Top","ultimate_vc") => "",
__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
__("Left","ultimate_vc") => ""
),
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Stack on", "ultimate_vc"),
"param_name" => "subscribe_bar_responsive",
"value" =>
array(
__("None","ultimate_vc") => "none",
__("Desktop","ultimate_vc") => "desktop",
__("Tablet","ultimate_vc") => "tablet",
__("Mobile","ultimate_vc") => "mobile",
),
"dependency" => Array("element" => "enable_sub_bar","value" => array("on")),
"group" => "Youtube Subscribe Bar",
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_video_design',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)
)
);
}
}//end-of-init-function
function ultimate_videos_module_shortcode($atts, $content = null){
$u_video_url = $video_type = $vimeo_video_url = $thumbnail = $custom_thumb =$default_thumb = $yt_autoplay = $yt_sugg_video = $yt_play_control = $yt_mute_control = $yt_modest_branding = $yt_privacy_mode = $yt_start_time = $yt_stop_time = $vimeo_autoplay = $vimeo_loop = $vimeo_intro_title = $vimeo_intro_portrait = $vimeo_intro_byline = $vimeo_start_time =$aspect_ratio = $output = $play_icon = $html = $play_source = $play_size = $hover_animation = $vimeo_control_color = $overlay_color = $icon_color = $icon_hover_color = $default_color = $default_hover_color = $chanel_id_name = $yt_channel_name = $yt_channel_id = $yt_channel_text = $show_sub_count = $enable_sub_bar = $yt_text_color = $yt_background_color = $el_class = $subscribe_bar_responsive = $thumb = $video_design_style_css = "";
extract($setting = (shortcode_atts(array(
"u_video_url" => "https://www.youtube.com/watch?v=HJRzUQMhJMQ",
"video_type" => "uv_iframe",
"vimeo_video_url" => "https://vimeo.com/274860274",
"thumbnail" => "",
"custom_thumb" => "",
"default_thumb" => "maxresdefault",
"yt_autoplay" => "",
"yt_sugg_video" => "",
"yt_play_control" => "on",
"yt_mute_control" => "",
"yt_modest_branding" => "",
"yt_privacy_mode" => "",
"yt_start_time" => "",
"yt_stop_time" => "",
"vimeo_autoplay" => "",
"vimeo_loop" => "",
"vimeo_intro_title" => "on",
"vimeo_intro_portrait" => "on",
"vimeo_intro_byline" => "on",
"vimeo_start_time" => "",
"play_source" => "defaulticon",
"aspect_ratio" => "16_9",
"play_icon" => "",
"hover_animation" => "none",
"play_image" => "",
"play_size" => "75",
"vimeo_control_color" => "",
"overlay_color" => "",
"icon_color" => "#3A3A3A",
"icon_hover_color" => "",
"default_color" => "#1f1f1e",
"default_hover_color" => "",
"enable_sub_bar" => "off",
"chanel_id_name" => "channel_name",
"yt_channel_name" => "TheBrainstormForce",
"yt_channel_id" => "UCtFCcrvupjyaq2lax_7OQQg",
"yt_channel_text" => "Subscribe to our YouTube Channel",
"show_sub_count" => "",
"yt_text_color" => "#fff",
"yt_background_color" => "#1b1b1b",
"main_video_font_family" => "",
"main_video_style" => "",
"main_video_font_size" => "",
"main_video_line_height" => "",
"el_class" => "",
"padding" => "",
"subscribe_bar_responsive" => "none",
"css_video_design" => "",
),$atts)));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
if ( '' == $u_video_url && 'uv_iframe' == $video_type ) {
return '';
}
if ( '' == $vimeo_video_url && 'vimeo_video' == $video_type ) {
return '';
}
$video_design_style_css = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_video_design, ' ' ), "ultimate_videos", $atts );
$video_design_style_css = esc_attr( $video_design_style_css );
$micro = rand(0000,9999);
$id = uniqid('ultimate-video-'.$micro);
$uid = 'ultv-'.rand(0000,9999);
$output = '';
$output .= $this->get_video_embed($setting , $uid);
$output .= '
';
return $output;
}//end-of-shortcode-function
}//End-class
new Ultimate_Videos;
if(class_exists('WPBakeryShortCode') && !class_exists('WPBakeryShortCode_ultimate_video'))
{
class WPBakeryShortCode_ultimate_video extends WPBakeryShortCode {
}
}
}