PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.1
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.1
4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1 2.3.1.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.4.0 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.2 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.6.0 3.6.1 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8.1 3.8.2 3.9.0 3.9.1 3.9.2 trunk 1.2.6 1.2.7 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.0.9.1 2.0.9.2 2.0.9.3
elementskit-lite / widgets / video / video.php
elementskit-lite / widgets / video Last commit date
parts 3 weeks ago video-handler.php 3 weeks ago video.php 3 weeks ago
video.php
2169 lines
1 <?php
2 namespace Elementor;
3
4 use Elementor\Modules\DynamicTags\Module as TagsModule;
5 use \Elementor\ElementsKit_Widget_Video_Handler as Handler;
6
7 if ( ! defined( 'ABSPATH' ) ) exit;
8
9 class ElementsKit_Widget_Video extends Widget_Base {
10 use \ElementsKit_Lite\Widgets\Widget_Notice;
11
12 public $base;
13 public function __construct( $data = [], $args = null ) {
14 parent::__construct( $data, $args );
15 $this->get_script_depends();
16 }
17
18 public function get_style_depends() {
19 return ['wp-mediaelement', 'magnific-popup', 'ekit-video'];
20 }
21
22 public function get_script_depends() {
23 return ['ekit-video', 'wp-mediaelement', 'magnific-popup'];
24 }
25
26 public function get_name() {
27 return Handler::get_name();
28 }
29
30 public function get_title() {
31 return Handler::get_title();
32 }
33
34 public function get_icon() {
35 return Handler::get_icon();
36 }
37
38 public function get_categories() {
39 return Handler::get_categories();
40 }
41
42 public function get_keywords() {
43 return Handler::get_keywords();
44 }
45 protected function is_dynamic_content(): bool {
46 return false;
47 }
48 public function get_help_url() {
49 return 'https://wpmet.com/doc/video/';
50 }
51
52 protected function register_controls() {
53
54 $this->start_controls_section(
55 'ekit_video_popup_content_section',
56 [
57 'label' => esc_html__( 'Video', 'elementskit-lite' ),
58 'tab' => Controls_Manager::TAB_CONTENT,
59 ]
60 );
61
62 $this->add_control(
63 'ekit_video_popup_video_type',
64 [
65 'label' => esc_html__( 'Video Type', 'elementskit-lite' ),
66 'type' => Controls_Manager::SELECT,
67 'default' => 'youtube',
68 'options' => [
69 'youtube'=> esc_html__( 'Youtube', 'elementskit-lite' ),
70 'vimeo'=> esc_html__( 'Vimeo', 'elementskit-lite' ),
71 'self'=> esc_html__( 'Self Hosted', 'elementskit-lite' ),
72 ]
73 ]
74 );
75
76 $this->add_control(
77 'ekit_video_popup_url',
78 [
79 'label' => esc_html__( 'Link', 'elementskit-lite' ),
80 'type' => Controls_Manager::TEXT,
81 'input_type' => 'url',
82 'placeholder' => esc_url( 'https://www.youtube.com/watch?v=VhBl3dHT5SY' ),
83 'default' => esc_url( 'https://www.youtube.com/watch?v=VhBl3dHT5SY' ),
84 'dynamic' => [
85 'active' => true,
86 ],
87 'condition' => [
88 'ekit_video_popup_video_type!' => 'self',
89 ],
90 ]
91 );
92
93 $this->add_control(
94 'ekit_video_self_url',
95 [
96 'label' => esc_html__('Custom URL', 'elementskit-lite'),
97 'type' => Controls_Manager::SWITCHER,
98 'default' => 'yes',
99 'label_on' => esc_html__('Yes', 'elementskit-lite'),
100 'label_off' => esc_html__('No', 'elementskit-lite'),
101 'condition' => [
102 'ekit_video_popup_video_type' => 'self',
103 ],
104 ]
105 );
106
107 $this->add_control(
108 'ekit_video_self_external_url',
109 [
110 'label' => esc_html__( 'URL', 'elementskit-lite' ),
111 'type' => Controls_Manager::TEXT,
112 'label_block' => true,
113 'placeholder' => esc_html__('Enter video URL', 'elementskit-lite'),
114 'description' => esc_html__('Input a valid video url', 'elementskit-lite'),
115 'dynamic' => [
116 'active' => true,
117 ],
118 'condition' => [
119 'ekit_video_self_url' => 'yes',
120 'ekit_video_popup_video_type' => 'self',
121 ],
122 ]
123 );
124
125 $this->add_control(
126 'ekit_video_player_self_hosted',
127 [
128 'label' => esc_html__( 'Choose Video', 'elementskit-lite' ),
129 'type' => Controls_Manager::MEDIA,
130 'dynamic' => [
131 'active' => true,
132 'categories' => [
133 TagsModule::MEDIA_CATEGORY,
134 ],
135 ],
136 'media_type' => 'video',
137 'condition' => [
138 'ekit_video_self_url!' => 'yes',
139 'ekit_video_popup_video_type' => 'self',
140 ],
141 ]
142 );
143
144 //video option
145 $this->add_control(
146 'ekit_video_popup_start_time',
147 [
148 'label' => esc_html__( 'Start Time (Sec)', 'elementskit-lite' ),
149 'type' => Controls_Manager::NUMBER,
150 'dynamic' => [
151 'active' => true,
152 ],
153 'input_type' => 'number',
154 'placeholder' => '',
155 'default' => '0',
156 'condition' => ['ekit_video_popup_video_type' => 'youtube' ]
157 ]
158 );
159
160 $this->add_control(
161 'ekit_video_popup_end_time',
162 [
163 'label' => esc_html__( 'End Time (Sec)', 'elementskit-lite' ),
164 'type' => Controls_Manager::NUMBER,
165 'dynamic' => [
166 'active' => true,
167 ],
168 'input_type' => 'number',
169 'placeholder' => '',
170 'default' => '',
171 'condition' => ['ekit_video_popup_video_type' => 'youtube']
172 ]
173 );
174
175 $this->add_control(
176 'content_tabs_after',
177 [
178 'type' => Controls_Manager::DIVIDER,
179 ]
180 );
181
182 //video style
183
184 $this->add_control(
185 'ekit_video_style',
186 [
187 'label' => esc_html__('Video Style', 'elementskit-lite'),
188 'type' => \Elementor\Controls_Manager::SELECT,
189 'options' => [
190 'inline' => esc_html__('Inline', 'elementskit-lite'),
191 'popup' => esc_html__('Popup', 'elementskit-lite'),
192 ],
193 'default' => 'popup',
194 ]
195 );
196
197 $this->add_control(
198 'ekit_video_inline_image_overlay_switcher',
199 [
200 'label' => esc_html__( 'Image Overlay', 'elementskit-lite' ),
201 'type' => Controls_Manager::SWITCHER,
202 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
203 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
204 'default' => 'no',
205 'condition' => [
206 'ekit_video_style' => 'inline',
207 ],
208 ]
209 );
210
211 $this->add_control(
212 'ekit_video_inline_overlay_image',
213 [
214 'label' => esc_html__( 'Overlay Image', 'elementskit-lite' ),
215 'type' => Controls_Manager::MEDIA,
216 'dynamic' => [
217 'active' => true,
218 ],
219 'separator' => 'before',
220 'condition' => [
221 'ekit_video_style' => 'inline',
222 'ekit_video_inline_image_overlay_switcher' => 'yes',
223 ],
224 ]
225 );
226
227 $this->add_control(
228 'ekit_video_popup_button_style',
229 [
230 'label' => esc_html__( 'Button Style', 'elementskit-lite' ),
231 'type' => Controls_Manager::SELECT,
232 'default' => 'icon',
233 'options' => [
234 'text' => esc_html__( 'Text', 'elementskit-lite' ),
235 'icon' => esc_html__( 'Icon', 'elementskit-lite' ),
236 'both' => esc_html__( 'Both', 'elementskit-lite' ),
237 ],
238 'conditions' => [
239 'relation' => 'or',
240 'terms' => [
241
242 // CASE 1: Popup button
243 [
244 'name' => 'ekit_video_style',
245 'operator' => '===',
246 'value' => 'popup',
247 ],
248
249 // CASE 2: Inline button
250 [
251 'relation' => 'and',
252 'terms' => [
253 [
254 'name' => 'ekit_video_style',
255 'operator' => '===',
256 'value' => 'inline',
257 ],
258 [
259 'name' => 'ekit_video_inline_image_overlay_switcher',
260 'operator' => '===',
261 'value' => 'yes',
262 ],
263 [
264 'name' => 'ekit_video_inline_overlay_image[url]',
265 'operator' => '!=',
266 'value' => '',
267 ]
268 ],
269 ],
270 ],
271 ],
272 ]
273 );
274
275 $this->add_control(
276 'ekit_video_popup_button_title',
277 [
278 'label' => esc_html__( 'Button Title', 'elementskit-lite' ),
279 'type' => Controls_Manager::TEXT,
280 'label_block' => true,
281 'placeholder' => esc_html__( 'Play', 'elementskit-lite' ),
282 'default' => esc_html__( 'Play', 'elementskit-lite' ),
283 'conditions' => [
284 'relation' => 'or',
285 'terms' => [
286 // CASE 1: Popup button (not inline)
287 [
288 'relation' => 'and',
289 'terms' => [
290 [
291 'name' => 'ekit_video_popup_button_style',
292 'operator' => 'in',
293 'value' => [ 'text', 'both' ],
294 ],
295 [
296 'name' => 'ekit_video_style',
297 'operator' => '!==',
298 'value' => 'inline',
299 ],
300 ],
301 ],
302
303 // CASE 2: Inline button
304 [
305 'relation' => 'and',
306 'terms' => [
307 [
308 'name' => 'ekit_video_popup_button_style',
309 'operator' => 'in',
310 'value' => [ 'text', 'both' ],
311 ],
312 [
313 'name' => 'ekit_video_inline_image_overlay_switcher',
314 'operator' => '===',
315 'value' => 'yes',
316 ],
317 [
318 'name' => 'ekit_video_style',
319 'operator' => '===',
320 'value' => 'inline',
321 ],
322 [
323 'name' => 'ekit_video_inline_overlay_image[url]',
324 'operator' => '!=',
325 'value' => '',
326 ],
327 ],
328 ],
329 ],
330 ],
331 'dynamic' => [
332 'active' => true,
333 ],
334 ]
335 );
336
337 $this->add_control(
338 'ekit_video_popup_button_icons',
339 [
340 'label' => esc_html__( 'Button Icon', 'elementskit-lite' ),
341 'type' => Controls_Manager::ICONS,
342 'fa4compatibility' => 'ekit_video_popup_button_icon',
343 'default' => [
344 'value' => 'icon icon-play',
345 'library' => 'ekiticons',
346 ],
347 'label_block' => true,
348 'conditions' => [
349 'relation' => 'or',
350 'terms' => [
351
352 // CASE 1: Popup icon
353 [
354 'relation' => 'and',
355 'terms' => [
356 [
357 'name' => 'ekit_video_popup_button_style',
358 'operator' => 'in',
359 'value' => [ 'icon', 'both' ],
360 ],
361 [
362 'name' => 'ekit_video_style',
363 'operator' => '===',
364 'value' => 'popup',
365 ],
366 ],
367 ],
368
369 // CASE 2: Inline icon
370 [
371 'relation' => 'and',
372 'terms' => [
373 [
374 'name' => 'ekit_video_popup_button_style',
375 'operator' => 'in',
376 'value' => [ 'icon', 'both' ],
377 ],
378 [
379 'name' => 'ekit_video_inline_overlay_image[url]',
380 'operator' => '!=',
381 'value' => '',
382 ],
383 [
384 'name' => 'ekit_video_style',
385 'operator' => '===',
386 'value' => 'inline',
387 ],
388 [
389 'name' => 'ekit_video_inline_image_overlay_switcher',
390 'operator' => '===',
391 'value' => 'yes',
392 ],
393 ],
394 ],
395 ],
396 ],
397 ]
398 );
399
400 $this->add_control(
401 'ekit_video_popup_icon_align',
402 [
403 'label' =>esc_html__( 'Icon Position', 'elementskit-lite' ),
404 'type' => Controls_Manager::SELECT,
405 'default' => 'before',
406 'options' => [
407 'before' =>esc_html__( 'Before', 'elementskit-lite' ),
408 'after' =>esc_html__( 'After', 'elementskit-lite' ),
409 ],
410 'conditions' => [
411 'relation' => 'or',
412 'terms' => [
413
414 // CASE 1: Popup icon
415 [
416 'relation' => 'and',
417 'terms' => [
418 [
419 'name' => 'ekit_video_popup_button_style',
420 'operator' => 'in',
421 'value' => ['both' ],
422 ],
423 [
424 'name' => 'ekit_video_style',
425 'operator' => '===',
426 'value' => 'popup',
427 ],
428 ],
429 ],
430
431 // CASE 2: Inline icon
432 [
433 'relation' => 'and',
434 'terms' => [
435 [
436 'name' => 'ekit_video_popup_button_style',
437 'operator' => 'in',
438 'value' => [ 'both' ],
439 ],
440 [
441 'name' => 'ekit_video_inline_overlay_image[url]',
442 'operator' => '!=',
443 'value' => '',
444 ],
445 [
446 'name' => 'ekit_video_style',
447 'operator' => '===',
448 'value' => 'inline',
449 ],
450 [
451 'name' => 'ekit_video_inline_image_overlay_switcher',
452 'operator' => '===',
453 'value' => 'yes',
454 ],
455 ],
456 ],
457 ],
458 ],
459 ]
460 );
461
462 $this->add_control(
463 'ekit_video_popup_video_glow',
464 [
465 'label' => esc_html__( 'Active Glow', 'elementskit-lite' ),
466 'type' => Controls_Manager::SWITCHER,
467 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
468 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
469 'return_value' => 'yes',
470 'default' => 'yes',
471 'conditions' => [
472 'relation' => 'or',
473 'terms' => [
474
475 // CASE 1: Popup video
476 [
477 'name' => 'ekit_video_style',
478 'operator' => '===',
479 'value' => 'popup',
480 ],
481
482 // CASE 2: Inline video
483 [
484 'relation' => 'and',
485 'terms' => [
486 [
487 'name' => 'ekit_video_style',
488 'operator' => '===',
489 'value' => 'inline',
490 ],
491 [
492 'name' => 'ekit_video_inline_overlay_image[url]',
493 'operator' => '!=',
494 'value' => '',
495 ],
496 [
497 'name' => 'ekit_video_inline_image_overlay_switcher',
498 'operator' => '===',
499 'value' => 'yes',
500 ]
501 ],
502 ],
503
504 ],
505 ],
506 ]
507 );
508
509 $this->add_control(
510 'ekit_video_popup_glow_animation_type',
511 [
512 'label' => esc_html__( 'Glow Animation Type', 'elementskit-lite' ),
513 'type' => Controls_Manager::SELECT,
514 'default' => 'ripple',
515 'options' => [
516 'ripple' => esc_html__( 'Ripple', 'elementskit-lite' ),
517 'radio_wave' => esc_html__( 'Radio Wave', 'elementskit-lite' ),
518 ],
519 'conditions' => [
520 'relation' => 'or',
521 'terms' => [
522 [
523 'relation' => 'and',
524 'terms' => [
525 [
526 'name' => 'ekit_video_style',
527 'operator' => '===',
528 'value' => 'popup',
529 ],
530 [
531 'name' => 'ekit_video_popup_video_glow',
532 'operator' => '===',
533 'value' => 'yes',
534 ],
535 ],
536 ],
537 [
538 'relation' => 'and',
539 'terms' => [
540 [
541 'name' => 'ekit_video_style',
542 'operator' => '===',
543 'value' => 'inline',
544 ],
545 [
546 'name' => 'ekit_video_inline_image_overlay_switcher',
547 'operator' => '===',
548 'value' => 'yes',
549 ],
550 [
551 'name' => 'ekit_video_popup_video_glow',
552 'operator' => '===',
553 'value' => 'yes',
554 ],
555 [
556 'name' => 'ekit_video_inline_overlay_image[url]',
557 'operator' => '!=',
558 'value' => '',
559 ]
560 ],
561 ],
562 ],
563 ],
564
565 ]
566 );
567
568 // video options
569 $this->add_control(
570 'ekit_video_player_options_heading',
571 [
572 'label' => esc_html__('Video Options', 'elementskit-lite'),
573 'type' => Controls_Manager::HEADING,
574 'separator' => 'before',
575 ]
576 );
577 $this->add_control(
578 'ekit_video_popup_auto_play',
579 [
580 'label' => esc_html__( 'Auto Play', 'elementskit-lite' ),
581 'description' => esc_html__( 'Unmuted videos will not auto play in some browsers.', 'elementskit-lite'),
582 'type' => Controls_Manager::SWITCHER,
583 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
584 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
585 'default' => 'no',
586 'return_value' => '1',
587 'conditions' => [
588 'relation' => 'or',
589 'terms' => [
590 // Show for popup style
591 [
592 'name' => 'ekit_video_style',
593 'operator' => '===',
594 'value' => 'popup',
595 ],
596 // Show for inline style when overlay is NOT enabled
597 [
598 'relation' => 'and',
599 'terms' => [
600 [
601 'name' => 'ekit_video_style',
602 'operator' => '===',
603 'value' => 'inline',
604 ],
605 [
606 'name' => 'ekit_video_inline_image_overlay_switcher',
607 'operator' => '!==',
608 'value' => 'yes',
609 ],
610 ],
611 ],
612 ],
613 ],
614 ]
615 );
616
617 $this->add_control(
618 'ekit_video_popup_video_mute',
619 [
620 'label' => esc_html__( 'Mute', 'elementskit-lite' ),
621 'type' => Controls_Manager::SWITCHER,
622 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
623 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
624 'return_value' => '1',
625 'default' => 'no',
626 ]
627 );
628
629 $this->add_control(
630 'ekit_video_popup_video_loop',
631 [
632 'label' => esc_html__( 'Loop', 'elementskit-lite' ),
633 'type' => Controls_Manager::SWITCHER,
634 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
635 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
636 'return_value' => '1',
637 'default' => 'no',
638 ]
639 );
640
641 $this->add_control(
642 'ekit_video_popup_video_player_control',
643 [
644 'label' => esc_html__( 'Player Control', 'elementskit-lite' ),
645 'type' => Controls_Manager::SWITCHER,
646 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
647 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
648 'return_value' => '1',
649 'default' => 'yes',
650 'condition' => [
651 'ekit_video_popup_video_type!' => 'self',
652 ]
653 ]
654 );
655
656
657 $this->add_control(
658 'ekit_video_popup_video_intro_title',
659 [
660 'label' => esc_html__( 'Intro Title', 'elementskit-lite' ),
661 'type' => Controls_Manager::SWITCHER,
662 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
663 'label_off' =>esc_html__( 'No', 'elementskit-lite' ),
664 'return_value' => '1',
665 'default' => 'no',
666 'condition' => ['ekit_video_popup_video_type' => 'vimeo']
667 ]
668 );
669
670 $this->add_control(
671 'ekit_video_popup_video_intro_portrait',
672 [
673 'label' => esc_html__( 'Intro Portrait', 'elementskit-lite' ),
674 'type' => Controls_Manager::SWITCHER,
675 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
676 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
677 'return_value' => '1',
678 'default' => 'no',
679 'condition' => ['ekit_video_popup_video_type' => 'vimeo']
680 ]
681 );
682
683 $this->add_control(
684 'ekit_video_popup_video_intro_byline',
685 [
686 'label' => esc_html__( 'Intro Byline', 'elementskit-lite' ),
687 'type' => Controls_Manager::SWITCHER,
688 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
689 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
690 'return_value' => '1',
691 'default' => 'no',
692 'condition' => ['ekit_video_popup_video_type' => 'vimeo']
693 ]
694 );
695 //video option
696 $this->add_control(
697 'self_poster_image',
698 [
699 'label' => esc_html__( 'Poster Image', 'elementskit-lite' ),
700 'type' => Controls_Manager::MEDIA,
701 'dynamic' => [
702 'active' => true,
703 ],
704 'separator' => 'before',
705 'condition' => [
706 'ekit_video_popup_video_type' => 'self',
707 'ekit_video_style' => 'popup',
708 ],
709 ]
710 );
711
712 // Control Options
713 $this->add_control(
714 'ekit_video_player_control_options_heading',
715 [
716 'label' => esc_html__('Control Options', 'elementskit-lite'),
717 'type' => Controls_Manager::HEADING,
718 'separator' => 'before',
719 'condition' => [
720 'ekit_video_popup_video_type' => 'self',
721 ],
722 ]
723 );
724
725 $this->add_control(
726 'ekit_video_player_playpause',
727 [
728 'label' => esc_html__('Play Pause', 'elementskit-lite'),
729 'type' => Controls_Manager::SWITCHER,
730 'default' => 'yes',
731 'label_on' => esc_html__('Yes', 'elementskit-lite'),
732 'label_off' => esc_html__('No', 'elementskit-lite'),
733 'condition' => [
734 'ekit_video_popup_video_type' => 'self',
735 ],
736 ]
737 );
738
739 $this->add_control(
740 'ekit_video_player_progress',
741 [
742 'label' => esc_html__('Progress Bar', 'elementskit-lite'),
743 'type' => Controls_Manager::SWITCHER,
744 'default' => 'yes',
745 'label_on' => esc_html__('Yes', 'elementskit-lite'),
746 'label_off' => esc_html__('No', 'elementskit-lite'),
747 'condition' => [
748 'ekit_video_popup_video_type' => 'self',
749 ],
750 ]
751 );
752
753 $this->add_control(
754 'ekit_video_player_current',
755 [
756 'label' => esc_html__('Current Time', 'elementskit-lite'),
757 'type' => Controls_Manager::SWITCHER,
758 'default' => 'yes',
759 'label_on' => esc_html__('Yes', 'elementskit-lite'),
760 'label_off' => esc_html__('No', 'elementskit-lite'),
761 'condition' => [
762 'ekit_video_popup_video_type' => 'self',
763 ],
764 ]
765 );
766
767 $this->add_control(
768 'ekit_video_player_duration',
769 [
770 'label' => esc_html__('Total Duration', 'elementskit-lite'),
771 'type' => Controls_Manager::SWITCHER,
772 'default' => 'yes',
773 'label_on' => esc_html__('Yes', 'elementskit-lite'),
774 'label_off' => esc_html__('No', 'elementskit-lite'),
775 'condition' => [
776 'ekit_video_player_current' => 'yes',
777 'ekit_video_popup_video_type' => 'self',
778 ],
779 ]
780 );
781
782 $this->add_control(
783 'ekit_video_player_volume',
784 [
785 'label' => esc_html__('Volume Bar', 'elementskit-lite'),
786 'type' => Controls_Manager::SWITCHER,
787 'default' => 'yes',
788 'label_on' => esc_html__('Yes', 'elementskit-lite'),
789 'label_off' => esc_html__('No', 'elementskit-lite'),
790 'condition' => [
791 'ekit_video_popup_video_type' => 'self',
792 ],
793 ]
794 );
795
796 $this->add_control(
797 'ekit_video_player_volume_slider_layout',
798 [
799 'label' => esc_html__('Volume Slider Layout', 'elementskit-lite'),
800 'type' => Controls_Manager::SELECT,
801 'default' => 'horizontal',
802 'options' => [
803 'vertical' => esc_html__('Vertical', 'elementskit-lite'),
804 'horizontal' => esc_html__('Horizontal', 'elementskit-lite'),
805 ],
806 'condition' => [
807 'ekit_video_player_volume' => ['yes'],
808 'ekit_video_popup_video_type' => 'self',
809 ],
810 ]
811 );
812
813 $this->add_control(
814 'ekit_video_player_start_volume',
815 [
816 'label' => esc_html__('Start Volume', 'elementskit-lite'),
817 'description' => esc_html__('Initial volume when the player starts.', 'elementskit-lite'),
818 'type' => Controls_Manager::SLIDER,
819 'size_units' => ['px'],
820 'range' => [
821 'px' => [
822 'min' => 0,
823 'max' => 1,
824 'step' => 0.1,
825 ],
826 ],
827 'default' => [
828 'unit' => 'px',
829 'size' => 0.8,
830 ],
831 'condition' => [
832 'ekit_video_popup_video_type' => 'self',
833 ],
834 ]
835 );
836
837 $this->end_controls_section();
838
839 $this->start_controls_section(
840 'ekit_video_popup_style_section',
841 [
842 'label' => esc_html__( 'Wrapper', 'elementskit-lite' ),
843 'tab' => Controls_Manager::TAB_STYLE,
844 'condition' => [
845 'ekit_video_style' => 'popup',
846 ],
847 ]
848 );
849
850 $this->add_responsive_control(
851 'ekit_video_popup_title_align', [
852 'label' =>esc_html__( 'Alignment', 'elementskit-lite' ),
853 'type' => Controls_Manager::CHOOSE,
854 'options' => [
855
856 'left' => [
857 'title' =>esc_html__( 'Left', 'elementskit-lite' ),
858 'icon' => 'eicon-text-align-left',
859 ],
860 'center' => [
861 'title' =>esc_html__( 'Center', 'elementskit-lite' ),
862 'icon' => 'eicon-text-align-center',
863 ],
864 'right' => [
865 'title' =>esc_html__( 'Right', 'elementskit-lite' ),
866 'icon' => 'eicon-text-align-right',
867 ],
868 'justify' => [
869 'title' =>esc_html__( 'Justified', 'elementskit-lite' ),
870 'icon' => 'eicon-text-align-justify',
871 ],
872 ],
873 'default' => 'center',
874 'selectors' => [
875 '{{WRAPPER}} .video-content' => 'text-align: {{VALUE}};justify-content: {{VALUE}};display: flex;',
876 ],
877 ]
878 );
879
880 $this->add_responsive_control(
881 'ekit_video_wrap_padding',
882 [
883 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
884 'type' => Controls_Manager::DIMENSIONS,
885 'size_units' => [ 'px' ],
886 'selectors' => [
887 '{{WRAPPER}} .video-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
888 ],
889 ]
890 );
891
892 $this->add_group_control(
893 Group_Control_Border::get_type(),
894 [
895 'name' => 'ekit_video_wrap_border',
896 'label' => esc_html__( 'Border', 'elementskit-lite' ),
897 'selector' => '{{WRAPPER}} .video-content',
898 ]
899 );
900
901 $this->add_control(
902 'ekit_video_wrap_border_radius',
903 [
904 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
905 'type' => Controls_Manager::DIMENSIONS,
906 'size_units' => [ 'px', '%', 'em' ],
907 'selectors' => [
908 '{{WRAPPER}} .video-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
909
910 ],
911 ]
912 );
913
914 $this->end_controls_section();
915
916
917 // Popup Button Style
918 $this->start_controls_section(
919 'ekit_video_popup_section_style',
920 [
921 'label' =>esc_html__( 'Button', 'elementskit-lite' ),
922 'tab' => Controls_Manager::TAB_STYLE,
923 'conditions' => [
924 'relation' => 'or',
925 'terms' => [
926
927 // CASE 1: Popup video
928 [
929 'name' => 'ekit_video_style',
930 'operator' => '===',
931 'value' => 'popup',
932 ],
933
934 // CASE 2: Inline video
935 [
936 'relation' => 'and',
937 'terms' => [
938 [
939 'name' => 'ekit_video_style',
940 'operator' => '===',
941 'value' => 'inline',
942 ],
943 [
944 'name' => 'ekit_video_inline_overlay_image[url]',
945 'operator' => '!=',
946 'value' => '',
947 ],
948 [
949 'name' => 'ekit_video_inline_image_overlay_switcher',
950 'operator' => '===',
951 'value' => 'yes',
952 ]
953 ],
954 ],
955
956 ],
957 ],
958 ]
959 );
960
961 $this->add_responsive_control(
962 'ekit_video_popup_text_padding',
963 [
964 'label' =>esc_html__( 'Padding', 'elementskit-lite' ),
965 'type' => Controls_Manager::DIMENSIONS,
966 'size_units' => [ 'px', 'em', '%' ],
967 'selectors' => [
968 '{{WRAPPER}} .ekit-video-popup-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
969 '{{WRAPPER}} .ekit-video-inline-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
970 ],
971 ]
972 );
973
974 $this->add_responsive_control(
975 'ekit_video_popup_icon_size',
976 [
977 'label' => esc_html__( 'Icon Size', 'elementskit-lite' ),
978 'type' => Controls_Manager::SLIDER,
979 'size_units' => [ 'px' ],
980 'range' => [
981 'px' => [
982 'min' => 1,
983 'max' => 50,
984 'step' => 1,
985 ]
986 ],
987 'default' => [
988 'unit' => 'px',
989 'size' => 15,
990 ],
991 'selectors' => [
992 '{{WRAPPER}} a.ekit_icon_button:is(.ekit-video-popup-btn, .ekit-video-inline-btn):has(i,svg)' => 'font-size: {{SIZE}}{{UNIT}}',
993 ],
994 'condition' => [
995 'ekit_video_popup_button_style' => 'icon',
996 ]
997 ]
998 );
999
1000 $this->add_responsive_control(
1001 'ekit_video_popup_icon_padding_right',
1002 [
1003 'label' => esc_html__( 'Margin Right', 'elementskit-lite' ),
1004 'type' => Controls_Manager::SLIDER,
1005 'size_units' => [ 'px'],
1006 'range' => [
1007 'px' => [
1008 'min' => 0,
1009 'max' => 200,
1010 'step' => 1,
1011 ]
1012 ],
1013 'default' => [
1014 'unit' => 'px',
1015 'size' => 0,
1016 ],
1017 'selectors' => [
1018 '{{WRAPPER}} :is(.ekit-video-popup-btn, .ekit-video-inline-btn) > :is(i, svg)' => 'margin-right: {{SIZE}}{{UNIT}};',
1019 ],
1020 'conditions' => [
1021 'relation' => 'or',
1022 'terms' => [
1023 [
1024 'relation' => 'and',
1025 'terms' => [
1026 [
1027 'name' => 'ekit_video_style',
1028 'operator' => '===',
1029 'value' => 'popup',
1030 ],
1031 [
1032 'name' => 'ekit_video_popup_button_style',
1033 'operator' => 'in',
1034 'value' => [ 'both' ],
1035 ],
1036 [
1037 'name' => 'ekit_video_popup_icon_align',
1038 'operator' => '===',
1039 'value' => 'before',
1040 ],
1041 ],
1042 ],
1043 [
1044 'relation' => 'and',
1045 'terms' => [
1046 [
1047 'name' => 'ekit_video_style',
1048 'operator' => '===',
1049 'value' => 'inline',
1050 ],
1051 [
1052 'name' => 'ekit_video_inline_overlay_image[url]',
1053 'operator' => '!=',
1054 'value' => '',
1055 ],
1056 [
1057 'name' => 'ekit_video_inline_image_overlay_switcher',
1058 'operator' => '===',
1059 'value' => 'yes',
1060 ],
1061 [
1062 'name' => 'ekit_video_popup_button_style',
1063 'operator' => 'in',
1064 'value' => [ 'both' ],
1065 ],
1066 [
1067 'name' => 'ekit_video_popup_icon_align',
1068 'operator' => '===',
1069 'value' => 'before',
1070 ],
1071 ],
1072 ],
1073 ],
1074 ],
1075 ]
1076 );
1077
1078 $this->add_group_control(
1079 Group_Control_Typography::get_type(),
1080 [
1081 'name' => 'ekit_video_popup_btn_typography',
1082 'label' =>esc_html__( 'Typography', 'elementskit-lite' ),
1083 'selector' => '{{WRAPPER}} a.glow-ripple.ekit-video-popup-btn, {{WRAPPER}} a.glow-ripple.ekit-video-inline-btn',
1084 'condition' => [
1085 'ekit_video_popup_button_style' => ['text', 'both'],
1086 'ekit_video_popup_glow_animation_type' => ['ripple'],
1087 ],
1088 ]
1089 );
1090
1091 $this->add_group_control(
1092 Group_Control_Typography::get_type(),
1093 [
1094 'name' => 'ekit_video_popup_radio_wave_btn_typography',
1095 'label' =>esc_html__( 'Typography', 'elementskit-lite' ),
1096 'selector' => '{{WRAPPER}} a.glow-radio_wave.ekit-video-popup-btn,{{WRAPPER}} a.glow-radio_wave.ekit-video-inline-btn',
1097 'condition' => [
1098 'ekit_video_popup_button_style' => ['text', 'both'],
1099 'ekit_video_popup_glow_animation_type' => ['radio_wave'],
1100 ],
1101 ]
1102 );
1103
1104
1105 $this->add_control(
1106 'ekit_video_popup_btn_use_height_and_width',
1107 [
1108 'label' => esc_html__( 'Use height width', 'elementskit-lite' ),
1109 'type' => Controls_Manager::SWITCHER,
1110 'label_on' => esc_html__( 'Show', 'elementskit-lite' ),
1111 'label_off' => esc_html__( 'Hide', 'elementskit-lite' ),
1112 'return_value' => 'yes',
1113 'default' => 'yes',
1114 ]
1115 );
1116
1117 $this->add_responsive_control(
1118 'ekit_video_popup_btn_width',
1119 [
1120 'label' => esc_html__( 'Width', 'elementskit-lite' ),
1121 'type' => Controls_Manager::SLIDER,
1122 'size_units' => [ 'px', '%' ],
1123 'range' => [
1124 'px' => [
1125 'min' => 30,
1126 'max' => 200,
1127 'step' => 1,
1128 ],
1129 '%' => [
1130 'min' => 10,
1131 'max' => 100,
1132 ],
1133 ],
1134 'default' => [
1135 'unit' => 'px',
1136 'size' => 60,
1137 ],
1138 'selectors' => [
1139 '{{WRAPPER}} .ekit-video-popup-btn' => 'width: {{SIZE}}{{UNIT}};',
1140 '{{WRAPPER}} .ekit-video-inline-btn' => 'width: {{SIZE}}{{UNIT}};'
1141 ],
1142 'condition' => [
1143 'ekit_video_popup_btn_use_height_and_width' => 'yes'
1144 ]
1145 ]
1146 );
1147
1148 $this->add_responsive_control(
1149 'ekit_video_popup_btn_height',
1150 [
1151 'label' => esc_html__( 'Height', 'elementskit-lite' ),
1152 'type' => Controls_Manager::SLIDER,
1153 'size_units' => [ 'px', '%' ],
1154 'range' => [
1155 'px' => [
1156 'min' => 30,
1157 'max' => 200,
1158 'step' => 1,
1159 ],
1160 '%' => [
1161 'min' => 10,
1162 'max' => 100,
1163 ],
1164 ],
1165 'default' => [
1166 'unit' => 'px',
1167 'size' => 60,
1168 ],
1169 'selectors' => [
1170 '{{WRAPPER}} .ekit-video-popup-btn' => 'height: {{SIZE}}{{UNIT}};',
1171 '{{WRAPPER}} .ekit-video-inline-btn' => 'height: {{SIZE}}{{UNIT}};',
1172 ],
1173 'condition' => [
1174 'ekit_video_popup_btn_use_height_and_width' => 'yes'
1175 ]
1176 ]
1177 );
1178
1179 $this->add_responsive_control(
1180 'ekit_video_popup_btn_line_height',
1181 [
1182 'label' => esc_html__( 'Line height', 'elementskit-lite' ),
1183 'type' => Controls_Manager::SLIDER,
1184 'size_units' => [ 'px', '%' ],
1185 'range' => [
1186 'px' => [
1187 'min' => 0,
1188 'max' => 80,
1189 'step' => 1,
1190 ],
1191 '%' => [
1192 'min' => 0,
1193 'max' => 100,
1194 ],
1195 ],
1196 'selectors' => [
1197 '{{WRAPPER}} .ekit-video-popup-btn' => 'line-height: {{SIZE}}{{UNIT}};',
1198 '{{WRAPPER}} .ekit-video-inline-btn' => 'line-height: {{SIZE}}{{UNIT}};',
1199 ],
1200 'condition' => [
1201 'ekit_video_popup_btn_use_height_and_width' => 'yes',
1202 'ekit_video_popup_button_style' => ['both']
1203 ]
1204 ]
1205 );
1206
1207 $this->add_control(
1208 'ekit_video_popup_btn_glow_color',
1209 [
1210 'label' => esc_html__( 'Glow Color', 'elementskit-lite' ),
1211 'type' => Controls_Manager::COLOR,
1212 'selectors' => [
1213 '{{WRAPPER}} .glow-ripple:before' => 'color: {{VALUE}}',
1214 '{{WRAPPER}} .glow-ripple:after' => 'color: {{VALUE}}',
1215 '{{WRAPPER}} .glow-ripple > i:after' => 'color: {{VALUE}}',
1216 '{{WRAPPER}} .glow-radio_wave:before' => 'color: {{VALUE}}',
1217 '{{WRAPPER}} .glow-radio_wave:after' => 'color: {{VALUE}}',
1218 '{{WRAPPER}} .glow-radio_wave > i:after' => 'color: {{VALUE}}',
1219 ],
1220 'default' => '#255cff',
1221 'separator' => 'before',
1222 'condition' => [
1223 'ekit_video_popup_video_glow' => 'yes',
1224 'ekit_video_popup_glow_animation_type!' => '',
1225 ]
1226 ]
1227 );
1228
1229 $this->add_responsive_control(
1230 'ekit_video_popup_btn_glow_size',
1231 [
1232 'label' => esc_html__( 'Glow Size (px)', 'elementskit-lite' ),
1233 'type' => Controls_Manager::SLIDER,
1234 'size_units' => [ 'px'],
1235 'range' => [
1236 'px' => [
1237 'min' => 0,
1238 'max' => 200,
1239 'step' => 1,
1240 ],
1241 ],
1242 'default' => [
1243 'unit' => 'px',
1244 'size' => 15,
1245 ],
1246 'selectors' => [
1247 '{{WRAPPER}} .ekit-video-popup-btn' => '--glow-size: {{SIZE}}{{UNIT}};',
1248 '{{WRAPPER}} .ekit-video-inline-btn' => '--glow-size: {{SIZE}}{{UNIT}};',
1249 ],
1250 'condition' => [
1251 'ekit_video_popup_video_glow' => 'yes',
1252 'ekit_video_popup_glow_animation_type' => 'ripple',
1253 ]
1254 ]
1255 );
1256
1257 $this->add_control(
1258 'ekit_video_popup_radio_wave_scale',
1259 [
1260 'label' => esc_html__('Radio Wave Scale', 'elementskit-lite'),
1261 'type' => \Elementor\Controls_Manager::SLIDER,
1262 'range' => [
1263 'px' => [
1264 'min' => 0.5,
1265 'max' => 5,
1266 'step' => 0.1,
1267 ],
1268 ],
1269 'default' => [
1270 'unit' => 'px',
1271 'size' => 2,
1272 ],
1273 'condition' => [
1274 'ekit_video_popup_video_glow' => 'yes',
1275 'ekit_video_popup_glow_animation_type' => 'radio_wave',
1276 ],
1277 'selectors' => [
1278 '{{WRAPPER}} .glow-radio_wave' => '--ekit-radio-wave-scale: {{SIZE}};',
1279 ],
1280 ]
1281 );
1282
1283 $this->start_controls_tabs( 'ekit_video_popup_button_style_tabs' );
1284
1285 $this->start_controls_tab(
1286 'ekit_video_popup_button_normal',
1287 [
1288 'label' =>esc_html__( 'Normal', 'elementskit-lite' ),
1289 ]
1290 );
1291
1292 $this->add_control(
1293 'ekit_video_popup_btn_text_color',
1294 [
1295 'label' =>esc_html__( 'Icon Color', 'elementskit-lite' ),
1296 'type' => Controls_Manager::COLOR,
1297 'default' => '#ffffff',
1298 'selectors' => [
1299 '{{WRAPPER}} .ekit-video-popup-btn' => 'color: {{VALUE}};',
1300 '{{WRAPPER}} .ekit-video-inline-btn' => 'color: {{VALUE}};',
1301 '{{WRAPPER}} .ekit-video-popup-btn svg' => 'fill: {{VALUE}};',
1302 '{{WRAPPER}} .ekit-video-inline-btn svg' => 'fill: {{VALUE}};',
1303 ],
1304 ]
1305 );
1306 $this->add_group_control(
1307 Group_Control_Background::get_type(),
1308 array(
1309 'name' => 'ekit_video_popup_btn_bg_color',
1310 'selector' => '{{WRAPPER}} .ekit-video-popup-btn,{{WRAPPER}} .ekit-video-inline-btn',
1311 )
1312 );
1313
1314 $this->end_controls_tab();
1315
1316 $this->start_controls_tab(
1317 'ekit_video_popup_btn_tab_button_hover',
1318 [
1319 'label' =>esc_html__( 'Hover', 'elementskit-lite' ),
1320 ]
1321 );
1322
1323 $this->add_control(
1324 'ekit_video_popup_btn_hover_color',
1325 [
1326 'label' =>esc_html__( 'Icon Color', 'elementskit-lite' ),
1327 'type' => Controls_Manager::COLOR,
1328 'default' => '#ffffff',
1329 'selectors' => [
1330 '{{WRAPPER}} .ekit-video-popup-btn:hover' => 'color: {{VALUE}};',
1331 '{{WRAPPER}} .ekit-video-inline-btn:hover' => 'color: {{VALUE}};',
1332 '{{WRAPPER}} .ekit-video-popup-btn:hover svg' => 'fill: {{VALUE}};',
1333 '{{WRAPPER}} .ekit-video-inline-btn:hover svg' => 'fill: {{VALUE}};',
1334 ],
1335 ]
1336 );
1337
1338 $this->add_group_control(
1339 Group_Control_Background::get_type(),
1340 array(
1341 'name' => 'ekit_video_popup_btn_bg_hover_color',
1342 'selector' => '{{WRAPPER}} .ekit-video-popup-btn:hover, {{WRAPPER}} .ekit-video-inline-btn:hover',
1343 )
1344 );
1345
1346 $this->end_controls_tab();
1347 $this->end_controls_tabs();
1348 $this->end_controls_section();
1349
1350 $this->start_controls_section(
1351 'ekit_video_popup_border_style',
1352 [
1353 'label' =>esc_html__( 'Border', 'elementskit-lite' ),
1354 'tab' => Controls_Manager::TAB_STYLE,
1355 'conditions' => [
1356 'relation' => 'or',
1357 'terms' => [
1358
1359 // CASE 1: Popup video
1360 [
1361 'name' => 'ekit_video_style',
1362 'operator' => '===',
1363 'value' => 'popup',
1364 ],
1365
1366 // CASE 2: Inline video
1367 [
1368 'relation' => 'and',
1369 'terms' => [
1370 [
1371 'name' => 'ekit_video_style',
1372 'operator' => '===',
1373 'value' => 'inline',
1374 ],
1375 [
1376 'name' => 'ekit_video_inline_overlay_image[url]',
1377 'operator' => '!=',
1378 'value' => '',
1379 ],
1380 [
1381 'name' => 'ekit_video_inline_image_overlay_switcher',
1382 'operator' => '===',
1383 'value' => 'yes',
1384 ]
1385 ],
1386 ],
1387
1388 ],
1389 ],
1390 ]
1391 );
1392
1393 $this->add_control(
1394 'ekit_video_popup_btn_border_style',
1395 [
1396 'label' => esc_html_x( 'Border Type', 'Border Control', 'elementskit-lite' ),
1397 'type' => Controls_Manager::SELECT,
1398 'options' => [
1399 '' => esc_html__( 'None', 'elementskit-lite' ),
1400 'solid' => esc_html_x( 'Solid', 'Border Control', 'elementskit-lite' ),
1401 'double' => esc_html_x( 'Double', 'Border Control', 'elementskit-lite' ),
1402 'dotted' => esc_html_x( 'Dotted', 'Border Control', 'elementskit-lite' ),
1403 'dashed' => esc_html_x( 'Dashed', 'Border Control', 'elementskit-lite' ),
1404 'groove' => esc_html_x( 'Groove', 'Border Control', 'elementskit-lite' ),
1405 ],
1406 'selectors' => [
1407 '{{WRAPPER}} .ekit-video-popup-btn' => 'border-style: {{VALUE}};',
1408 '{{WRAPPER}} .ekit-video-inline-btn' => 'border-style: {{VALUE}};',
1409 ],
1410 ]
1411 );
1412 $this->add_control(
1413 'ekit_video_popup_btn_border_dimensions',
1414 [
1415 'label' => esc_html_x( 'Width', 'Border Control', 'elementskit-lite' ),
1416 'type' => Controls_Manager::DIMENSIONS,
1417 'selectors' => [
1418 '{{WRAPPER}} .ekit-video-popup-btn' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1419 '{{WRAPPER}} .ekit-video-inline-btn' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1420 ],
1421 'condition' => [
1422 'ekit_video_popup_btn_border_style!' => '',
1423 ],
1424 ]
1425 );
1426 $this->start_controls_tabs( 'ekit_video_popup__button_border_style' );
1427 $this->start_controls_tab(
1428 'ekit_video_popup__button_border_normal',
1429 [
1430 'label' =>esc_html__( 'Normal', 'elementskit-lite' ),
1431 'condition' => [
1432 'ekit_video_popup_btn_border_style!' => '',
1433 ]
1434 ],
1435 );
1436
1437 $this->add_control(
1438 'ekit_video_popup_btn_border_color',
1439 [
1440 'label' => esc_html_x( 'Color', 'Border Control', 'elementskit-lite' ),
1441 'type' => Controls_Manager::COLOR,
1442 'default' => '',
1443 'selectors' => [
1444 '{{WRAPPER}} .ekit-video-popup-btn' => 'border-color: {{VALUE}};',
1445 '{{WRAPPER}} .ekit-video-inline-btn' => 'border-color: {{VALUE}};',
1446 ],
1447 'condition' => [
1448 'ekit_video_popup_btn_border_style!' => '',
1449 ]
1450 ]
1451 );
1452 $this->end_controls_tab();
1453
1454 $this->start_controls_tab(
1455 'ekit_video_popup_btn_tab_button_border_hover',
1456 [
1457 'label' =>esc_html__( 'Hover', 'elementskit-lite' ),
1458 'condition' => [
1459 'ekit_video_popup_btn_border_style!' => '',
1460 ]
1461 ]
1462 );
1463 $this->add_control(
1464 'ekit_video_popup_btn_hover_border_color',
1465 [
1466 'label' => esc_html_x( 'Color', 'Border Control', 'elementskit-lite' ),
1467 'type' => Controls_Manager::COLOR,
1468 'default' => '',
1469 'selectors' => [
1470 '{{WRAPPER}} .ekit-video-popup-btn:hover' => 'border-color: {{VALUE}};',
1471 '{{WRAPPER}} .ekit-video-inline-btn:hover' => 'border-color: {{VALUE}};',
1472 ],
1473 'condition' => [
1474 'ekit_video_popup_btn_border_style!' => '',
1475 ]
1476 ]
1477 );
1478 $this->end_controls_tab();
1479 $this->end_controls_tabs();
1480 $this->add_responsive_control(
1481 'ekit_video_popup_btn_border_radius',
1482 [
1483 'label' =>esc_html__( 'Border Radius', 'elementskit-lite' ),
1484 'type' => Controls_Manager::DIMENSIONS,
1485 'size_units' => [ 'px'],
1486 'default' => [
1487 'top' => '',
1488 'right' => '',
1489 'bottom' => '' ,
1490 'left' => '',
1491 ],
1492 'selectors' => [
1493 '{{WRAPPER}} .ekit-video-popup-btn, {{WRAPPER}} .ekit-video-popup-btn:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1494 '{{WRAPPER}} .ekit-video-inline-btn, {{WRAPPER}} .ekit-video-inline-btn:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1495 '{{WRAPPER}} .glow-ripple.ekit-video-popup-btn' => '--video-glow-border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1496 '{{WRAPPER}} .glow-ripple.ekit-video-inline-btn' => '--video-glow-border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1497 ],
1498 ]
1499 );
1500 $this->end_controls_section();
1501
1502 $this->start_controls_section(
1503 'ekit_video_popup_box_shadow_style',
1504 [
1505 'label' =>esc_html__( 'Shadow', 'elementskit-lite' ),
1506 'tab' => Controls_Manager::TAB_STYLE,
1507 'conditions' => [
1508 'relation' => 'or',
1509 'terms' => [
1510
1511 // CASE 1: Popup video
1512 [
1513 'name' => 'ekit_video_style',
1514 'operator' => '===',
1515 'value' => 'popup',
1516 ],
1517
1518 // CASE 2: Inline video
1519 [
1520 'relation' => 'and',
1521 'terms' => [
1522 [
1523 'name' => 'ekit_video_style',
1524 'operator' => '===',
1525 'value' => 'inline',
1526 ],
1527 [
1528 'name' => 'ekit_video_inline_overlay_image[url]',
1529 'operator' => '!=',
1530 'value' => '',
1531 ],
1532 [
1533 'name' => 'ekit_video_inline_image_overlay_switcher',
1534 'operator' => '===',
1535 'value' => 'yes',
1536 ]
1537 ],
1538 ],
1539
1540 ],
1541 ],
1542 ]
1543 );
1544
1545 $this->add_group_control(
1546 Group_Control_Box_Shadow::get_type(),
1547 [
1548 'name' => 'ekit_video_popup_btn_box_shadow',
1549 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
1550 'selector' => '{{WRAPPER}} .ekit-video-popup-btn, {{WRAPPER}} .ekit-video-inline-btn',
1551 ]
1552 );
1553
1554 $this->add_group_control(
1555 Group_Control_Text_Shadow::get_type(),
1556 [
1557 'name' => 'ekit_video_popup_btn_text_shadow',
1558 'label' => esc_html__( 'Text Shadow', 'elementskit-lite' ),
1559 'selector' => '{{WRAPPER}} .ekit-video-popup-btn, {{WRAPPER}} .ekit-video-inline-btn',
1560 ]
1561 );
1562
1563 $this->end_controls_section();
1564
1565 $this->start_controls_section(
1566 'ekit_video_popup_control_style',
1567 [
1568 'label' => esc_html__( 'Popup', 'elementskit-lite' ),
1569 'tab' => Controls_Manager::TAB_STYLE,
1570 'condition' => [
1571 'ekit_video_style' => 'popup',
1572 ]
1573 ]
1574 );
1575
1576 $this->add_control(
1577 'ekit_video_popup_background_color',
1578 [
1579 'label' =>esc_html__( 'Background', 'elementskit-lite' ),
1580 'type' => Controls_Manager::COLOR,
1581 // 'selectors' => [
1582 // '.mfp-iframe-holder' => 'background-color: {{VALUE}};',
1583 // ],
1584 ]
1585 );
1586 $this->end_controls_section();
1587
1588 $this->start_controls_section(
1589 'ekit_video_popup_close_icon_style',
1590 [
1591 'label' => esc_html__( 'Popup Close Button', 'elementskit-lite' ),
1592 'tab' => Controls_Manager::TAB_STYLE,
1593 'condition' => [
1594 'ekit_video_style' => 'popup',
1595 ]
1596 ]
1597 );
1598
1599 $this->add_control(
1600 'ekit_video_popup_close_icon',
1601 [
1602 'label' =>esc_html__( 'Icon', 'elementskit-lite' ),
1603 'type' => Controls_Manager::ICONS,
1604 'default' => [
1605 'value' => 'icon icon-cancel',
1606 'library' => 'ekiticons',
1607 ],
1608 'label_block' => true,
1609 'frontend_available' => true,
1610 ]
1611 );
1612
1613 $this->add_control(
1614 'popup_close_icon_after',
1615 [
1616 'type' => Controls_Manager::DIVIDER,
1617 ]
1618 );
1619
1620 $this->add_responsive_control(
1621 'ekit_video_popup_close_icon_width',
1622 [
1623 'label' => esc_html__( 'Width', 'elementskit-lite' ),
1624 'type' => Controls_Manager::SLIDER,
1625 'size_units' => [ 'px', '%' ],
1626 'range' => [
1627 'px' => [
1628 'min' => 30,
1629 'max' => 200,
1630 'step' => 1,
1631 ],
1632 '%' => [
1633 'min' => 10,
1634 'max' => 100,
1635 ],
1636 ],
1637 'default' => [
1638 'unit' => 'px',
1639 'size' => 44,
1640 ],
1641 'selectors' => [
1642 '.mfp-close.ekit-video-popup-close' => 'width: {{SIZE}}{{UNIT}};'
1643 ],
1644 ]
1645 );
1646
1647 $this->add_responsive_control(
1648 'ekit_video_popup_close_icon_height',
1649 [
1650 'label' => esc_html__( 'Height', 'elementskit-lite' ),
1651 'type' => Controls_Manager::SLIDER,
1652 'size_units' => [ 'px', '%' ],
1653 'range' => [
1654 'px' => [
1655 'min' => 30,
1656 'max' => 200,
1657 'step' => 1,
1658 ],
1659 '%' => [
1660 'min' => 10,
1661 'max' => 100,
1662 ],
1663 ],
1664 'default' => [
1665 'unit' => 'px',
1666 'size' => 44,
1667 ],
1668 'selectors' => [
1669 '.mfp-close.ekit-video-popup-close' => 'height: {{SIZE}}{{UNIT}};'
1670 ],
1671 ]
1672 );
1673
1674 $this->add_control(
1675 'popup_close_icon_height_width_after',
1676 [
1677 'type' => Controls_Manager::DIVIDER,
1678 ]
1679 );
1680
1681
1682 $this->add_responsive_control(
1683 'ekit_video_popup_close_icon_size',
1684 [
1685 'label' => esc_html__( 'Icon Size', 'elementskit-lite' ),
1686 'type' => Controls_Manager::SLIDER,
1687 'size_units' => [ 'px'],
1688 'range' => [
1689 'px' => [
1690 'min' => 0,
1691 'max' => 200,
1692 'step' => 1,
1693 ],
1694 ],
1695 'default' => [
1696 'unit' => 'px',
1697 'size' => 10,
1698 ],
1699 'selectors' => [
1700 '.mfp-close.ekit-video-popup-close' => 'font-size: {{SIZE}}{{UNIT}};',
1701 '.mfp-close.ekit-video-popup-close svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
1702 ],
1703 ]
1704 );
1705
1706 $this->add_control(
1707 'ekit_video_popup_close_icon_border_style',
1708 [
1709 'label' => esc_html_x( 'Border Type', 'Border Control', 'elementskit-lite' ),
1710 'type' => Controls_Manager::SELECT,
1711 'options' => [
1712 '' => esc_html__( 'None', 'elementskit-lite' ),
1713 'solid' => esc_html_x( 'Solid', 'Border Control', 'elementskit-lite' ),
1714 'double' => esc_html_x( 'Double', 'Border Control', 'elementskit-lite' ),
1715 'dotted' => esc_html_x( 'Dotted', 'Border Control', 'elementskit-lite' ),
1716 'dashed' => esc_html_x( 'Dashed', 'Border Control', 'elementskit-lite' ),
1717 'groove' => esc_html_x( 'Groove', 'Border Control', 'elementskit-lite' ),
1718 ],
1719 'selectors' => [
1720 '.mfp-close.ekit-video-popup-close' => 'border-style: {{VALUE}};',
1721 ],
1722 ]
1723 );
1724 $this->add_control(
1725 'ekit_video_popup_close_icon_border_width',
1726 [
1727 'label' => esc_html_x( 'Border Width', 'Border Control', 'elementskit-lite' ),
1728 'type' => Controls_Manager::DIMENSIONS,
1729 'selectors' => [
1730 '.mfp-close.ekit-video-popup-close' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1731 ],
1732 'condition' => [
1733 'ekit_video_popup_close_icon_border_style!' => '',
1734 ],
1735 ]
1736 );
1737 $this->add_responsive_control(
1738 'ekit_video_popup_close_icon_position', [
1739 'label' =>esc_html__( 'Close Button Position', 'elementskit-lite' ),
1740 'type' => Controls_Manager::CHOOSE,
1741 'options' => [
1742
1743 'left' => [
1744 'title' =>esc_html__( 'Left', 'elementskit-lite' ),
1745 'icon' => 'eicon-text-align-left',
1746 ],
1747 'right' => [
1748 'title' =>esc_html__( 'Right', 'elementskit-lite' ),
1749 'icon' => 'eicon-text-align-right',
1750 ],
1751
1752 ],
1753 'default' => 'right',
1754 'selectors' => [
1755 '.mfp-close.ekit-video-popup-close' => '{{VALUE}}: 0;',
1756 ],
1757 ]
1758 );
1759
1760 $this->start_controls_tabs( 'ekit_video_popup_close_icon_style_tabs' );
1761
1762 $this->start_controls_tab(
1763 'ekit_video_popup_close_icon_normal',
1764 [
1765 'label' =>esc_html__( 'Normal', 'elementskit-lite' ),
1766 ]
1767 );
1768
1769 $this->add_control(
1770 'ekit_video_popup_close_icon_background_color',
1771 [
1772 'label' =>esc_html__( 'Background', 'elementskit-lite' ),
1773 'type' => Controls_Manager::COLOR,
1774 'default' => '#000000',
1775 'selectors' => [
1776 '.mfp-close.ekit-video-popup-close' => 'background-color: {{VALUE}};',
1777
1778 ],
1779 ]
1780 );
1781
1782 $this->add_control(
1783 'ekit_video_popup_close_icon_color',
1784 [
1785 'label' =>esc_html__( 'Color', 'elementskit-lite' ),
1786 'type' => Controls_Manager::COLOR,
1787 'default' => '#ffffff',
1788 'selectors' => [
1789 '.mfp-close.ekit-video-popup-close' => 'color: {{VALUE}};',
1790 '.mfp-close.ekit-video-popup-close .ekit-popup-close-icon svg' => 'fill: {{VALUE}};'
1791 ],
1792 ]
1793 );
1794
1795 $this->add_control(
1796 'ekit_video_popup_close_icon_border_color',
1797 [
1798 'label' =>esc_html__( 'Border Color', 'elementskit-lite' ),
1799 'type' => Controls_Manager::COLOR,
1800 'default' => '#ffffff',
1801 'selectors' => [
1802 '.mfp-close.ekit-video-popup-close' => 'border-color: {{VALUE}};',
1803 ],
1804 'condition' => [
1805 'ekit_video_popup_close_icon_border_style!' => '',
1806 ],
1807 ]
1808 );
1809
1810 $this->add_responsive_control(
1811 'ekit_video_popup_close_icon_border_radius',
1812 [
1813 'label' =>esc_html__( 'Border Radius', 'elementskit-lite' ),
1814 'type' => Controls_Manager::DIMENSIONS,
1815 'size_units' => [ 'px', '%'],
1816 'default' => [
1817 'top' => '50',
1818 'right' => '50',
1819 'bottom' => '50',
1820 'left' => '50',
1821 'unit' => '%'
1822 ],
1823 'selectors' => [
1824 '.mfp-close.ekit-video-popup-close' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1825 ],
1826 ]
1827 );
1828
1829 $this->end_controls_tab();
1830
1831 $this->start_controls_tab(
1832 'ekit_video_popup_close_icon_hover',
1833 [
1834 'label' =>esc_html__( 'Hover', 'elementskit-lite' ),
1835 ]
1836 );
1837
1838 $this->add_control(
1839 'ekit_video_popup_close_icon_background_color_hover',
1840 [
1841 'label' =>esc_html__( 'Background', 'elementskit-lite' ),
1842 'type' => Controls_Manager::COLOR,
1843 'default' => '#000000',
1844 'selectors' => [
1845 '.mfp-close.ekit-video-popup-close:hover' => 'background-color: {{VALUE}};',
1846 '.ekit_self_video_wrap .mfp-close.ekit-video-popup-close:hover' => 'background-color: {{VALUE}};',
1847
1848 ],
1849 ]
1850 );
1851
1852 $this->add_control(
1853 'ekit_video_popup_close_icon_color_hover',
1854 [
1855 'label' =>esc_html__( 'Color', 'elementskit-lite' ),
1856 'type' => Controls_Manager::COLOR,
1857 'default' => '#ffffff',
1858 'selectors' => [
1859 '.mfp-close.ekit-video-popup-close:hover .ekit-popup-close-icon i' => 'color: {{VALUE}};',
1860 '.mfp-close.ekit-video-popup-close:hover .ekit-popup-close-icon svg' => 'fill: {{VALUE}};'
1861
1862 ],
1863 ]
1864 );
1865
1866 $this->add_control(
1867 'ekit_video_popup_close_icon_border_color_hover',
1868 [
1869 'label' =>esc_html__( 'Border Color', 'elementskit-lite' ),
1870 'type' => Controls_Manager::COLOR,
1871 'default' => '#ffffff',
1872 'selectors' => [
1873 '.mfp-close.ekit-video-popup-close:hover' => 'border-color: {{VALUE}};',
1874 ],
1875 'condition' => [
1876 'ekit_video_popup_close_icon_border_style!' => '',
1877 ],
1878 ]
1879 );
1880
1881 $this->add_responsive_control(
1882 'ekit_video_popup_close_icon_border_radius_hover',
1883 [
1884 'label' =>esc_html__( 'Border Radius', 'elementskit-lite' ),
1885 'type' => Controls_Manager::DIMENSIONS,
1886 'size_units' => [ 'px', '%'],
1887 'default' => [
1888 'top' => '50',
1889 'right' => '50',
1890 'bottom' => '50',
1891 'left' => '50',
1892 'unit' => '%'
1893 ],
1894 'selectors' => [
1895 '.mfp-close.ekit-video-popup-close:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1896 ],
1897 ]
1898 );
1899
1900 $this->end_controls_tab();
1901 $this->end_controls_tabs();
1902
1903 $this->end_controls_section();
1904
1905 $this->start_controls_section(
1906 'ekit_video_inline_play_style',
1907 [
1908 'label' =>esc_html__( 'Player', 'elementskit-lite' ),
1909 'tab' => Controls_Manager::TAB_STYLE,
1910 'condition' => [
1911 'ekit_video_style' => 'inline',
1912 ],
1913 ]
1914 );
1915
1916 $this->add_control(
1917 'aspect_ratio',
1918 [
1919 'label' => esc_html__( 'Aspect Ratio', 'elementskit-lite' ),
1920 'type' => Controls_Manager::SELECT,
1921 'options' => [
1922 '169' => '16:9',
1923 '219' => '21:9',
1924 '43' => '4:3',
1925 '32' => '3:2',
1926 '11' => '1:1',
1927 '916' => '9:16',
1928 ],
1929 'selectors_dictionary' => [
1930 '169' => '1.77777', // 16 / 9
1931 '219' => '2.33333', // 21 / 9
1932 '43' => '1.33333', // 4 / 3
1933 '32' => '1.5', // 3 / 2
1934 '11' => '1', // 1 / 1
1935 '916' => '0.5625', // 9 / 16
1936 ],
1937 'default' => '169',
1938 'selectors' => [
1939 '{{WRAPPER}} .ekit-inline-video-content' => '--video-aspect-ratio: {{VALUE}}!important; aspect-ratio: {{VALUE}}!important;',
1940 ],
1941 ]
1942 );
1943
1944 $this->end_controls_section();
1945 $this->insert_pro_message();
1946 }
1947
1948 private function get_hosted_params() {
1949 $settings = $this->get_settings_for_display();
1950
1951 $video_params = [];
1952 if ( isset( $settings['ekit_video_popup_auto_play'] ) && $settings['ekit_video_popup_auto_play'] === '1' && empty($settings['ekit_video_inline_overlay_image']['url'])) {
1953 $video_params['autoplay'] = 'autoplay';
1954 }
1955 // Use strict comparison so that 'no' (default) does NOT evaluate as truthy.
1956 if ( isset( $settings['ekit_video_popup_video_loop'] ) && $settings['ekit_video_popup_video_loop'] === '1' ) {
1957 $video_params['loop'] = 'loop';
1958 }
1959 if ( isset( $settings['ekit_video_popup_video_mute'] ) && $settings['ekit_video_popup_video_mute'] === '1' ) {
1960 $video_params['muted'] = 'muted';
1961 }
1962
1963 return $video_params;
1964 }
1965 /**
1966 * Render hidden icons for JS
1967 */
1968 private function render_hidden_icons() {
1969 $settings = $this->get_settings_for_display();
1970 ?>
1971 <div class="ekit-hidden-icons" style="display: none;">
1972 <div class="ekit-popup-close-icon">
1973 <?php Icons_Manager::render_icon($settings['ekit_video_popup_close_icon'], ['aria-hidden' => 'true']); ?>
1974 </div>
1975 </div>
1976 <?php
1977 }
1978
1979 /**
1980 * Video Icon
1981 */
1982 private function video_icon() {
1983 $settings = $this->get_settings_for_display();
1984
1985 // new icon popup button
1986 $migrated = isset( $settings['__fa4_migrated']['ekit_video_popup_button_icons'] );
1987 // Check if its a new widget without previously selected icon using the old Icon control
1988 $is_new = empty( $settings['ekit_video_popup_button_icon'] );
1989 if ( $is_new || $migrated ) {
1990 // new icon
1991 Icons_Manager::render_icon( $settings['ekit_video_popup_button_icons'], [ 'aria-hidden' => 'true' ] );
1992 } else {
1993 ?>
1994 <i class="<?php echo esc_attr($settings['ekit_video_popup_button_icons']); ?>" aria-hidden="true"></i>
1995 <?php
1996 }
1997 }
1998
1999 protected function render( ) {
2000 echo '<div class="ekit-wid-con" >';
2001 $this->render_raw();
2002 echo '</div>';
2003 }
2004
2005 protected function render_raw( ) {
2006 $settings = $this->get_settings_for_display();
2007 extract($settings);
2008
2009 $player_control = isset( $ekit_video_popup_video_player_control ) && $ekit_video_popup_video_player_control == '1' ? 1 : 0;
2010
2011 // Fallback Video URL for YouTube
2012 if ( empty($ekit_video_popup_url) ) {
2013 $ekit_video_popup_url = 'https://www.youtube.com/watch?v=VhBl3dHT5SY';
2014 }
2015
2016 $ekit_video_popup_url = Embed::get_embed_url( $ekit_video_popup_url ); // Support for short links like: https://youtu.be/VhBl3dHT5SY
2017 $video_properties = Embed::get_video_properties( $ekit_video_popup_url ); // Get only the video id.
2018
2019 $video_id = '';
2020 if( !empty($video_properties['video_id']) ) {
2021 $video_id = $video_properties['video_id'];
2022 }
2023 if ($ekit_video_style === 'inline' && ($ekit_video_popup_video_type === "vimeo" || $ekit_video_popup_video_type === "youtube") && !empty($ekit_video_inline_overlay_image['url'])) {
2024 $is_autoplay = 0;
2025 }else{
2026 $is_autoplay = (int) $ekit_video_popup_auto_play;
2027 }
2028 $is_muted = (int) $ekit_video_popup_video_mute;
2029
2030 if ( $ekit_video_popup_video_type === "vimeo" ) {
2031 $url = explode( '#', $ekit_video_popup_url, 2 );
2032 $ekit_video_popup_url = $url[0];
2033
2034 // Controls (default to 0 if not enabled)
2035 $title = $settings['ekit_video_popup_video_intro_title'] == 1 ? 1 :0;
2036 $portrait = $settings['ekit_video_popup_video_intro_portrait'] == 1 ? 1: 0;
2037 $byline = $settings['ekit_video_popup_video_intro_byline'] == 1 ? 1: 0;
2038
2039 // Build URL
2040 $ekit_video_popup_url .= "?playlist={$video_id}&muted={$is_muted}&autoplay={$is_autoplay}&loop={$ekit_video_popup_video_loop}&controls={$player_control}&start={$ekit_video_popup_start_time}&end={$ekit_video_popup_end_time}&title={$title}&portrait={$portrait}&byline={$byline}";
2041
2042
2043 }
2044 else{
2045 $ekit_video_popup_url = $ekit_video_popup_url."?playlist={$video_id}&mute={$is_muted}&autoplay={$is_autoplay}&loop={$ekit_video_popup_video_loop}&controls={$player_control}&start={$ekit_video_popup_start_time}&end={$ekit_video_popup_end_time}";
2046
2047 };
2048
2049 // set player features playpause, current, progress, duration, volume
2050 $features = [];
2051 ($ekit_video_player_playpause === 'yes') && array_push($features, 'playpause');
2052 ($ekit_video_player_current === 'yes') && array_push($features, 'current');
2053 ($ekit_video_player_progress === 'yes') && array_push($features, 'progress');
2054 ($ekit_video_player_duration === 'yes') && array_push($features, 'duration');
2055 ($ekit_video_player_volume === 'yes') && array_push($features, 'volume');
2056
2057
2058
2059 // set settings data attributes
2060 $video_settings['videoVolume'] = (!empty($ekit_video_player_volume_slider_layout)) ? $ekit_video_player_volume_slider_layout: 'horizontal';
2061 $video_settings['startVolume'] = (!empty($ekit_video_player_start_volume['size'])) ? $ekit_video_player_start_volume['size']: 0.8;
2062 $video_settings['videoType'] = (!empty($ekit_video_popup_video_type === 'vimeo' || $ekit_video_popup_video_type === 'youtube')) ? 'iframe': 'inline';
2063 $video_settings['videoClass'] = (!empty($ekit_video_popup_video_type === 'vimeo' || $ekit_video_popup_video_type === 'youtube')) ? 'mfp-fade': 'ekit_self_video_wrap_content';
2064 $video_settings['popupIcon'] = (!empty($ekit_video_popup_close_icon)) ? $ekit_video_popup_close_icon : '';
2065 $video_settings['videoStyle'] = (!empty($ekit_video_style)) ? $ekit_video_style : '';
2066 $video_settings['videoTypeName'] = (!empty($ekit_video_popup_video_type)) ? $ekit_video_popup_video_type : '';
2067 $video_settings['autoplay'] = (!empty($ekit_video_popup_auto_play) && $ekit_video_popup_auto_play === '1') ? true : false;
2068 $video_settings['muted'] = (!empty($ekit_video_popup_video_mute) && $ekit_video_popup_video_mute === '1') ? true : false;
2069 $video_settings['loop'] = (!empty($ekit_video_popup_video_loop) && $ekit_video_popup_video_loop === '1') ? true : false;
2070 $video_settings['bg_color'] = !empty($settings['ekit_video_popup_background_color']) ? $settings['ekit_video_popup_background_color'] : '';
2071 $poster_image = !empty($self_poster_image['url']) ? esc_url($self_poster_image['url']) : '';
2072 $hosted_params = $this->get_hosted_params();
2073 //generate id
2074 $generate_id = "test-popup-link".$this->get_id();
2075 // registering video player default attributes.
2076 $this->add_render_attribute(
2077 'player',
2078 [
2079 'preload' => 'none',
2080 'controls' => '',
2081 'poster' => $poster_image,
2082 ]
2083 );
2084
2085 // video options
2086 if (!empty($ekit_video_popup_auto_play) && $ekit_video_popup_auto_play === '1') {
2087 $this->add_render_attribute('player', 'autoplay', '');
2088 }
2089
2090 if (!empty($ekit_video_popup_video_loop) && $ekit_video_popup_video_loop === '1') {
2091 $this->add_render_attribute('player', 'loop', '');
2092 $ekit_video_popup_url = $ekit_video_popup_url = preg_replace( '/[?&]feature=oembed/', '', $ekit_video_popup_url ); // Remove feature=oembed from the URL to prevent Vimeo from adding a loop parameter
2093 }
2094
2095 if (!empty($ekit_video_popup_video_mute) && $ekit_video_popup_video_mute === '1') {
2096 $this->add_render_attribute('player', 'muted', '');
2097 }
2098
2099 $clean_url = "#";
2100 if (isset($ekit_video_self_external_url) && filter_var($ekit_video_self_external_url, FILTER_VALIDATE_URL)) {
2101 $clean_url = $ekit_video_self_external_url;
2102 }
2103
2104 $clean_url = ($ekit_video_self_url === 'yes' && $clean_url !== '')
2105 ? $clean_url
2106 : (isset($ekit_video_player_self_hosted['url']) ? esc_url($ekit_video_player_self_hosted['url']) : '#');
2107
2108 if($ekit_video_style === 'popup') {
2109 ?>
2110 <div class="video-content" data-video-player="<?php echo esc_attr(wp_json_encode($features)); ?>" data-video-setting="<?php echo esc_attr(wp_json_encode($video_settings)); ?>">
2111 <?php
2112 $this->render_hidden_icons();
2113 if($ekit_video_popup_video_type === 'vimeo' || $ekit_video_popup_video_type === 'youtube') :
2114 include Handler::get_dir() . 'parts/video-button.php'; ?>
2115 <?php else :
2116 include Handler::get_dir() . 'parts/video-button.php'; ?>
2117 <div id="<?php echo esc_attr($generate_id); ?>" class="mfp-hide ekit_self_video_wrap">
2118 <video class="video_class"
2119 <?php if($poster_image) : ?> poster="<?php echo esc_url($poster_image); ?>" <?php endif; ?>
2120 >
2121 <source type="video/mp4" src="<?php echo esc_url($clean_url); ?>" />
2122 </video>
2123 </div>
2124 <?php endif;?>
2125 </div>
2126 <?php
2127 }else {
2128 ?>
2129 <div class="ekit-video-frame" data-video-player="<?php echo esc_attr(wp_json_encode($features)); ?>" data-video-setting="<?php echo esc_attr(wp_json_encode($video_settings)); ?>">
2130 <div class="ekit-inline-video-content <?php if($settings['ekit_video_inline_image_overlay_switcher'] === 'yes') : ?> ekit-video-inline-overlay-wrapper <?php endif; ?><?php if($ekit_video_popup_video_type === 'self') : ?> ekit-video-self-hosted<?php endif; ?>">
2131 <?php if($ekit_video_popup_video_type === 'vimeo' || $ekit_video_popup_video_type === 'youtube') :
2132 if(isset($settings['ekit_video_inline_image_overlay_switcher']) && $settings['ekit_video_inline_image_overlay_switcher'] === 'yes' ) {
2133 include Handler::get_dir() . 'parts/video-button.php';
2134 }
2135 ?>
2136 <iframe src="<?php echo esc_url($ekit_video_popup_url); ?>" allow="autoplay" allowfullscreen></iframe>
2137 <?php else :
2138 if(isset($settings['ekit_video_inline_image_overlay_switcher']) && $settings['ekit_video_inline_image_overlay_switcher'] === 'yes'){
2139 include Handler::get_dir() . 'parts/video-button.php';
2140 }
2141 if ( $ekit_video_popup_video_type === 'self' && isset( $settings['ekit_video_popup_video_player_control'] ) && $settings['ekit_video_popup_video_player_control'] === '1') {
2142 $hosted_params['controls'] = 'controls';
2143 }
2144
2145 ?>
2146 <!-- <video class="inline_video_class" src="<?php echo esc_url($clean_url); ?>" <?php Utils::print_html_attributes( $hosted_params ); ?>>
2147 </video> -->
2148
2149 <video class="inline_video_class"
2150 <?php Utils::print_html_attributes( $hosted_params ); ?>
2151 <?php if($poster_image) : ?> poster="<?php echo esc_url($poster_image); ?>" <?php endif; ?>
2152 >
2153 <source type="video/mp4" src="<?php echo esc_url($clean_url); ?>" />
2154 </video>
2155 <?php endif; ?>
2156
2157 <?php if (!empty($settings['ekit_video_inline_overlay_image']['url']) && $settings['ekit_video_inline_image_overlay_switcher'] === 'yes') :
2158 ?>
2159 <div class="ekit-inline-video-overlay-image">
2160 <img src="<?php echo esc_url($settings['ekit_video_inline_overlay_image']['url']); ?>" alt="Overlay Image">
2161 </div>
2162 <?php endif; ?>
2163 </div>
2164 </div>
2165 <?php
2166 }
2167 }
2168 }
2169