Premium Addons for Elementor - Version 3.7.6

Version Description

  • Tweak: Added Youtube Thumbnail Size option to Videobox and Grid widgets.
  • Tweak: Updated Person widget social icons to Font Awesome 5.
  • Fixed: Invalid background-image in Videobox widget when Overlay option is disabled.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 3.7.6
Comparing to
See all releases

Code changes from version 3.7.5 to 3.7.6

admin/includes/version-control.php CHANGED
@@ -92,7 +92,7 @@ class Version_Control {
92
  <tr class="pa-roll-row">
93
  <th><?php echo __('Rollback Version', 'premium-addons-for-elementor'); ?></th>
94
  <td>
95
- <div><?php echo sprintf( '<a target="_blank" href="%1$s" class="button pa-btn pa-rollback-button elementor-button-spinner">%2$s</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ), __('Reinstall Version 3.7.4', 'premium-addons-for-elementor') ); ?></div>
96
  <p class="pa-roll-desc">
97
  <span><?php echo __('Warning: Please backup your database before making the rollback.', 'premium-addons-for-elementor'); ?></span>
98
  </p>
92
  <tr class="pa-roll-row">
93
  <th><?php echo __('Rollback Version', 'premium-addons-for-elementor'); ?></th>
94
  <td>
95
+ <div><?php echo sprintf( '<a target="_blank" href="%1$s" class="button pa-btn pa-rollback-button elementor-button-spinner">%2$s</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ), __('Reinstall Version 3.7.5', 'premium-addons-for-elementor') ); ?></div>
96
  <p class="pa-roll-desc">
97
  <span><?php echo __('Warning: Please backup your database before making the rollback.', 'premium-addons-for-elementor'); ?></span>
98
  </p>
includes/class-helper-functions.php CHANGED
@@ -210,11 +210,15 @@ class Helper_Functions {
210
  *
211
  * @param string $id video ID
212
  * @param string $type embed type
 
213
  */
214
- public static function get_video_thumbnail( $id, $type ) {
215
 
216
  if ( 'youtube' === $type ) {
217
- $thumbnail_src = sprintf( 'https://i.ytimg.com/vi/%s/maxresdefault.jpg', $id );
 
 
 
218
  } elseif ( 'vimeo' === $type ) {
219
 
220
  $vimeo_data = wp_remote_get( 'http://www.vimeo.com/api/v2/video/' . intval( $id ) . '.php' );
210
  *
211
  * @param string $id video ID
212
  * @param string $type embed type
213
+ * @param string $size youtube thumbnail size
214
  */
215
+ public static function get_video_thumbnail( $id, $type, $size = '' ) {
216
 
217
  if ( 'youtube' === $type ) {
218
+ if ( '' === $size ) {
219
+ $size = 'maxresdefault';
220
+ }
221
+ $thumbnail_src = sprintf( 'https://i.ytimg.com/vi/%s/%s.jpg', $id, $size );
222
  } elseif ( 'vimeo' === $type ) {
223
 
224
  $vimeo_data = wp_remote_get( 'http://www.vimeo.com/api/v2/video/' . intval( $id ) . '.php' );
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 22+ premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
- Version: 3.7.5
7
  Author: Leap13
8
  Author URI: https://leap13.com/
9
  Text Domain: premium-addons-for-elementor
@@ -14,12 +14,12 @@ License: GNU General Public License v3.0
14
  if ( ! defined('ABSPATH') ) exit; // No access of directly access
15
 
16
  // Define Constants
17
- define('PREMIUM_ADDONS_VERSION', '3.7.5');
18
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
19
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
20
  define('PREMIUM_ADDONS_FILE', __FILE__);
21
  define('PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
22
- define('PREMIUM_ADDONS_STABLE_VERSION', '3.7.4');
23
 
24
  if( ! class_exists('Premium_Addons_Elementor') ) {
25
 
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons Plugin Includes 22+ premium widgets for Elementor Page Builder.
5
  Plugin URI: https://premiumaddons.com
6
+ Version: 3.7.6
7
  Author: Leap13
8
  Author URI: https://leap13.com/
9
  Text Domain: premium-addons-for-elementor
14
  if ( ! defined('ABSPATH') ) exit; // No access of directly access
15
 
16
  // Define Constants
17
+ define('PREMIUM_ADDONS_VERSION', '3.7.6');
18
  define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
19
  define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
20
  define('PREMIUM_ADDONS_FILE', __FILE__);
21
  define('PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
22
+ define('PREMIUM_ADDONS_STABLE_VERSION', '3.7.5');
23
 
24
  if( ! class_exists('Premium_Addons_Elementor') ) {
25
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate Link: https://premiumaddons.com/?utm_source=wp-repo&utm_medium=link&utm_c
5
  Requires at Least: 4.5
6
  Tested Up To: 5.2.2
7
  Requires PHP: 5.4
8
- Stable Tag: 3.7.5
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
@@ -175,6 +175,12 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
175
 
176
  == Changelog ==
177
 
 
 
 
 
 
 
178
  = 3.7.5 =
179
 
180
  - Tweak: Person widget `Width` option enhanced.
5
  Requires at Least: 4.5
6
  Tested Up To: 5.2.2
7
  Requires PHP: 5.4
8
+ Stable Tag: 3.7.6
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
175
 
176
  == Changelog ==
177
 
178
+ = 3.7.6 =
179
+
180
+ - Tweak: Added `Youtube Thumbnail Size` option to Videobox and Grid widgets.
181
+ - Tweak: Updated Person widget social icons to Font Awesome 5.
182
+ - Fixed: Invalid `background-image` in Videobox widget when `Overlay` option is disabled.
183
+
184
  = 3.7.5 =
185
 
186
  - Tweak: Person widget `Width` option enhanced.
widgets/premium-grid.php CHANGED
@@ -604,6 +604,20 @@ class Premium_Grid extends Widget_Base {
604
  ]
605
  );
606
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  $this->end_controls_section();
608
 
609
  $this->start_controls_section('premium_gallery_grid_settings',
@@ -2155,9 +2169,11 @@ class Premium_Grid extends Widget_Base {
2155
  }
2156
  } else {
2157
 
2158
- $image_src = $item['premium_gallery_img']['url'];
 
 
2159
 
2160
- if( 'hosted' !== $item['premium_gallery_video_type'] ) {
2161
  $embed_params = $this->get_embed_params( $item );
2162
  $link = Embed::get_embed_url( $item['premium_gallery_video_url'], $embed_params );
2163
 
@@ -2165,8 +2181,11 @@ class Premium_Grid extends Widget_Base {
2165
  $video_props = Embed::get_video_properties( $link );
2166
  $id = $video_props['video_id'];
2167
  $type = $video_props['provider'];
2168
-
2169
- $image_src = Helper_Functions::get_video_thumbnail( $id, $type );
 
 
 
2170
  }
2171
 
2172
  } else {
604
  ]
605
  );
606
 
607
+ $this->add_control('premium_gallery_yt_thumbnail_size',
608
+ [
609
+ 'label' => __( 'Youtube Thumbnail Size', 'premium-addons-for-elementor' ),
610
+ 'type' => Controls_Manager::SELECT,
611
+ 'options' => [
612
+ 'maxresdefault' => __( 'Maximum Resolution', 'premium-addons-for-elementor' ),
613
+ 'hqdefault' => __( 'High Quality', 'premium-addons-for-elementor' ),
614
+ 'mqdefault' => __( 'Medium Quality', 'premium-addons-for-elementor' ),
615
+ 'sddefault' => __( 'Standard Quality', 'premium-addons-for-elementor' ),
616
+ ],
617
+ 'default' => 'maxresdefault',
618
+ ]
619
+ );
620
+
621
  $this->end_controls_section();
622
 
623
  $this->start_controls_section('premium_gallery_grid_settings',
2169
  }
2170
  } else {
2171
 
2172
+ $image_src = $item['premium_gallery_img']['url'];
2173
+
2174
+ $type = $item['premium_gallery_video_type'];
2175
 
2176
+ if( 'hosted' !== $type ) {
2177
  $embed_params = $this->get_embed_params( $item );
2178
  $link = Embed::get_embed_url( $item['premium_gallery_video_url'], $embed_params );
2179
 
2181
  $video_props = Embed::get_video_properties( $link );
2182
  $id = $video_props['video_id'];
2183
  $type = $video_props['provider'];
2184
+ $size = '';
2185
+ if( 'youtube' === $type ) {
2186
+ $size = $settings['premium_gallery_yt_thumbnail_size'];
2187
+ }
2188
+ $image_src = Helper_Functions::get_video_thumbnail( $id, $type, $size );
2189
  }
2190
 
2191
  } else {
widgets/premium-person.php CHANGED
@@ -647,18 +647,18 @@ class Premium_Person extends Widget_Base {
647
  </div>
648
  <?php endif; ?>
649
  <ul class="premium-person-social-list">
650
- <?php if( !empty( $settings['premium_person_facebook'] ) ) : ?><li class="premium-person-list-item premium-person-facebook"><a href="<?php echo $settings['premium_person_facebook']; ?>" target="_blank"><i class="fa fa-facebook"></i></a></li><?php endif; ?>
651
- <?php if( !empty( $settings['premium_person_twitter'] ) ) : ?><li class="premium-person-list-item premium-person-twitter"><a href="<?php echo $settings['premium_person_twitter']; ?>" target="_blank"><i class="fa fa-twitter"></i></a></li><?php endif; ?>
652
- <?php if( !empty( $settings['premium_person_linkedin'] ) ) : ?><li class="premium-person-list-item premium-person-linkedin"><a href="<?php echo $settings['premium_person_linkedin']; ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li><?php endif; ?>
653
- <?php if( !empty( $settings['premium_person_google'] ) ) : ?><li class="premium-person-list-item premium-person-google"><a href="<?php echo $settings['premium_person_google']; ?>" target="_blank"><i class="fa fa-google-plus"></i></a></li><?php endif; ?>
654
- <?php if( !empty( $settings['premium_person_youtube'] ) ) : ?><li class="premium-person-list-item premium-person-youtube"><a href="<?php echo $settings['premium_person_youtube']; ?>" target="_blank"><i class="fa fa-youtube"></i></a></li><?php endif; ?>
655
 
656
- <?php if( !empty( $settings['premium_person_instagram'] ) ) : ?><li class="premium-person-list-item premium-person-instagram"><a href="<?php echo $settings['premium_person_instagram']; ?>" target="_blank"><i class="fa fa-instagram"></i></a></li><?php endif; ?>
657
- <?php if( !empty( $settings['premium_person_skype'] ) ) : ?><li class="premium-person-list-item premium-person-skype"><a href="<?php echo $settings['premium_person_skype']; ?>" target="_blank"><i class="fa fa-skype"></i></a></li><?php endif; ?>
658
- <?php if( !empty( $settings['premium_person_pinterest'] ) ) : ?><li class="premium-person-list-item premium-person-pinterest"><a href="<?php echo $settings['premium_person_pinterest']; ?>" target="_blank"><i class="fa fa-pinterest"></i></a></li><?php endif; ?>
659
- <?php if( !empty( $settings['premium_person_dribbble'] ) ) : ?><li class="premium-person-list-item premium-person-dribbble"><a href="<?php echo $settings['premium_person_dribbble']; ?>" target="_blank"><i class="fa fa-dribbble"></i></a></li><?php endif; ?>
660
- <?php if( !empty( $settings['premium_person_behance'] ) ) : ?><li class="premium-person-list-item premium-person-behance"><a href="<?php echo $settings['premium_person_behance']; ?>" target="_blank"><i class="fa fa-behance"></i></a></li><?php endif; ?>
661
- <?php if( !empty( $settings['premium_person_mail'] ) ) : ?><li class="premium-person-list-item premium-person-mail"><a href="<?php echo $settings['premium_person_mail']; ?>" target="_blank"><i class="fa fa-envelope"></i></a></li><?php endif; ?>
662
  </ul>
663
  </div>
664
  </div>
@@ -729,47 +729,47 @@ class Premium_Person extends Widget_Base {
729
  <# } #>
730
  <ul class="premium-person-social-list">
731
  <# if( '' != settings.premium_person_facebook ) { #>
732
- <li class="premium-person-list-item premium-person-facebook"><a href="{{ settings.premium_person_facebook }}" target="_blank"><i class="fa fa-facebook"></i></a></li>
733
  <# } #>
734
 
735
  <# if( '' != settings.premium_person_twitter ) { #>
736
- <li class="premium-person-list-item premium-person-twitter"><a href="{{ settings.premium_person_twitter }}" target="_blank"><i class="fa fa-twitter"></i></a></li>
737
  <# } #>
738
 
739
  <# if( '' != settings.premium_person_linkedin ) { #>
740
- <li class="premium-person-list-item premium-person-linkedin"><a href="{{ settings.premium_person_linkedin }}" target="_blank"><i class="fa fa-linkedin"></i></a></li>
741
  <# } #>
742
 
743
  <# if( '' != settings.premium_person_google ) { #>
744
- <li class="premium-person-list-item premium-person-google"><a href="{{ settings.premium_person_google }}" target="_blank"><i class="fa fa-google-plus"></i></a></li>
745
  <# } #>
746
 
747
  <# if( '' != settings.premium_person_youtube ) { #>
748
- <li class="premium-person-list-item premium-person-youtube"><a href="{{ settings.premium_person_youtube }}" target="_blank"><i class="fa fa-youtube"></i></a></li>
749
  <# } #>
750
 
751
  <# if( '' != settings.premium_person_instagram ) { #>
752
- <li class="premium-person-list-item premium-person-instagram"><a href="{{ settings.premium_person_instagram }}" target="_blank"><i class="fa fa-instagram"></i></a></li>
753
  <# } #>
754
 
755
  <# if( '' != settings.premium_person_skype) { #>
756
- <li class="premium-person-list-item premium-person-skype"><a href="{{ settings.premium_person_skype }}" target="_blank"><i class="fa fa-skype"></i></a></li>
757
  <# } #>
758
 
759
  <# if( '' != settings.premium_person_pinterest ) { #>
760
- <li class="premium-person-list-item premium-person-pinterest"><a href="{{ settings.premium_person_pinterest }}" target="_blank"><i class="fa fa-pinterest"></i></a></li>
761
  <# } #>
762
 
763
  <# if( '' != settings.premium_person_dribbble ) { #>
764
- <li class="premium-person-list-item premium-person-dribbble"><a href="{{ settings.premium_person_dribbble }}" target="_blank"><i class="fa fa-dribbble"></i></a></li>
765
  <# } #>
766
 
767
  <# if( '' != settings.premium_person_behance ) { #>
768
- <li class="premium-person-list-item premium-person-behance"><a href="{{ settings.premium_person_behance }}" target="_blank"><i class="fa fa-behance"></i></a></li>
769
  <# } #>
770
 
771
  <# if( '' != settings.premium_person_mail ) { #>
772
- <li class="premium-person-list-item premium-person-mail"><a href="{{ settings.premium_person_mail }}" target="_blank"><i class="fa fa-envelope"></i></a></li>
773
  <# } #>
774
 
775
  </ul>
647
  </div>
648
  <?php endif; ?>
649
  <ul class="premium-person-social-list">
650
+ <?php if( !empty( $settings['premium_person_facebook'] ) ) : ?><li class="premium-person-list-item premium-person-facebook"><a href="<?php echo $settings['premium_person_facebook']; ?>" target="_blank"><i class="fab fa-facebook-f"></i></a></li><?php endif; ?>
651
+ <?php if( !empty( $settings['premium_person_twitter'] ) ) : ?><li class="premium-person-list-item premium-person-twitter"><a href="<?php echo $settings['premium_person_twitter']; ?>" target="_blank"><i class="fab fa-twitter"></i></a></li><?php endif; ?>
652
+ <?php if( !empty( $settings['premium_person_linkedin'] ) ) : ?><li class="premium-person-list-item premium-person-linkedin"><a href="<?php echo $settings['premium_person_linkedin']; ?>" target="_blank"><i class="fab fa-linkedin"></i></a></li><?php endif; ?>
653
+ <?php if( !empty( $settings['premium_person_google'] ) ) : ?><li class="premium-person-list-item premium-person-google"><a href="<?php echo $settings['premium_person_google']; ?>" target="_blank"><i class="fab fa-google-plus-g"></i></a></li><?php endif; ?>
654
+ <?php if( !empty( $settings['premium_person_youtube'] ) ) : ?><li class="premium-person-list-item premium-person-youtube"><a href="<?php echo $settings['premium_person_youtube']; ?>" target="_blank"><i class="fab fa-youtube"></i></a></li><?php endif; ?>
655
 
656
+ <?php if( !empty( $settings['premium_person_instagram'] ) ) : ?><li class="premium-person-list-item premium-person-instagram"><a href="<?php echo $settings['premium_person_instagram']; ?>" target="_blank"><i class="fab fa-instagram"></i></a></li><?php endif; ?>
657
+ <?php if( !empty( $settings['premium_person_skype'] ) ) : ?><li class="premium-person-list-item premium-person-skype"><a href="<?php echo $settings['premium_person_skype']; ?>" target="_blank"><i class="fab fa-skype"></i></a></li><?php endif; ?>
658
+ <?php if( !empty( $settings['premium_person_pinterest'] ) ) : ?><li class="premium-person-list-item premium-person-pinterest"><a href="<?php echo $settings['premium_person_pinterest']; ?>" target="_blank"><i class="fab fa-pinterest"></i></a></li><?php endif; ?>
659
+ <?php if( !empty( $settings['premium_person_dribbble'] ) ) : ?><li class="premium-person-list-item premium-person-dribbble"><a href="<?php echo $settings['premium_person_dribbble']; ?>" target="_blank"><i class="fab fa-dribbble"></i></a></li><?php endif; ?>
660
+ <?php if( !empty( $settings['premium_person_behance'] ) ) : ?><li class="premium-person-list-item premium-person-behance"><a href="<?php echo $settings['premium_person_behance']; ?>" target="_blank"><i class="fab fa-behance"></i></a></li><?php endif; ?>
661
+ <?php if( !empty( $settings['premium_person_mail'] ) ) : ?><li class="premium-person-list-item premium-person-mail"><a href="<?php echo $settings['premium_person_mail']; ?>" target="_blank"><i class="far fa-envelope"></i></a></li><?php endif; ?>
662
  </ul>
663
  </div>
664
  </div>
729
  <# } #>
730
  <ul class="premium-person-social-list">
731
  <# if( '' != settings.premium_person_facebook ) { #>
732
+ <li class="premium-person-list-item premium-person-facebook"><a href="{{ settings.premium_person_facebook }}" target="_blank"><i class="fab fa-facebook-f"></i></a></li>
733
  <# } #>
734
 
735
  <# if( '' != settings.premium_person_twitter ) { #>
736
+ <li class="premium-person-list-item premium-person-twitter"><a href="{{ settings.premium_person_twitter }}" target="_blank"><i class="fab fa-twitter"></i></a></li>
737
  <# } #>
738
 
739
  <# if( '' != settings.premium_person_linkedin ) { #>
740
+ <li class="premium-person-list-item premium-person-linkedin"><a href="{{ settings.premium_person_linkedin }}" target="_blank"><i class="fab fa-linkedin"></i></a></li>
741
  <# } #>
742
 
743
  <# if( '' != settings.premium_person_google ) { #>
744
+ <li class="premium-person-list-item premium-person-google"><a href="{{ settings.premium_person_google }}" target="_blank"><i class="fab fa-google-plus-g"></i></a></li>
745
  <# } #>
746
 
747
  <# if( '' != settings.premium_person_youtube ) { #>
748
+ <li class="premium-person-list-item premium-person-youtube"><a href="{{ settings.premium_person_youtube }}" target="_blank"><i class="fab fa-youtube"></i></a></li>
749
  <# } #>
750
 
751
  <# if( '' != settings.premium_person_instagram ) { #>
752
+ <li class="premium-person-list-item premium-person-instagram"><a href="{{ settings.premium_person_instagram }}" target="_blank"><i class="fab fa-instagram"></i></a></li>
753
  <# } #>
754
 
755
  <# if( '' != settings.premium_person_skype) { #>
756
+ <li class="premium-person-list-item premium-person-skype"><a href="{{ settings.premium_person_skype }}" target="_blank"><i class="fab fa-skype"></i></a></li>
757
  <# } #>
758
 
759
  <# if( '' != settings.premium_person_pinterest ) { #>
760
+ <li class="premium-person-list-item premium-person-pinterest"><a href="{{ settings.premium_person_pinterest }}" target="_blank"><i class="fab fa-pinterest"></i></a></li>
761
  <# } #>
762
 
763
  <# if( '' != settings.premium_person_dribbble ) { #>
764
+ <li class="premium-person-list-item premium-person-dribbble"><a href="{{ settings.premium_person_dribbble }}" target="_blank"><i class="fab fa-dribbble"></i></a></li>
765
  <# } #>
766
 
767
  <# if( '' != settings.premium_person_behance ) { #>
768
+ <li class="premium-person-list-item premium-person-behance"><a href="{{ settings.premium_person_behance }}" target="_blank"><i class="fab fa-behance"></i></a></li>
769
  <# } #>
770
 
771
  <# if( '' != settings.premium_person_mail ) { #>
772
+ <li class="premium-person-list-item premium-person-mail"><a href="{{ settings.premium_person_mail }}" target="_blank"><i class="far fa-envelope"></i></a></li>
773
  <# } #>
774
 
775
  </ul>
widgets/premium-videobox.php CHANGED
@@ -121,7 +121,7 @@ class Premium_Videobox extends Widget_Base {
121
  'label' => __('Link', 'premium-addons-for-elementor'),
122
  'type' => Controls_Manager::TEXT,
123
  'label_block' => true,
124
- 'default' => 'https://www.youtube.com/watch?v=xPe1jMuX32s',
125
  'dynamic' => [
126
  'active' => true,
127
  'categories' => [
@@ -248,6 +248,24 @@ class Premium_Videobox extends Widget_Base {
248
  ]
249
  );
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  $this->end_controls_section();
252
 
253
  $this->start_controls_section('premium_video_box_image_settings',
@@ -643,13 +661,21 @@ class Premium_Videobox extends Widget_Base {
643
 
644
  $id = $this->get_id();
645
 
 
 
646
  $params = $this->get_video_params();
647
 
648
- $image = $this->get_video_thumbnail( $params['id'] );
 
 
 
 
 
 
649
 
650
  $link = $params['link'];
651
 
652
- $video_type = $settings['premium_video_box_video_type'];
653
 
654
  $hosted_url = !empty( $settings['premium_video_box_self_hosted']['url'] ) ? $settings['premium_video_box_self_hosted']['url'] : '' ;
655
 
@@ -754,7 +780,7 @@ class Premium_Videobox extends Widget_Base {
754
  <video src="<?php echo esc_url( $hosted_url ); ?>" <?php echo $video_params; ?>></video>
755
  <?php endif; ?>
756
  </div>
757
- <div class="premium-video-box-image-container" style="background-image: url('<?php echo esc_url( $image ); ?>');">
758
  </div>
759
  <?php if( $settings['premium_video_box_play_icon_switcher'] == 'yes' ) : ?>
760
  <div class="premium-video-box-play-icon-container">
@@ -777,12 +803,16 @@ class Premium_Videobox extends Widget_Base {
777
 
778
  $type = $settings['premium_video_box_video_type'];
779
 
780
- $thumbnail = $settings['premium_video_box_image_switcher'];
781
-
782
- $thumbnail_src = $settings['premium_video_box_image']['url'];
783
 
784
- if ( 'yes' !== $thumbnail ) {
785
- $thumbnail_src = Helper_Functions::get_video_thumbnail( $id, $type );
 
 
 
 
 
 
786
  }
787
 
788
  return $thumbnail_src;
121
  'label' => __('Link', 'premium-addons-for-elementor'),
122
  'type' => Controls_Manager::TEXT,
123
  'label_block' => true,
124
+ 'default' => 'https://www.youtube.com/watch?v=07d2dXHYb94',
125
  'dynamic' => [
126
  'active' => true,
127
  'categories' => [
248
  ]
249
  );
250
 
251
+ $this->add_control('premium_video_box_yt_thumbnail_size',
252
+ [
253
+ 'label' => __( 'Thumbnail Size', 'premium-addons-for-elementor' ),
254
+ 'type' => Controls_Manager::SELECT,
255
+ 'options' => [
256
+ 'maxresdefault' => __( 'Maximum Resolution', 'premium-addons-for-elementor' ),
257
+ 'hqdefault' => __( 'High Quality', 'premium-addons-for-elementor' ),
258
+ 'mqdefault' => __( 'Medium Quality', 'premium-addons-for-elementor' ),
259
+ 'sddefault' => __( 'Standard Quality', 'premium-addons-for-elementor' ),
260
+ ],
261
+ 'default' => 'maxresdefault',
262
+ 'condition' => [
263
+ 'premium_video_box_video_type' => 'youtube',
264
+ 'premium_video_box_image_switcher!' => 'yes'
265
+ ],
266
+ ]
267
+ );
268
+
269
  $this->end_controls_section();
270
 
271
  $this->start_controls_section('premium_video_box_image_settings',
661
 
662
  $id = $this->get_id();
663
 
664
+ $video_type = $settings['premium_video_box_video_type'];
665
+
666
  $params = $this->get_video_params();
667
 
668
+ $thumbnail = $this->get_video_thumbnail( $params['id'] );
669
+
670
+ if( 'self' !== $video_type ) {
671
+ $image = sprintf( 'url(\'%s\')', $thumbnail );
672
+ } else {
673
+ $image = 'none';
674
+ }
675
 
676
  $link = $params['link'];
677
 
678
+
679
 
680
  $hosted_url = !empty( $settings['premium_video_box_self_hosted']['url'] ) ? $settings['premium_video_box_self_hosted']['url'] : '' ;
681
 
780
  <video src="<?php echo esc_url( $hosted_url ); ?>" <?php echo $video_params; ?>></video>
781
  <?php endif; ?>
782
  </div>
783
+ <div class="premium-video-box-image-container" style="background-image: <?php echo $image; ?>;">
784
  </div>
785
  <?php if( $settings['premium_video_box_play_icon_switcher'] == 'yes' ) : ?>
786
  <div class="premium-video-box-play-icon-container">
803
 
804
  $type = $settings['premium_video_box_video_type'];
805
 
806
+ $overlay = $settings['premium_video_box_image_switcher'];
 
 
807
 
808
+ if ( 'yes' !== $overlay ) {
809
+ $size = '';
810
+ if('youtube'=== $type) {
811
+ $size = $settings['premium_video_box_yt_thumbnail_size'];
812
+ }
813
+ $thumbnail_src = Helper_Functions::get_video_thumbnail( $id, $type, $size );
814
+ } else {
815
+ $thumbnail_src = $settings['premium_video_box_image']['url'];
816
  }
817
 
818
  return $thumbnail_src;