C:\xampp\htdocs\landing\wp-content\plugins\Ultimate_VC_Addons\modules\ultimate_video_banner.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<?php
/*
* Add-on Name: Ultimate Video Banner
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('Ultimate_Video_Banner')) {
    class 
Ultimate_Video_Banner {
        function 
__construct() {
            if ( 
Ultimate_VC_Addons::$uavc_editor_enable ) {
                
add_action('init',array($this,'ultimate_video_banner_init'));
            }
            
add_shortcode('ultimate_video_banner',array($this,'ultimate_video_banner_shortcode'));
            
add_action("wp_enqueue_scripts", array($this"register_video_banner_assets"),1);
        }

        function 
register_video_banner_assets() {
            
            
Ultimate_VC_Addons::ultimate_register_style'ultimate-video-banner-style''video-banner' );

            
Ultimate_VC_Addons::ultimate_register_script'ultimate-video-banner-script''video-banner'false, array( 'jquery' ), ULTIMATE_VERSIONfalse );
        }

        function 
ultimate_video_banner_init() {
            if(
function_exists('vc_map')) {
                
vc_map(
                    array(
                        
'name' => __('Video Banner','ultimate_vc'),
                        
'base' => 'ultimate_video_banner',
                        
'icon' => 'vc_ultimate_video_banner',
                        
'category' => 'Ultimate VC Addons',
                        
'description' => __('Show your video in ease.','ultimate_vc'),
                        
'deprecated' => '3.13.5',
                        
'params' => array(
                            array(
                                
'type' => 'textfield',
                                
'heading' => __('Link to the video in MP4 Format','ultimate_vc'),
                                
'param_name' => 'video_banner_mp4_link',
                            ),
                            array(
                                
'type' => 'textfield',
                                
'heading' => __('Link to the video in WebM / Ogg Format','ultimate_vc'),
                                
'param_name' => 'video_banner_webm_ogg_link',
                                
'description' => __('IE, Chrome & Safari','ultimate_vc').' <a href="http://www.w3schools.com/html/html5_video.asp" target="_blank" rel="noopener">'.__('support','ultimate_vc').'</a> '.__('MP4 format, while Firefox & Opera prefer WebM / Ogg formats.','ultimate_vc').' '.__('You can upload the video through','ultimate_vc').' <a href="'.home_url().'/wp-admin/media-new.php" target="_blank" rel="noopener">'.__('WordPress Media Library','ultimate_vc').'</a>.',
                            ),
                            array(
                                
'type' => 'ult_img_single',
                                
'heading' => __('Placeholder','ultimate_vc'),
                                
'param_name' => 'video_banner_placeholder',
                             ),
                            array(
                                
'type' => 'dropdown',
                                
'heading' => __('Effect','ultimate_vc'),
                                
'param_name' => 'video_banner_effect',
                                
'value' => array(
                                    
__('Style 1','ultimate_vc') => 'ult-vdo-effect-style1',
                                    
__('Style 2','ultimate_vc') => 'ult-vdo-effect-style2',
                                    
__('Style 3','ultimate_vc') => 'ult-vdo-effect-style3',
                                    
__('Style 4','ultimate_vc') => 'ult-vdo-effect-style4',
                                    
__('Style 5','ultimate_vc') => 'ult-vdo-effect-style5',
                                    
__('Style 6','ultimate_vc') => 'ult-vdo-effect-style6',
                                    
__('Style 7','ultimate_vc') => 'ult-vdo-effect-style7',
                                    
//__('Style 8','ultimate_vc') => 'ult-vdo-effect-style10',
                                    //__('Style 9','ultimate_vc') => 'ult-vdo-effect-style10',
                                    //__('Style 10','ultimate_vc') => 'ult-vdo-effect-style10'
                                
)
                            ),
                            array(
                                
'type' => 'textfield',
                                
'heading' => __('Title','ultimate_vc'),
                                
'param_name' => 'video_banner_title',
                                
'group' => 'Content'
                            
),
                            array(
                                
'type' => 'textarea',
                                
'heading' => __('Content','ultimate_vc'),
                                
'param_name' => 'video_banner_content',
                                
'group' => 'Content'
                            
),
                            array(
                                
"type" => "ult_param_heading",
                                
"text" => __("Title Settings","ultimate_vc"),
                                
"param_name" => "title_typograpy",
                                
"group" => "Typography",
                                
"class" => "ult-param-heading",
                                
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
                            ),
                            array(
                                
"type" => "ultimate_google_fonts",
                                
"heading" => __("Font Family""ultimate_vc"),
                                
"param_name" => "title_font_family",
                                
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "ultimate_google_fonts_style",
                                
"heading"         =>    __("Font Style""ultimate_vc"),
                                
"param_name"    =>    "title_font_style",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "number",
                                
"class" => "font-size",
                                
"heading" => __("Font Size""ultimate_vc"),
                                
"param_name" => "title_font_size",
                                
"min" => 10,
                                
"suffix" => "px",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "colorpicker",
                                
"class" => "",
                                
"heading" => __("Font Color""ultimate_vc"),
                                
"param_name" => "title_color",
                                
"value" => "",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "number",
                                
"class" => "",
                                
"heading" => __("Line Height""ultimate_vc"),
                                
"param_name" => "title_line_height",
                                
"value" => "",
                                
"suffix" => "px",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "ult_param_heading",
                                
"text" => __("Desciption Settings","ultimate_vc"),
                                
"param_name" => "desc_typograpy",
                                
"group" => "Typography",
                                
"class" => "ult-param-heading",
                                
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
                            ),
                            array(
                                
"type" => "ultimate_google_fonts",
                                
"heading" => __("Font Family""ultimate_vc"),
                                
"param_name" => "desc_font_family",
                                
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "ultimate_google_fonts_style",
                                
"heading"         =>    __("Font Style""ultimate_vc"),
                                
"param_name"    =>    "desc_font_style",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "number",
                                
"class" => "font-size",
                                
"heading" => __("Font Size""ultimate_vc"),
                                
"param_name" => "desc_font_size",
                                
"min" => 10,
                                
"suffix" => "px",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "colorpicker",
                                
"class" => "",
                                
"heading" => __("Font Color""ultimate_vc"),
                                
"param_name" => "desc_color",
                                
"value" => "",
                                
"group" => "Typography"
                            
),
                            array(
                                
"type" => "number",
                                
"class" => "",
                                
"heading" => __("Line Height""ultimate_vc"),
                                
"param_name" => "desc_line_height",
                                
"value" => "",
                                
"suffix" => "px",
                                
"group" => "Typography"
                            
),
                            array(
                                
'type' => 'ultimate_responsive',
                                
'heading' => __('Banner Size','ultimate_vc'),
                                
'param_name' => 'video_banner_size',
                                
'unit' => 'px',
                                
'media' => array(
                                    
'Desktop'           => '',
                                        
'Tablet'            => '',
                                        
'Tablet Portrait'   => '',
                                        
'Mobile Landscape'  => '',
                                        
'Mobile'            => '',
                                ),
                                
'group' => 'Design'
                            
),
                            array(
                                
'type' => 'colorpicker',
                                
'heading' => __('Overlay Color','ultimate_vc'),
                                
'param_name' => 'video_banner_overlay_color',
                                
'group' => 'Design'
                            
),
                            array(
                                
'type' => 'colorpicker',
                                
'heading' => __('Overlay Hover Color','ultimate_vc'),
                                
'param_name' => 'video_banner_overlay_hover_color',
                                
'group' => 'Design'
                            
),
                            array(
                                
'type' => 'css_editor',
                                
'heading' => __('CSS','ultimate_vc'),
                                
'param_name' => 'video_banner_vc_css',
                                
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border video_banner_css_editor',
                                
'group' => 'Design'
                            
),
                            array(
                                
'type' => 'number',
                                
'heading' => __('Start Time','ultimate_vc'),
                                
'param_name' => 'video_banner_start_time',
                                
'suffix' => 'in seconds',
                                
'group' => 'Advanced Settings'
                            
),
                            array(
                                
'type' => 'checkbox',
                                
'heading' => __('Mute','ultimate_vc'),
                                
'param_name' => 'video_banner_mute',
                                
'value' => array(
                                    
__('Enable','ultimate_vc') => 'muted'
                                
),
                                
'group' => 'Advanced Settings'
                            
)
                        )
                    )
                );
            }
        }

        function 
ultimate_video_banner_shortcode($atts$content null) {
            
extract(
                
shortcode_atts(
                    array(
                        
'video_banner_mp4_link' => '',
                        
'video_banner_webm_ogg_link' => '',
                        
'video_banner_effect' => 'ult-vdo-effect-style1',
                        
'video_banner_placeholder' => '',
                        
'video_banner_title' => '',
                        
'video_banner_content' => '',
                        
'title_font_family' => '',
                        
'title_font_style' => '',
                        
'title_font_size' => '',
                        
'title_color' => '',
                        
'title_line_height' => '',
                        
'desc_font_family' => '',
                        
'desc_font_style' => '',
                        
'desc_font_size' => '',
                        
'desc_color' => '',
                        
'desc_line_height' => '',
                        
'video_banner_size' => '',
                        
'video_banner_overlay_color' => '',
                        
'video_banner_overlay_hover_color' => '',
                        
'video_banner_vc_css' => '',
                        
'video_banner_start_time' => '0',
                        
'video_banner_mute' => '',
                    ),
$atts
                
)
            );
            
$output $placeholder $placeholder_css $vc_css_class '';

            
$vc_css_class apply_filtersVC_SHORTCODE_CUSTOM_CSS_FILTER_TAGvc_shortcode_custom_css_class$video_banner_vc_css' ' ), 'ultimate_video_banner'$atts );

            
$video_id 'ult-video-banner-'.uniqid(rand());

            
$args = array(
                  
'target'        =>    '#'.$video_id,
                  
'media_sizes'     => array(
                    
'width'     => $video_banner_size,
                ),
              );
            
$banner_height_responsive_data get_ultimate_vc_responsive_media_css($args);

            if(
preg_match('/^#[a-f0-9]{6}$/i'$video_banner_overlay_color)) //hex color is valid
            
{
                
$video_banner_overlay_color hex2rgbUltParallax($video_banner_overlay_color$opacity 0.8);
            }
            if(
preg_match('/^#[a-f0-9]{6}$/i'$video_banner_overlay_hover_color)) //hex color is valid
            
{
                
$video_banner_overlay_hover_color hex2rgbUltParallax($video_banner_overlay_hover_color$opacity 0.4);
            }

            
/* ---- main heading styles ---- */
            
$title_style_inline '';
            if(
$title_font_family != '')
            {
                
$title_font_family get_ultimate_font_family($title_font_family);
                if(
$title_font_family)
                    
$title_style_inline .= 'font-family:\''.$title_font_family.'\';';
            }
            
// main heading font style
            
$title_style_inline .= get_ultimate_font_style($title_font_style);
            
//attach font size if set
            
if($title_font_size != '')
                
$title_style_inline .= 'font-size:'.$title_font_size.'px;';
            
//attach font color if set
            
if($title_color != '')
                
$title_style_inline .= 'color:'.$title_color.';';
            
//line height
            
if($title_line_height != '')
                
$title_style_inline .= 'line-height:'.$title_line_height.'px;';

            
/* ---- description styles ---- */
            
$desc_style_inline '';
            if(
$desc_font_family != '')
            {
                
$desc_font_family get_ultimate_font_family($desc_font_family);
                if(
$desc_font_family)
                    
$desc_style_inline .= 'font-family:\''.$desc_font_family.'\';';
            }
            
// desc font style
            
$desc_style_inline .= get_ultimate_font_style($desc_font_style);
            
//attach font size if set
            
if($desc_font_size != '')
                
$desc_style_inline .= 'font-size:'.$desc_font_size.'px;';
            
//attach font color if set
            
if($desc_color != '')
                
$desc_style_inline .= 'color:'.$desc_color.';';
            
//line height
            
if($desc_line_height != '')
                
$desc_style_inline .= 'line-height:'.$desc_line_height.'px;';

            if(
$video_banner_placeholder != '')

            {
                
$img_info apply_filters('ult_get_img_single'$video_banner_placeholder'url''full');

                
$placeholder $img_info;
                
$placeholder_css 'background-image:url('.esc_url$placeholder ).');';
            }

            
$output '<div id="'.esc_attr($video_id).'" class="'.esc_attr($vc_css_class).' ult-video-banner ult-vdo-effect '.esc_attr($video_banner_effect).' utl-video-banner-item ult-responsive" '.$banner_height_responsive_data.' data-current-time="'.esc_attr($video_banner_start_time).'" data-placeholder="'.esc_attr($placeholder).'" style="'.esc_attr($placeholder_css).'">';
                if(
$video_banner_mp4_link != '' || $video_banner_webm_ogg_link != '') :
                    
$output .= '<video autoplay loop '.$video_banner_mute.' poster="'.esc_attr($placeholder).'">';
                        if(
$video_banner_mp4_link != '')
                            
$output .= '<source src="'.esc_attr($video_banner_mp4_link).'" type="video/mp4">';
                        if(
$video_banner_webm_ogg_link != '') :
                            
$ext pathinfo($video_banner_webm_ogg_link);
                            if(
$ext['extension'] == 'webm')
                                
$type 'webm';
                            else
                                
$type 'ogg';
                            
$output .= '<source src="'.esc_url($video_banner_webm_ogg_link).'" type="video/'.esc_attr($type).'">';
                        endif;
                        
$output.= __('Your browser does not support the video tag.','ultimate_vc');
                    
$output .= '</video>';
                endif;
                if(
$video_banner_title != '' || $content != '') :
                    
$output .= '<div class="ult-video-banner-desc">';
                        if(
$video_banner_title != '') :
                            
$output .= '<h2 class="ult-video-banner-title" style="'.esc_attr($title_style_inline).'">'.__($video_banner_title'ultimate_vc').'</h2>';
                        endif;
                        if(
$video_banner_content != '') :
                            
$output .= '<div class="ult-video-banner-content" style="'.esc_attr($desc_style_inline).'">'.__($video_banner_content'ultimate_vc').'</div>';
                        endif;
                    
$output .= '</div>';
                endif;
                
$output .= '<div class="ult-video-banner-overlay" data-overlay="'.esc_attr($video_banner_overlay_color).'" data-overlay-hover="'.esc_attr($video_banner_overlay_hover_color).'"></div>';
            
$output .= '</div>';
            return 
$output;
        }
    }
}
$Ultimate_Video_Banner = new Ultimate_Video_Banner;
if ( 
class_exists'WPBakeryShortCode' ) && !class_exists'WPBakeryShortCode_ultimate_video_banner' ) ) {
    class 
WPBakeryShortCode_ultimate_video_banner extends WPBakeryShortCode {
    }
}
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586