PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.84
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.84
4.11.84 4.11.83 4.11.82 4.11.80 4.11.81 4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-videobox.php
premium-addons-for-elementor / widgets Last commit date
dep 3 weeks ago premium-banner.php 1 day ago premium-blog.php 2 weeks ago premium-button.php 2 weeks ago premium-carousel.php 2 weeks ago premium-contactform.php 2 weeks ago premium-countdown.php 2 weeks ago premium-counter.php 2 weeks ago premium-dual-header.php 2 weeks ago premium-fancytext.php 2 weeks ago premium-grid.php 2 weeks ago premium-icon-list.php 2 weeks ago premium-image-button.php 2 weeks ago premium-image-scroll.php 2 weeks ago premium-image-separator.php 2 weeks ago premium-lottie.php 2 weeks ago premium-maps.php 2 days ago premium-media-wheel.php 2 weeks ago premium-mobile-menu.php 2 weeks ago premium-modalbox.php 2 days ago premium-nav-menu.php 2 weeks ago premium-notifications.php 2 weeks ago premium-person.php 2 weeks ago premium-pinterest-feed.php 2 weeks ago premium-post-ticker.php 2 weeks ago premium-pricing-table.php 2 days ago premium-progressbar.php 2 weeks ago premium-search-form.php 2 days ago premium-svg-drawer.php 2 weeks ago premium-tcloud.php 2 weeks ago premium-testimonials.php 2 weeks ago premium-textual-showcase.php 2 weeks ago premium-tiktok-feed.php 2 weeks ago premium-title.php 2 days ago premium-videobox.php 2 weeks ago premium-vscroll.php 2 weeks ago premium-weather.php 2 weeks ago premium-world-clock.php 2 weeks ago
premium-videobox.php
3801 lines
1 <?php
2 /**
3 * Premium Video Box.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Modules\DynamicTags\Module as TagsModule;
10 use Elementor\Widget_Base;
11 use Elementor\Utils;
12 use Elementor\Embed;
13 use Elementor\Icons_Manager;
14 use Elementor\Controls_Manager;
15 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
16 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
17 use Elementor\Group_Control_Border;
18 use Elementor\Group_Control_Typography;
19 use Elementor\Group_Control_Text_Shadow;
20 use Elementor\Group_Control_Box_Shadow;
21
22 // PremiumAddons Classes.
23 use PremiumAddons\Admin\Includes\Admin_Helper;
24 use PremiumAddons\Includes\Helper_Functions;
25 use PremiumAddons\Includes\Controls\Premium_Background;
26
27 if ( ! defined( 'ABSPATH' ) ) {
28 exit; // If this file is called directly, abort.
29 }
30
31 /**
32 * Class Premium_Videobox
33 */
34 class Premium_Videobox extends Widget_Base {
35
36 /**
37 * Retrieve Widget Name.
38 *
39 * @since 1.0.0
40 * @access public
41 */
42 public function get_name() {
43 return 'premium-addon-video-box';
44 }
45
46 /**
47 * Retrieve Widget Title.
48 *
49 * @since 1.0.0
50 * @access public
51 */
52 public function get_title() {
53 return __( 'Video Box', 'premium-addons-for-elementor' );
54 }
55
56 /**
57 * Retrieve Widget Icon.
58 *
59 * @since 1.0.0
60 * @access public
61 *
62 * @return string widget icon.
63 */
64 public function get_icon() {
65 return 'pa-video-box';
66 }
67
68 /**
69 * Retrieve Widget Categories.
70 *
71 * @since 1.5.1
72 * @access public
73 *
74 * @return array Widget categories.
75 */
76 public function get_categories() {
77 return array( 'premium-elements' );
78 }
79
80 /**
81 * Retrieve Widget Dependent CSS.
82 *
83 * @since 1.0.0
84 * @access public
85 *
86 * @return array CSS style handles.
87 */
88 public function get_style_depends() {
89 return array(
90 'pa-prettyphoto',
91 'font-awesome-5-all',
92 'premium-addons',
93 );
94 }
95
96 /**
97 * Retrieve Widget Dependent JS.
98 *
99 * @since 1.0.0
100 * @access public
101 *
102 * @return array JS script handles.
103 */
104 public function get_script_depends() {
105 return array(
106 'pa-scrolldir',
107 'prettyPhoto-js',
108 'jquery-ui-draggable',
109 'premium-addons',
110 );
111 }
112
113 /**
114 * Retrieve Widget Keywords.
115 *
116 * @since 1.0.0
117 * @access public
118 *
119 * @return array Widget keywords.
120 */
121 public function get_keywords() {
122 return array( 'pa', 'premium', 'premium video box', 'youtube', 'vimeo', 'self', 'hosted', 'media', 'list', 'embed', 'dailymotion' );
123 }
124
125 /**
126 * Retrieve Widget Support URL.
127 *
128 * @access public
129 *
130 * @return string support URL.
131 */
132 public function get_custom_help_url() {
133 return 'https://premiumaddons.com/support/';
134 }
135
136 public function has_widget_inner_wrapper(): bool {
137 return true;
138 }
139
140 /**
141 * Register Video Box controls.
142 *
143 * @since 1.0.0
144 * @access protected
145 */
146 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
147
148 $this->start_controls_section(
149 'premium_video_box_general_settings',
150 array(
151 'label' => __( 'Video Box', 'premium-addons-for-elementor' ),
152 )
153 );
154
155 $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-video-box-widget/', 'video-box', 'wp-editor', 'demo' );
156 Helper_Functions::add_templates_controls( $this, 'video-box', $demo );
157
158 $this->add_control(
159 'premium_video_box_video_type',
160 array(
161 'label' => __( 'Video Type', 'premium-addons-for-elementor' ),
162 'type' => Controls_Manager::SELECT,
163 'default' => 'youtube',
164 'options' => array(
165 'youtube' => __( 'Youtube', 'premium-addons-for-elementor' ),
166 'vimeo' => __( 'Vimeo', 'premium-addons-for-elementor' ),
167 'dailymotion' => __( 'Dailymotion', 'premium-addons-for-elementor' ),
168 'self' => __( 'Self Hosted', 'premium-addons-for-elementor' ),
169 ),
170 'frontend_available' => true,
171 )
172 );
173
174 $this->add_control(
175 'premium_video_box_video_id_embed_selection',
176 array(
177 'label' => __( 'Link', 'premium-addons-for-elementor' ),
178 'type' => Controls_Manager::HIDDEN,
179 'default' => 'id',
180 'options' => array(
181 'id' => __( 'ID', 'premium-addons-for-elementor' ),
182 'embed' => __( 'Embed URL', 'premium-addons-for-elementor' ),
183 ),
184 'condition' => array(
185 'premium_video_box_video_type!' => 'self',
186 ),
187 )
188 );
189
190 $this->add_control(
191 'premium_video_box_video_id',
192 array(
193 'label' => __( 'Video ID', 'premium-addons-for-elementor' ),
194 'description' => __( 'Enter the numbers and letters after the equal sign which located in your YouTube video link or after the slash sign in your Vimeo video link. For example, z1hQgVpfTKU', 'premium-addons-for-elementor' ),
195 'type' => Controls_Manager::HIDDEN,
196 'condition' => array(
197 'premium_video_box_video_type!' => 'self',
198 'premium_video_box_video_id_embed_selection' => 'id',
199 ),
200 )
201 );
202
203 $this->add_control(
204 'premium_video_box_video_embed',
205 array(
206 'label' => __( 'Embed URL', 'premium-addons-for-elementor' ),
207 'description' => __( 'Enter your YouTube/Vimeo video link. For example, https://www.youtube.com/watch?v=eRnPSnx8nPY', 'premium-addons-for-elementor' ),
208 'type' => Controls_Manager::HIDDEN,
209 'condition' => array(
210 'premium_video_box_video_type!' => 'self',
211 'premium_video_box_video_id_embed_selection' => 'embed',
212 ),
213 )
214 );
215
216 $this->add_control(
217 'youtube_list',
218 array(
219 'label' => __( 'Get Videos From Channel/Playlist', 'premium-addons-for-elementor' ),
220 'type' => Controls_Manager::SWITCHER,
221 'condition' => array(
222 'premium_video_box_video_type' => 'youtube',
223 ),
224 )
225 );
226
227 $this->add_responsive_control(
228 'source',
229 array(
230 'label' => __( 'Source', 'premium-addons-for-elementor' ),
231 'type' => Controls_Manager::SELECT,
232 'options' => array(
233 'playlist' => __( 'Playlist', 'premium-addons-for-elementor' ),
234 'channel' => __( 'Channel', 'premium-addons-for-elementor' ),
235 ),
236 'default' => 'playlist',
237 'condition' => array(
238 'premium_video_box_video_type' => 'youtube',
239 'youtube_list' => 'yes',
240 ),
241 )
242 );
243
244 $this->add_control(
245 'playlist_id',
246 array(
247 'label' => __( 'Playlist ID', 'premium-addons-for-elementor' ),
248 'type' => Controls_Manager::TEXT,
249 'default' => 'PLLpZVOYpMtTArB4hrlpSnDJB36D2sdoTv',
250 'label_block' => true,
251 'dynamic' => array( 'active' => true ),
252 'description' => 'Click <a href="https://premiumaddons.com/docs/how-to-find-youtube-channel-playlist-id/" target="_blank">here</a> to get your playlist ID',
253 'condition' => array(
254 'premium_video_box_video_type' => 'youtube',
255 'youtube_list' => 'yes',
256 'source' => 'playlist',
257 ),
258 'ai' => array(
259 'active' => false,
260 ),
261 )
262 );
263
264 $this->add_control(
265 'channel_id',
266 array(
267 'label' => __( 'Channel ID', 'premium-addons-for-elementor' ),
268 'type' => Controls_Manager::TEXT,
269 'default' => 'UCXcJ9BeO2sKKHor7Q9VglTQ',
270 'label_block' => true,
271 'dynamic' => array( 'active' => true ),
272 'description' => 'Click <a href="https://premiumaddons.com/docs/how-to-find-youtube-channel-playlist-id/" target="_blank">here</a> to get your channel ID',
273 'condition' => array(
274 'premium_video_box_video_type' => 'youtube',
275 'youtube_list' => 'yes',
276 'source' => 'channel',
277 ),
278 'ai' => array(
279 'active' => false,
280 ),
281 )
282 );
283
284 $this->add_control(
285 'reload',
286 array(
287 'label' => __( 'Reload Video Once Every', 'premium-addons-for-elementor' ),
288 'type' => Controls_Manager::SELECT,
289 'options' => array(
290 'hour' => __( 'Hour', 'premium-addons-for-elementor' ),
291 'day' => __( 'Day', 'premium-addons-for-elementor' ),
292 'week' => __( 'Week', 'premium-addons-for-elementor' ),
293 'month' => __( 'Month', 'premium-addons-for-elementor' ),
294 'year' => __( 'Year', 'premium-addons-for-elementor' ),
295 ),
296 'default' => 'day',
297 'condition' => array(
298 'premium_video_box_video_type' => 'youtube',
299 'youtube_list' => 'yes',
300 ),
301 )
302 );
303
304 $this->add_control(
305 'youtube_videos_title',
306 array(
307 'label' => __( 'Show Video Title', 'premium-addons-for-elementor' ),
308 'type' => Controls_Manager::SWITCHER,
309 'label_on' => __( 'Show', 'premium-addons-for-elementor' ),
310 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ),
311 'condition' => array(
312 'youtube_list' => 'yes',
313 'premium_video_box_video_type' => 'youtube',
314 ),
315 )
316 );
317
318 $this->add_control(
319 'youtube_videos_title_link',
320 array(
321 'label' => __( 'Link Title To Videos', 'premium-addons-for-elementor' ),
322 'type' => Controls_Manager::SWITCHER,
323 'condition' => array(
324 'youtube_list' => 'yes',
325 'youtube_videos_title' => 'yes',
326 'premium_video_box_video_type' => 'youtube',
327 ),
328 )
329 );
330
331 $this->add_control(
332 'youtube_videos_title_tag',
333 array(
334 'label' => __( 'Title HTML Tag', 'premium-addons-for-elementor' ),
335 'type' => Controls_Manager::SELECT,
336 'options' => array(
337 'h1' => 'H1',
338 'h2' => 'H2',
339 'h3' => 'H3',
340 'h4' => 'H4',
341 'h5' => 'H5',
342 'h6' => 'H6',
343 'span' => 'span',
344 'p' => 'p',
345 ),
346 'default' => 'h4',
347 'label_block' => true,
348 'condition' => array(
349 'youtube_list' => 'yes',
350 'youtube_videos_title' => 'yes',
351 'premium_video_box_video_type' => 'youtube',
352 ),
353 )
354 );
355
356 $this->add_control(
357 'youtube_videos_title_pos',
358 array(
359 'label' => __( 'Title Position', 'premium-addons-for-elementor' ),
360 'type' => Controls_Manager::SELECT,
361 'default' => 'column',
362 'options' => array(
363 'column-reverse' => __( 'Top', 'premium-addons-for-elementor' ),
364 'column' => __( 'Bottom', 'premium-addons-for-elementor' ),
365 ),
366 'condition' => array(
367 'youtube_list' => 'yes',
368 'youtube_videos_title' => 'yes',
369 'premium_video_box_video_type' => 'youtube',
370 ),
371 'selectors' => array(
372 '{{WRAPPER}} .premium-video-box-container' => 'flex-direction: {{VALUE}}',
373 ),
374 )
375 );
376
377 $this->add_control(
378 'premium_video_box_link',
379 array(
380 'label' => __( 'Link', 'premium-addons-for-elementor' ),
381 'type' => Controls_Manager::TEXT,
382 'label_block' => true,
383 'default' => 'https://www.youtube.com/watch?v=ydv343MTf4w',
384 'dynamic' => array(
385 'active' => true,
386 'categories' => array(
387 TagsModule::POST_META_CATEGORY,
388 TagsModule::URL_CATEGORY,
389 ),
390 ),
391 'conditions' => array(
392 'relation' => 'or',
393 'terms' => array(
394 array(
395 'name' => 'premium_video_box_video_type',
396 'value' => 'vimeo',
397 ),
398 array(
399 'name' => 'premium_video_box_video_type',
400 'value' => 'dailymotion',
401 ),
402 array(
403 'relation' => 'and',
404 'terms' => array(
405 array(
406 'name' => 'premium_video_box_video_type',
407 'value' => 'youtube',
408 ),
409 array(
410 'name' => 'youtube_list',
411 'value' => '',
412 ),
413 ),
414 ),
415 ),
416 ),
417 'ai' => array(
418 'active' => false,
419 ),
420 )
421 );
422
423 $this->add_responsive_control(
424 'playlist_layout',
425 array(
426 'label' => __( 'Layout', 'premium-addons-for-elementor' ),
427 'type' => Controls_Manager::SELECT,
428 'options' => array(
429 'layout1' => __( 'Layout 1', 'premium-addons-for-elementor' ),
430 'layout2' => __( 'Layout 2', 'premium-addons-for-elementor' ),
431 ),
432 'prefix_class' => 'premium-videobox-',
433 'default' => 'layout1',
434 'render_type' => 'template',
435 'condition' => array(
436 'premium_video_box_video_type' => 'youtube',
437 'youtube_list' => 'yes',
438 ),
439 )
440 );
441
442 $this->add_responsive_control(
443 'first_column_width',
444 array(
445 'label' => __( 'First Column Width', 'premium-addons-for-elementor' ),
446 'type' => Controls_Manager::SLIDER,
447 'render_type' => 'template',
448 'size_units' => array( '%' ),
449 'default' => array(
450 'size' => 60,
451 'unit' => '%',
452 ),
453 'range' => array(
454 '%' => array(
455 'min' => 0,
456 'max' => 100,
457 ),
458 ),
459 'condition' => array(
460 'youtube_list' => 'yes',
461 'premium_video_box_video_type' => 'youtube',
462 'playlist_layout' => 'layout2',
463 ),
464 'selectors' => array(
465 '{{WRAPPER}} .premium-videobox-column:first-child' => 'width: {{SIZE}}%;',
466 '{{WRAPPER}} .premium-videobox-column:nth-child(2)' => '--pa-first-column-width: {{SIZE}}%;',
467 ),
468
469 )
470 );
471
472 $this->add_responsive_control(
473 'premium_video_box_video_height',
474 array(
475 'label' => __( 'Video Height (%)', 'premium-addons-for-elementor' ),
476 'type' => Controls_Manager::SLIDER,
477 'render_type' => 'template',
478 'size_units' => array( '%' ),
479 'default' => array(
480 'size' => 32,
481 'unit' => '%',
482 ),
483 'range' => array(
484 '%' => array(
485 'min' => 0,
486 'max' => 100,
487 ),
488 ),
489 'condition' => array(
490 'youtube_list' => 'yes',
491 'premium_video_box_video_type' => 'youtube',
492 'playlist_layout' => 'layout1',
493 ),
494 'selectors' => array(
495 '{{WRAPPER}} .premium-video-box-container > div' => 'padding-bottom: {{SIZE}}%;',
496 ),
497
498 )
499 );
500
501 $this->add_responsive_control(
502 'video_columns',
503 array(
504 'label' => __( 'Videos/Row', 'premium-addons-for-elementor' ),
505 'type' => Controls_Manager::SELECT,
506 'options' => array(
507 '100%' => __( '1 Column', 'premium-addons-for-elementor' ),
508 '50%' => __( '2 Columns', 'premium-addons-for-elementor' ),
509 '33.33%' => __( '3 Columns', 'premium-addons-for-elementor' ),
510 '25%' => __( '4 Columns', 'premium-addons-for-elementor' ),
511 '20%' => __( '5 Columns', 'premium-addons-for-elementor' ),
512 '16.667%' => __( '6 Columns', 'premium-addons-for-elementor' ),
513 ),
514 'desktop_default' => '50%',
515 'tablet_default' => '50%',
516 'mobile_default' => '100%',
517 'render_type' => 'template',
518 'separator' => 'before',
519 'selectors' => array(
520 '{{WRAPPER}}.premium-videobox-layout1 .premium-video-box-container' => 'width: {{VALUE}}',
521 '{{WRAPPER}} .premium-videobox-column:nth-child(2) .premium-video-box-container' => 'width: {{VALUE}}',
522 ),
523 'condition' => array(
524 'premium_video_box_video_type' => 'youtube',
525 'youtube_list' => 'yes',
526 ),
527 )
528 );
529
530 $this->add_control(
531 'limit_num',
532 array(
533 'label' => __( 'Number of Videos', 'premium-addons-for-elementor' ),
534 'type' => Controls_Manager::NUMBER,
535 'min' => 0,
536 'default' => 6,
537 'description' => __( 'Set a number of videos to show', 'premium-addons-for-elementor' ),
538 'condition' => array(
539 'premium_video_box_video_type' => 'youtube',
540 'youtube_list' => 'yes',
541 ),
542 )
543 );
544
545 $this->add_control(
546 'featured_video',
547 array(
548 'label' => __( 'Feature The First Video', 'premium-addons-for-elementor' ),
549 'type' => Controls_Manager::SWITCHER,
550 'condition' => array(
551 'premium_video_box_video_type' => 'youtube',
552 'youtube_list' => 'yes',
553 'playlist_layout' => 'layout1',
554 ),
555 'selectors' => array(
556 '{{WRAPPER}} .premium-video-box-container:first-of-type' => 'width: 100%',
557 ),
558 )
559 );
560
561 $this->add_control(
562 'premium_video_box_self_hosted',
563 array(
564 'label' => __( 'URL', 'premium-addons-for-elementor' ),
565 'type' => Controls_Manager::MEDIA,
566 'dynamic' => array(
567 'active' => true,
568 'categories' => array(
569 TagsModule::MEDIA_CATEGORY,
570 ),
571 ),
572 'media_type' => 'video',
573 'condition' => array(
574 'premium_video_box_video_type' => 'self',
575 ),
576 )
577 );
578
579 $this->add_control(
580 'premium_video_box_self_hosted_remote',
581 array(
582 'label' => __( 'Remote Video URL', 'premium-addons-for-elementor' ),
583 'type' => Controls_Manager::TEXT,
584 'dynamic' => array(
585 'active' => true,
586 ),
587 'label_block' => true,
588 'condition' => array(
589 'premium_video_box_video_type' => 'self',
590 ),
591 'ai' => array(
592 'active' => false,
593 ),
594 )
595 );
596
597 $playlist_condition = array(
598 'relation' => 'or',
599 'terms' => array(
600 array(
601 'name' => 'premium_video_box_video_type',
602 'operator' => '!==',
603 'value' => 'youtube',
604 ),
605 array(
606 'name' => 'youtube_list',
607 'value' => '',
608 ),
609 ),
610 );
611
612 $this->add_control(
613 'premium_video_box_controls',
614 array(
615 'label' => __( 'Player Controls', 'premium-addons-for-elementor' ),
616 'type' => Controls_Manager::SWITCHER,
617 'description' => __( 'Show/hide player controls', 'premium-addons-for-elementor' ),
618 'default' => 'yes',
619 'conditions' => array(
620 'terms' => array(
621 $playlist_condition,
622 ),
623 ),
624 )
625 );
626
627 $this->add_control(
628 'premium_video_box_mute',
629 array(
630 'label' => __( 'Mute', 'premium-addons-for-elementor' ),
631 'type' => Controls_Manager::SWITCHER,
632 'description' => __( 'This will play the video muted', 'premium-addons-for-elementor' ),
633 )
634 );
635
636 $this->add_control(
637 'play_inline',
638 array(
639 'label' => __( 'Play Inline', 'premium-addons-for-elementor' ),
640 'type' => Controls_Manager::SWITCHER,
641 'description' => __( 'Enable this option to play the video in its position, not in popup on touch devices.', 'premium-addons-for-elementor' ),
642 )
643 );
644
645 $this->add_control(
646 'cc_load_policy',
647 array(
648 'label' => esc_html__( 'Captions', 'premium-addons-for-elementor' ),
649 'type' => Controls_Manager::SWITCHER,
650 'condition' => array(
651 'premium_video_box_controls' => 'yes',
652 'premium_video_box_video_type' => 'youtube',
653 ),
654 )
655 );
656
657 $this->add_control(
658 'privacy_mode',
659 array(
660 'label' => __( 'Privacy Mode', 'premium-addons-for-elementor' ),
661 'type' => Controls_Manager::SWITCHER,
662 'description' => __( 'When turned on, YouTube won\'t store information about visitors on your website unless they play the video.', 'premium-addons-for-elementor' ),
663 'condition' => array(
664 'premium_video_box_video_type' => 'youtube',
665 ),
666 )
667 );
668
669 $this->add_control(
670 'premium_video_box_self_autoplay',
671 array(
672 'label' => __( 'Autoplay', 'premium-addons-for-elementor' ),
673 'type' => Controls_Manager::SWITCHER,
674 'conditions' => array(
675 'terms' => array(
676 $playlist_condition,
677
678 ),
679 ),
680 )
681 );
682
683 $this->add_control(
684 'autoplay_viewport',
685 array(
686 'label' => __( 'Autoplay On Viewport', 'premium-addons-for-elementor' ),
687 'type' => Controls_Manager::SWITCHER,
688 'conditions' => array(
689 'terms' => array(
690 array(
691 'name' => 'premium_video_box_self_autoplay',
692 'value' => 'yes',
693 ),
694 $playlist_condition,
695 ),
696 ),
697 )
698 );
699
700 $this->add_control(
701 'autoplay_reset',
702 array(
703 'label' => __( 'Restart Video on Scroll Up', 'premium-addons-for-elementor' ),
704 'type' => Controls_Manager::SWITCHER,
705 'conditions' => array(
706 'terms' => array(
707 array(
708 'name' => 'premium_video_box_video_type',
709 'value' => 'self',
710 ),
711 array(
712 'name' => 'premium_video_box_self_autoplay',
713 'value' => 'yes',
714 ),
715 array(
716 'name' => 'autoplay_viewport',
717 'value' => 'yes',
718 ),
719 $playlist_condition,
720 ),
721 ),
722 )
723 );
724
725 $this->add_control(
726 'autoplay_notice',
727 array(
728 'raw' => __( 'Please note that autoplay option works only when Overlay option is disabled', 'premium-addons-for-elementor' ),
729 'type' => Controls_Manager::RAW_HTML,
730 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
731 'conditions' => array(
732 'terms' => array(
733 array(
734 'name' => 'premium_video_box_self_autoplay',
735 'value' => 'yes',
736 ),
737 $playlist_condition,
738 ),
739 ),
740 )
741 );
742
743 $this->add_control(
744 'premium_video_box_loop',
745 array(
746 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
747 'type' => Controls_Manager::SWITCHER,
748 'condition' => array(
749 'youtube_list!' => 'yes',
750 ),
751 )
752 );
753
754 $this->add_control(
755 'download_button',
756 array(
757 'label' => __( 'Download Button', 'premium-addons-for-elementor' ),
758 'type' => Controls_Manager::SWITCHER,
759 'condition' => array(
760 'premium_video_box_video_type' => 'self',
761 ),
762 )
763 );
764
765 $this->add_control(
766 'premium_video_box_sticky_switcher',
767 array(
768 'label' => __( 'Sticky', 'premium-addons-for-elementor' ),
769 'type' => Controls_Manager::SWITCHER,
770 'render_type' => 'template',
771 'separator' => 'before',
772 'conditions' => array(
773 'terms' => array(
774 $playlist_condition,
775 ),
776 ),
777 )
778 );
779
780 $sticky_condition = array(
781 'terms' => array(
782 array(
783 'name' => 'premium_video_box_sticky_switcher',
784 'value' => 'yes',
785 ),
786 $playlist_condition,
787 ),
788 );
789
790 $this->add_control(
791 'premium_video_box_sticky_on_play',
792 array(
793 'label' => __( 'Sticky Only After Played', 'premium-addons-for-elementor' ),
794 'type' => Controls_Manager::SWITCHER,
795 'render_type' => 'template',
796 'conditions' => array(
797 'terms' => array(
798 $sticky_condition,
799 ),
800 ),
801 )
802 );
803
804 $left_direction = is_rtl() ? 'right' : 'left';
805
806 $right_direction = is_rtl() ? 'left' : 'right';
807
808 $this->add_control(
809 'premium_video_box_sticky_position',
810 array(
811 'label' => __( 'Position', 'premium-addons-for-elementor' ),
812 'type' => Controls_Manager::SELECT,
813 'options' => array(
814 /* translators: %s: horizontal direction (Left/Right). */
815 'top-left' => sprintf( __( 'Top %s', 'premium-addons-for-elementor' ), ucfirst( $left_direction ) ),
816 /* translators: %s: horizontal direction (Left/Right). */
817 'top-right' => sprintf( __( 'Top %s', 'premium-addons-for-elementor' ), ucfirst( $right_direction ) ),
818 /* translators: %s: horizontal direction (Left/Right). */
819 'bottom-left' => sprintf( __( 'Bottom %s', 'premium-addons-for-elementor' ), ucfirst( $left_direction ) ),
820 /* translators: %s: horizontal direction (Left/Right). */
821 'bottom-right' => sprintf( __( 'Bottom %s', 'premium-addons-for-elementor' ), ucfirst( $right_direction ) ),
822 /* translators: %s: horizontal direction (Left/Right). */
823 'center-left' => sprintf( __( 'Center %s', 'premium-addons-for-elementor' ), ucfirst( $left_direction ) ),
824 /* translators: %s: horizontal direction (Left/Right). */
825 'center-right' => sprintf( __( 'Center %s', 'premium-addons-for-elementor' ), ucfirst( $right_direction ) ),
826 ),
827 'default' => 'bottom-left',
828 'conditions' => $sticky_condition,
829 'prefix_class' => 'premium-video-sticky-',
830 'render_type' => 'template',
831 )
832 );
833
834 $this->add_control(
835 'premium_video_box_sticky_hide',
836 array(
837 'label' => __( 'Disable Sticky On', 'premium-addons-for-elementor' ),
838 'type' => Controls_Manager::SELECT2,
839 'multiple' => true,
840 'label_block' => true,
841 'options' => array(
842 'desktop' => __( 'Desktop', 'premium-addons-for-elementor' ),
843 'tablet' => __( 'Tablet', 'premium-addons-for-elementor' ),
844 'mobile' => __( 'Mobile', 'premium-addons-for-elementor' ),
845 ),
846 'conditions' => $sticky_condition,
847 'render_type' => 'template',
848 'frontend_available' => true,
849 )
850 );
851
852 $this->add_control(
853 'premium_video_box_animation',
854 array(
855 'label' => __( 'Entrance Animation', 'premium-addons-for-elementor' ),
856 'type' => Controls_Manager::ANIMATION,
857 'label_block' => true,
858 'frontend_available' => true,
859 'render_type' => 'template',
860 'conditions' => $sticky_condition,
861 )
862 );
863
864 $this->add_control(
865 'premium_video_box_animation_duration',
866 array(
867 'label' => __( 'Animation Duration', 'premium-addons-for-elementor' ),
868 'type' => Controls_Manager::SELECT,
869 'default' => '',
870 'options' => array(
871 'slow' => __( 'Slow', 'premium-addons-for-elementor' ),
872 '' => __( 'Normal', 'premium-addons-for-elementor' ),
873 'fast' => __( 'Fast', 'premium-addons-for-elementor' ),
874 ),
875 'conditions' => array(
876 'terms' => array(
877 array(
878 'name' => 'premium_video_box_animation',
879 'operator' => '!==',
880 'value' => '',
881 ),
882 array(
883 'name' => 'premium_video_box_sticky_switcher',
884 'value' => 'yes',
885 ),
886 $playlist_condition,
887 ),
888 ),
889 )
890 );
891
892 $this->add_control(
893 'premium_video_box_animation_delay',
894 array(
895 'label' => __( 'Animation Delay', 'premium-addons-for-elementor' ) . ' (s)',
896 'type' => Controls_Manager::NUMBER,
897 'default' => '',
898 'step' => 0.1,
899 'conditions' => array(
900 'terms' => array(
901 array(
902 'name' => 'premium_video_box_animation',
903 'operator' => '!==',
904 'value' => '',
905 ),
906 array(
907 'name' => 'premium_video_box_sticky_switcher',
908 'value' => 'yes',
909 ),
910 $playlist_condition,
911 ),
912 ),
913 'frontend_available' => true,
914 )
915 );
916
917 $this->add_control(
918 'sticky_info_bar_switch',
919 array(
920 'label' => __( 'Info Section', 'premium-addons-for-elementor' ),
921 'type' => Controls_Manager::SWITCHER,
922 'conditions' => $sticky_condition,
923 )
924 );
925
926 $this->add_control(
927 'sticky_info_bar_text',
928 array(
929 'label' => __( 'Text', 'premium-addons-for-elementor' ),
930 'type' => Controls_Manager::TEXTAREA,
931 'default' => __( 'Watching: Sticky Video', 'premium-addons-for-elementor' ),
932 'rows' => 2,
933 'dynamic' => array(
934 'active' => true,
935 ),
936 'conditions' =>
937 array(
938 'terms' => array(
939 array(
940 'name' => 'premium_video_box_sticky_switcher',
941 'value' => 'yes',
942 ),
943 array(
944 'name' => 'sticky_info_bar_switch',
945 'value' => 'yes',
946 ),
947 $playlist_condition,
948 ),
949 ),
950 )
951 );
952
953 $this->add_control(
954 'premium_video_box_start',
955 array(
956 'label' => __( 'Start Time', 'premium-addons-for-elementor' ),
957 'type' => Controls_Manager::NUMBER,
958 'separator' => 'before',
959 'dynamic' => array(
960 'active' => true,
961 ),
962 'description' => __( 'Specify a start time (in seconds)', 'premium-addons-for-elementor' ),
963 'condition' => array(
964 'premium_video_box_video_type!' => 'vimeo',
965 ),
966 )
967 );
968
969 $this->add_control(
970 'premium_video_box_end',
971 array(
972 'label' => __( 'End Time', 'premium-addons-for-elementor' ),
973 'type' => Controls_Manager::NUMBER,
974 'description' => __( 'Specify an end time (in seconds)', 'premium-addons-for-elementor' ),
975 'separator' => 'after',
976 'dynamic' => array(
977 'active' => true,
978 ),
979 'condition' => array(
980 'premium_video_box_video_type!' => array( 'vimeo', 'dailymotion' ),
981 ),
982 )
983 );
984
985 $this->add_control(
986 'premium_video_box_suggested_videos',
987 array(
988 'label' => __( 'Suggested Videos From', 'premium-addons-for-elementor' ),
989 'type' => Controls_Manager::SELECT,
990 'options' => array(
991 '' => __( 'Current Channel', 'premium-addons-for-elementor' ),
992 'yes' => __( 'Any Channel', 'premium-addons-for-elementor' ),
993 ),
994 'condition' => array(
995 'premium_video_box_video_type' => 'youtube',
996 ),
997 )
998 );
999
1000 $this->add_control(
1001 'vimeo_controls_color',
1002 array(
1003 'label' => __( 'Controls Color', 'premium-addons-for-elementor' ),
1004 'type' => Controls_Manager::COLOR,
1005 'selectors' => array(
1006 '{{WRAPPER}} .premium-video-box-vimeo-title a, {{WRAPPER}} .premium-video-box-vimeo-byline a, {{WRAPPER}} .premium-video-box-vimeo-title a:hover, {{WRAPPER}} .premium-video-box-vimeo-byline a:hover, {{WRAPPER}} .premium-video-box-vimeo-title a:focus, {{WRAPPER}} .premium-video-box-vimeo-byline a:focus' => 'color: {{VALUE}}',
1007 ),
1008 'render_type' => 'template',
1009 'condition' => array(
1010 'premium_video_box_video_type' => 'vimeo',
1011 ),
1012 )
1013 );
1014
1015 $this->add_control(
1016 'vimeo_title',
1017 array(
1018 'label' => __( 'Intro Title', 'premium-addons-for-elementor' ),
1019 'type' => Controls_Manager::SWITCHER,
1020 'label_on' => __( 'Show', 'premium-addons-for-elementor' ),
1021 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ),
1022 'default' => 'yes',
1023 'condition' => array(
1024 'premium_video_box_video_type' => 'vimeo',
1025 ),
1026 )
1027 );
1028
1029 $this->add_control(
1030 'vimeo_portrait',
1031 array(
1032 'label' => __( 'Intro Portrait', 'premium-addons-for-elementor' ),
1033 'type' => Controls_Manager::SWITCHER,
1034 'label_on' => __( 'Show', 'premium-addons-for-elementor' ),
1035 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ),
1036 'default' => 'yes',
1037 'condition' => array(
1038 'premium_video_box_video_type' => 'vimeo',
1039 ),
1040 )
1041 );
1042
1043 $this->add_control(
1044 'vimeo_byline',
1045 array(
1046 'label' => __( 'Intro Byline', 'premium-addons-for-elementor' ),
1047 'type' => Controls_Manager::SWITCHER,
1048 'label_on' => __( 'Show', 'premium-addons-for-elementor' ),
1049 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ),
1050 'default' => 'yes',
1051 'condition' => array(
1052 'premium_video_box_video_type' => 'vimeo',
1053 ),
1054 )
1055 );
1056
1057 // dailymotion specific.
1058
1059 $this->add_control(
1060 'dailymotion_logo',
1061 array(
1062 'label' => __( 'Show Logo', 'premium-addons-for-elementor' ),
1063 'type' => Controls_Manager::SWITCHER,
1064 'label_on' => __( 'Show', 'premium-addons-for-elementor' ),
1065 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ),
1066 'condition' => array(
1067 'premium_video_box_video_type' => 'dailymotion',
1068 ),
1069 )
1070 );
1071
1072 $this->add_control(
1073 'dailymotion_info',
1074 array(
1075 'label' => __( 'Video Info', 'premium-addons-for-elementor' ),
1076 'type' => Controls_Manager::SWITCHER,
1077 'label_on' => __( 'Show', 'premium-addons-for-elementor' ),
1078 'label_off' => __( 'Hide', 'premium-addons-for-elementor' ),
1079 'condition' => array(
1080 'premium_video_box_video_type' => 'dailymotion',
1081 ),
1082 )
1083 );
1084
1085 $this->add_control(
1086 'dm_controls_color',
1087 array(
1088 'label' => __( 'Controls Color', 'premium-addons-for-elementor' ),
1089 'type' => Controls_Manager::COLOR,
1090 'condition' => array(
1091 'premium_video_box_video_type' => 'dailymotion',
1092 ),
1093 )
1094 );
1095
1096 $this->add_control(
1097 'aspect_ratio',
1098 array(
1099 'label' => __( 'Aspect Ratio', 'premium-addons-for-elementor' ),
1100 'type' => Controls_Manager::SELECT,
1101 'options' => array(
1102 '169' => '16:9',
1103 '219' => '21:9',
1104 '43' => '4:3',
1105 '32' => '3:2',
1106 '11' => '1:1',
1107 '916' => '9:16',
1108 ),
1109 'selectors_dictionary' => array(
1110 '169' => '1.77777', // 16 / 9
1111 '219' => '2.33333', // 21 / 9
1112 '43' => '1.33333', // 4 / 3
1113 '32' => '1.5', // 3 / 2
1114 '11' => '1', // 1 / 1
1115 '916' => '0.5625', // 9 / 16
1116 ),
1117 'default' => '169',
1118 'selectors' => array(
1119 '{{WRAPPER}} .premium-video-box-container > div' => 'aspect-ratio: {{VALUE}}',
1120 ),
1121 'frontend_available' => true,
1122 )
1123 );
1124
1125 $this->add_responsive_control(
1126 'object_fit',
1127 array(
1128 'label' => __( 'Object Fit', 'premium-addons-for-elementor' ),
1129 'type' => Controls_Manager::SELECT,
1130 'options' => array(
1131 '' => __( 'Default', 'premium-addons-for-elementor' ),
1132 'fill' => __( 'Fill', 'premium-addons-for-elementor' ),
1133 'cover' => __( 'Cover', 'premium-addons-for-elementor' ),
1134 'contain' => __( 'Contain', 'premium-addons-for-elementor' ),
1135 ),
1136 'default' => 'contain',
1137 'selectors' => array(
1138 '{{WRAPPER}} .premium-video-box-video-container video' => 'object-fit: {{VALUE}};',
1139 ),
1140 'condition' => array(
1141 'premium_video_box_video_type' => 'self',
1142 ),
1143 )
1144 );
1145
1146 $this->add_control(
1147 'premium_video_box_image_switcher',
1148 array(
1149 'label' => __( 'Overlay', 'premium-addons-for-elementor' ),
1150 'type' => Controls_Manager::SWITCHER,
1151 'default' => 'yes',
1152 'conditions' => array(
1153 'terms' => array(
1154 $playlist_condition,
1155 ),
1156 ),
1157 )
1158 );
1159
1160 $this->add_control(
1161 'premium_video_box_yt_thumbnail_size',
1162 array(
1163 'label' => __( 'Thumbnail Size', 'premium-addons-for-elementor' ),
1164 'type' => Controls_Manager::SELECT,
1165 'options' => array(
1166 'maxresdefault' => __( 'Maximum Resolution', 'premium-addons-for-elementor' ),
1167 'hqdefault' => __( 'High Quality', 'premium-addons-for-elementor' ),
1168 'mqdefault' => __( 'Medium Quality', 'premium-addons-for-elementor' ),
1169 'sddefault' => __( 'Standard Quality', 'premium-addons-for-elementor' ),
1170 ),
1171 'default' => 'maxresdefault',
1172 'conditions' => array(
1173 'terms' => array(
1174 array(
1175 'name' => 'premium_video_box_video_type',
1176 'value' => 'youtube',
1177 ),
1178 array(
1179 'relation' => 'or',
1180 'terms' => array(
1181 array(
1182 'name' => 'premium_video_box_image_switcher',
1183 'value' => '',
1184 ),
1185 array(
1186 'name' => 'youtube_list',
1187 'value' => 'yes',
1188 ),
1189 ),
1190 ),
1191 ),
1192 ),
1193 'render_type' => 'template',
1194 )
1195 );
1196
1197 $this->add_control(
1198 'premium_video_box_img_effect',
1199 array(
1200 'label' => __( 'Hover Effect', 'premium-addons-for-elementor' ),
1201 'type' => Controls_Manager::SELECT,
1202 'description' => __( 'Choose a hover effect for the image', 'premium-addons-for-elementor' ),
1203 'options' => array(
1204 'none' => __( 'None', 'premium-addons-for-elementor' ),
1205 'zoomin' => __( 'Zoom In', 'premium-addons-for-elementor' ),
1206 'zoomout' => __( 'Zoom Out', 'premium-addons-for-elementor' ),
1207 'scale' => __( 'Scale', 'premium-addons-for-elementor' ),
1208 'gray' => __( 'Grayscale', 'premium-addons-for-elementor' ),
1209 'blur' => __( 'Blur', 'premium-addons-for-elementor' ),
1210 'bright' => __( 'Bright', 'premium-addons-for-elementor' ),
1211 'sepia' => __( 'Sepia', 'premium-addons-for-elementor' ),
1212 'trans' => __( 'Translate', 'premium-addons-for-elementor' ),
1213 ),
1214 'default' => 'none',
1215 'label_block' => true,
1216 )
1217 );
1218
1219 $this->add_control(
1220 'mask_video_box_switcher',
1221 array(
1222 'label' => __( 'Mask Video Shape', 'premium-addons-for-elementor' ),
1223 'type' => Controls_Manager::SWITCHER,
1224 'separator' => 'before',
1225 )
1226 );
1227
1228 $this->add_control(
1229 'mask_shape_video_box',
1230 array(
1231 'label' => __( 'Mask Image', 'premium-addons-for-elementor' ),
1232 'type' => Controls_Manager::MEDIA,
1233 'default' => array(
1234 'url' => '',
1235 ),
1236 'description' => __( 'Use PNG image with the shape you want to mask around feature video.', 'premium-addons-for-elementor' ),
1237 'selectors' => array(
1238 '{{WRAPPER}} .premium-video-box-mask-media ' => 'mask-image: url("{{URL}}");-webkit-mask-image: url("{{URL}}")',
1239 ),
1240 'condition' => array(
1241 'mask_video_box_switcher' => 'yes',
1242 ),
1243 )
1244 );
1245
1246 $this->add_control(
1247 'mask_size',
1248 array(
1249 'label' => __( 'Mask Size', 'premium-addons-for-elementor' ),
1250 'type' => Controls_Manager::SELECT,
1251 'options' => array(
1252 'contain' => __( 'Contain', 'premium-addons-for-elementor' ),
1253 'cover' => __( 'Cover', 'premium-addons-for-elementor' ),
1254 ),
1255 'default' => 'contain',
1256 'selectors' => array(
1257 '{{WRAPPER}} .premium-video-box-mask-media' => 'mask-size: {{VALUE}};-webkit-mask-size: {{VALUE}};',
1258 ),
1259 'condition' => array(
1260 'mask_video_box_switcher' => 'yes',
1261 ),
1262 )
1263 );
1264
1265 $this->add_control(
1266 'mask_position_cover',
1267 array(
1268 'label' => __( 'Mask Position', 'premium-addons-for-elementor' ),
1269 'type' => Controls_Manager::SELECT,
1270 'options' => array(
1271 'center center' => __( 'Center Center', 'premium-addons-for-elementor' ),
1272 'center left' => __( 'Center Left', 'premium-addons-for-elementor' ),
1273 'center right' => __( 'Center Right', 'premium-addons-for-elementor' ),
1274 'top center' => __( 'Top Center', 'premium-addons-for-elementor' ),
1275 'top left' => __( 'Top Left', 'premium-addons-for-elementor' ),
1276 'top right' => __( 'Top Right', 'premium-addons-for-elementor' ),
1277 'bottom center' => __( 'Bottom Center', 'premium-addons-for-elementor' ),
1278 'bottom left' => __( 'Bottom Left', 'premium-addons-for-elementor' ),
1279 'bottom right' => __( 'Bottom Right', 'premium-addons-for-elementor' ),
1280 ),
1281 'default' => 'center center',
1282 'selectors' => array(
1283 '{{WRAPPER}} .premium-video-box-mask-media' => 'mask-position: {{VALUE}}; -webkit-mask-position: {{VALUE}}',
1284 ),
1285 'condition' => array(
1286 'mask_video_box_switcher' => 'yes',
1287 'mask_size' => 'cover',
1288 ),
1289 )
1290 );
1291
1292 $this->add_control(
1293 'mask_position_contain',
1294 array(
1295 'label' => __( 'Mask Position', 'premium-addons-for-elementor' ),
1296 'type' => Controls_Manager::SELECT,
1297 'options' => array(
1298 'center center' => __( 'Center Center', 'premium-addons-for-elementor' ),
1299 'top center' => __( 'Top Center', 'premium-addons-for-elementor' ),
1300 'bottom center' => __( 'Bottom Center', 'premium-addons-for-elementor' ),
1301 ),
1302 'default' => 'center center',
1303 'selectors' => array(
1304 '{{WRAPPER}} .premium-video-box-mask-media' => 'mask-position: {{VALUE}}; -webkit-mask-position: {{VALUE}}',
1305 ),
1306 'condition' => array(
1307 'mask_video_box_switcher' => 'yes',
1308 'mask_size' => 'contain',
1309 ),
1310 )
1311 );
1312
1313 $this->add_control(
1314 'video_box_shadow',
1315 array(
1316 'label' => __( 'Mask Shadow', 'premium-addons-for-elementor' ),
1317 'type' => Controls_Manager::POPOVER_TOGGLE,
1318 'condition' => array(
1319 'mask_video_box_switcher' => 'yes',
1320 ),
1321 'return_value' => 'yes',
1322 'render_type' => 'template',
1323 )
1324 );
1325
1326 $this->start_popover();
1327
1328 $this->add_control(
1329 'video_box_shadow_color',
1330 array(
1331 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1332 'type' => Controls_Manager::COLOR,
1333 'default' => 'rgba(0,0,0,0.5)',
1334 )
1335 );
1336
1337 $this->add_control(
1338 'video_box_shadow_h',
1339 array(
1340 'label' => __( 'Horizontal', 'premium-addons-for-elementor' ),
1341 'type' => Controls_Manager::SLIDER,
1342 'range' => array(
1343 'px' => array(
1344 'min' => 0,
1345 'max' => 100,
1346 'step' => 1,
1347 ),
1348 ),
1349 'default' => array(
1350 'size' => 0,
1351 'unit' => 'px',
1352 ),
1353 )
1354 );
1355
1356 $this->add_control(
1357 'video_box_shadow_v',
1358 array(
1359 'label' => __( 'Vertical', 'premium-addons-for-elementor' ),
1360 'type' => Controls_Manager::SLIDER,
1361 'range' => array(
1362 'px' => array(
1363 'min' => 0,
1364 'max' => 100,
1365 'step' => 1,
1366 ),
1367 ),
1368 'default' => array(
1369 'size' => 0,
1370 'unit' => 'px',
1371 ),
1372 )
1373 );
1374
1375 $this->add_control(
1376 'video_box_shadow_blur',
1377 array(
1378 'label' => __( 'Blur', 'premium-addons-for-elementor' ),
1379 'type' => Controls_Manager::SLIDER,
1380 'range' => array(
1381 'px' => array(
1382 'min' => 0,
1383 'max' => 100,
1384 'step' => 1,
1385 ),
1386 ),
1387 'default' => array(
1388 'size' => 10,
1389 'unit' => 'px',
1390 ),
1391 'selectors' => array(
1392 '{{WRAPPER}} .premium-video-box-mask-filter' => 'filter: drop-shadow({{video_box_shadow_h.SIZE}}px {{video_box_shadow_v.SIZE}}px {{SIZE}}px {{video_box_shadow_color.VALUE}})',
1393 ),
1394 )
1395 );
1396
1397 $this->end_popover();
1398
1399 $this->add_control(
1400 'video_lightbox',
1401 array(
1402 'label' => __( 'Lightbox', 'premium-addons-for-elementor' ),
1403 'type' => Controls_Manager::SWITCHER,
1404 'separator' => 'before',
1405 'condition' => array(
1406 'premium_video_box_self_autoplay!' => 'yes',
1407 'premium_video_box_sticky_switcher!' => 'yes',
1408 ),
1409 )
1410 );
1411
1412 $this->add_control(
1413 'video_lightbox_style',
1414 array(
1415 'label' => __( 'Lightbox Style', 'premium-addons-for-elementor' ),
1416 'type' => Controls_Manager::SELECT,
1417 'default' => 'elementor',
1418 'frontend_available' => true,
1419 'options' => array(
1420 'elementor' => __( 'Elementor Lightbox', 'premium-addons-for-elementor' ),
1421 'prettyphoto' => __( 'PrettyPhoto', 'premium-addons-for-elementor' ),
1422 ),
1423 'condition' => array(
1424 'video_lightbox' => 'yes',
1425 'premium_video_box_self_autoplay!' => 'yes',
1426 'premium_video_box_video_type!' => 'dailymotion',
1427 'premium_video_box_sticky_switcher!' => 'yes',
1428 ),
1429 )
1430 );
1431
1432 $this->add_control(
1433 'video_lightbox_theme',
1434 array(
1435 'label' => __( 'Lightbox Theme', 'premium-addons-for-elementor' ),
1436 'type' => Controls_Manager::SELECT,
1437 'options' => array(
1438 'pp_default' => __( 'Default', 'premium-addons-for-elementor' ),
1439 'light_rounded' => __( 'Light Rounded', 'premium-addons-for-elementor' ),
1440 'dark_rounded' => __( 'Dark Rounded', 'premium-addons-for-elementor' ),
1441 'light_square' => __( 'Light Square', 'premium-addons-for-elementor' ),
1442 'dark_square' => __( 'Dark Square', 'premium-addons-for-elementor' ),
1443 'facebook' => __( 'Facebook', 'premium-addons-for-elementor' ),
1444 ),
1445 'default' => 'pp_default',
1446 'conditions' => array(
1447 'terms' => array(
1448 array(
1449 'name' => 'video_lightbox',
1450 'value' => 'yes',
1451 ),
1452 array(
1453 'name' => 'premium_video_box_self_autoplay',
1454 'operator' => '!=',
1455 'value' => 'yes',
1456 ),
1457 array(
1458 'name' => 'premium_video_box_sticky_switcher',
1459 'operator' => '!=',
1460 'value' => 'yes',
1461 ),
1462 array(
1463 'relation' => 'or',
1464 'terms' => array(
1465 array(
1466 'name' => 'premium_video_box_video_type',
1467 'value' => 'dailymotion',
1468 ),
1469 array(
1470 'name' => 'video_lightbox_style',
1471 'value' => 'prettyphoto',
1472 ),
1473 ),
1474 ),
1475 ),
1476 ),
1477 )
1478 );
1479
1480 $this->end_controls_section();
1481
1482 $this->start_controls_section(
1483 'premium_video_box_image_settings',
1484 array(
1485 'label' => __( 'Overlay', 'premium-addons-for-elementor' ),
1486 'conditions' => array(
1487 'terms' => array(
1488 array(
1489 'name' => 'premium_video_box_image_switcher',
1490 'value' => 'yes',
1491 ),
1492 $playlist_condition,
1493 ),
1494 ),
1495 )
1496 );
1497
1498 $this->add_control(
1499 'premium_video_box_image',
1500 array(
1501 'label' => __( 'Image', 'premium-addons-for-elementor' ),
1502 'description' => __( 'Choose an image for the video box', 'premium-addons-for-elementor' ),
1503 'type' => Controls_Manager::MEDIA,
1504 'dynamic' => array( 'active' => true ),
1505 'label_block' => true,
1506 )
1507 );
1508
1509 $this->end_controls_section();
1510
1511 $this->start_controls_section(
1512 'premium_video_box_play_icon_settings',
1513 array(
1514 'label' => __( 'Play Icon', 'premium-addons-for-elementor' ),
1515 )
1516 );
1517
1518 $this->add_control(
1519 'premium_video_box_play_icon_switcher',
1520 array(
1521 'label' => __( 'Play Icon', 'premium-addons-for-elementor' ),
1522 'type' => Controls_Manager::SWITCHER,
1523 'default' => 'yes',
1524 )
1525 );
1526
1527 $this->add_responsive_control(
1528 'premium_video_box_icon_hor_position',
1529 array(
1530 'label' => __( 'Horizontal Position', 'premium-addons-for-elementor' ),
1531 'type' => Controls_Manager::SLIDER,
1532 'size_units' => array( 'px', 'em', '%' ),
1533 'label_block' => true,
1534 'default' => array(
1535 'size' => 50,
1536 'unit' => '%',
1537 ),
1538 'range' => array(
1539 'px' => array(
1540 'min' => 1,
1541 'max' => 500,
1542 ),
1543 'em' => array(
1544 'min' => 1,
1545 'max' => 50,
1546 ),
1547 ),
1548 'condition' => array(
1549 'premium_video_box_play_icon_switcher' => 'yes',
1550 ),
1551 'selectors' => array(
1552 '{{WRAPPER}} .premium-video-box-play-icon-container' => $left_direction . ': {{SIZE}}{{UNIT}};',
1553 ),
1554 )
1555 );
1556
1557 $this->add_responsive_control(
1558 'premium_video_box_icon_ver_position',
1559 array(
1560 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ),
1561 'type' => Controls_Manager::SLIDER,
1562 'size_units' => array( 'px', 'em', '%' ),
1563 'label_block' => true,
1564 'default' => array(
1565 'size' => 50,
1566 'unit' => '%',
1567 ),
1568 'range' => array(
1569 'px' => array(
1570 'min' => 1,
1571 'max' => 500,
1572 ),
1573 'em' => array(
1574 'min' => 1,
1575 'max' => 50,
1576 ),
1577 ),
1578 'condition' => array(
1579 'premium_video_box_play_icon_switcher' => 'yes',
1580 ),
1581 'selectors' => array(
1582 '{{WRAPPER}} .premium-video-box-play-icon-container' => 'top: {{SIZE}}{{UNIT}};',
1583 ),
1584 )
1585 );
1586
1587 $this->add_control(
1588 'play_glow_effect',
1589 array(
1590 'label' => __( 'Glow Effect Type', 'premium-addons-for-elementor' ),
1591 'type' => Controls_Manager::SELECT,
1592 'options' => array(
1593 'none' => __( 'None', 'premium-addons-for-elementor' ),
1594 'ripple' => __( 'Ripple', 'premium-addons-for-elementor' ),
1595 'radio' => __( 'Radio Wave', 'premium-addons-for-elementor' ),
1596 ),
1597 'default' => 'none',
1598 'prefix_class' => 'premium-video__glow-',
1599 'condition' => array(
1600 'premium_video_box_play_icon_switcher' => 'yes',
1601 ),
1602 )
1603 );
1604
1605 $this->end_controls_section();
1606
1607 $this->start_controls_section(
1608 'premium_video_box_description_text_section',
1609 array(
1610 'label' => __( 'Description', 'premium-addons-for-elementor' ),
1611 'conditions' => array(
1612 'terms' => array(
1613 $playlist_condition,
1614 ),
1615 ),
1616 )
1617 );
1618
1619 $this->add_control(
1620 'premium_video_box_video_text_switcher',
1621 array(
1622 'label' => __( 'Video Text', 'premium-addons-for-elementor' ),
1623 'type' => Controls_Manager::SWITCHER,
1624 )
1625 );
1626
1627 $this->add_control(
1628 'premium_video_box_description_text',
1629 array(
1630 'label' => __( 'Text', 'premium-addons-for-elementor' ),
1631 'type' => Controls_Manager::TEXTAREA,
1632 'default' => __( 'Play Video', 'premium-addons-for-elementor' ),
1633 'condition' => array(
1634 'premium_video_box_video_text_switcher' => 'yes',
1635 ),
1636 'dynamic' => array( 'active' => true ),
1637 'label_block' => true,
1638 )
1639 );
1640
1641 $this->add_responsive_control(
1642 'premium_video_box_description_hor_position',
1643 array(
1644 'label' => __( 'Horizontal Position', 'premium-addons-for-elementor' ),
1645 'type' => Controls_Manager::SLIDER,
1646 'size_units' => array( 'px', 'em', '%' ),
1647 'label_block' => true,
1648 'default' => array(
1649 'size' => 50,
1650 'unit' => '%',
1651 ),
1652 'range' => array(
1653 'px' => array(
1654 'min' => 1,
1655 'max' => 500,
1656 ),
1657 'em' => array(
1658 'min' => 1,
1659 'max' => 50,
1660 ),
1661 ),
1662 'condition' => array(
1663 'premium_video_box_video_text_switcher' => 'yes',
1664 ),
1665 'selectors' => array(
1666 '{{WRAPPER}} .premium-video-box-description-container' => $left_direction . ': {{SIZE}}{{UNIT}};',
1667 ),
1668 )
1669 );
1670
1671 $this->add_responsive_control(
1672 'premium_video_box_description_ver_position',
1673 array(
1674 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ),
1675 'type' => Controls_Manager::SLIDER,
1676 'size_units' => array( 'px', 'em', '%' ),
1677 'label_block' => true,
1678 'default' => array(
1679 'size' => 60,
1680 'unit' => '%',
1681 ),
1682 'range' => array(
1683 'px' => array(
1684 'min' => 1,
1685 'max' => 500,
1686 ),
1687 'em' => array(
1688 'min' => 1,
1689 'max' => 50,
1690 ),
1691 ),
1692 'condition' => array(
1693 'premium_video_box_video_text_switcher' => 'yes',
1694 ),
1695 'selectors' => array(
1696 '{{WRAPPER}} .premium-video-box-description-container' => 'top: {{SIZE}}{{UNIT}};',
1697 ),
1698 )
1699 );
1700
1701 $this->end_controls_section();
1702
1703 $this->start_controls_section(
1704 'video_background',
1705 array(
1706 'label' => __( 'Background Image', 'premium-addons-for-elementor' ),
1707 'conditions' => array(
1708 'relation' => 'and',
1709 'terms' => array(
1710 array(
1711 'relation' => 'or',
1712 'terms' => array(
1713 array(
1714 'name' => 'premium_video_box_video_type',
1715 'operator' => '!==',
1716 'value' => 'youtube',
1717 ),
1718 array(
1719 'name' => 'youtube_list',
1720 'operator' => '!==',
1721 'value' => 'yes',
1722 ),
1723 ),
1724 ),
1725 ),
1726 ),
1727 )
1728 );
1729
1730 $this->add_control(
1731 'background_image',
1732 array(
1733 'label' => __( 'Select Image', 'premium-addons-for-elementor' ),
1734 'type' => Controls_Manager::MEDIA,
1735 'label_block' => true,
1736 )
1737 );
1738
1739 $this->add_responsive_control(
1740 'video_hor_position',
1741 array(
1742 'label' => __( 'Horizontal Position', 'premium-addons-for-elementor' ),
1743 'type' => Controls_Manager::SLIDER,
1744 'label_block' => true,
1745 'default' => array(
1746 'size' => 5,
1747 'unit' => '%',
1748 ),
1749 'condition' => array(
1750 'background_image[url]!' => '',
1751 ),
1752 'selectors' => array(
1753 '{{WRAPPER}} .premium-video-box-background + div' => $left_direction . ': {{SIZE}}%; width: calc( 100% - 2 * {{SIZE}}% );',
1754 ),
1755 )
1756 );
1757
1758 $this->add_responsive_control(
1759 'video_ver_position',
1760 array(
1761 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ),
1762 'type' => Controls_Manager::SLIDER,
1763 'label_block' => true,
1764 'default' => array(
1765 'size' => 5,
1766 'unit' => '%',
1767 ),
1768 'condition' => array(
1769 'background_image[url]!' => '',
1770 ),
1771 'selectors' => array(
1772 '{{WRAPPER}} .premium-video-box-background + div' => 'top: {{SIZE}}{{UNIT}};',
1773 ),
1774 )
1775 );
1776
1777 $this->add_responsive_control(
1778 'video_height',
1779 array(
1780 'label' => __( 'Video Height', 'premium-addons-for-elementor' ),
1781 'type' => Controls_Manager::SLIDER,
1782 'label_block' => true,
1783 'default' => array(
1784 'size' => 50,
1785 'unit' => '%',
1786 ),
1787 'condition' => array(
1788 'background_image[url]!' => '',
1789 ),
1790 'selectors' => array(
1791 '{{WRAPPER}} .premium-video-box-container > div' => 'padding-bottom: {{SIZE}}%;',
1792 ),
1793 )
1794 );
1795
1796 $this->end_controls_section();
1797
1798 $this->start_controls_section(
1799 'section_pa_docs',
1800 array(
1801 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
1802 )
1803 );
1804
1805 $docs = array(
1806 'https://premiumaddons.com/docs/video-box-widget-tutorial/' => __( 'Getting started »', 'premium-addons-for-elementor' ),
1807 'https://premiumaddons.com/docs/how-to-enable-youtube-data-api-for-premium-video-box-widget/' => __( 'How to Enable Youtube Data API for Premium Video Box Widget »', 'premium-addons-for-elementor' ),
1808 'https://premiumaddons.com/docs/how-to-find-youtube-channel-playlist-id/' => __( 'How to Find Youtube Channel/Playlist ID »', 'premium-addons-for-elementor' ),
1809 );
1810
1811 $doc_index = 1;
1812 foreach ( $docs as $url => $title ) {
1813
1814 $doc_url = Helper_Functions::get_campaign_link( $url, 'video-widget', 'wp-editor', 'get-support' );
1815
1816 $this->add_control(
1817 'doc_' . $doc_index,
1818 array(
1819 'type' => Controls_Manager::RAW_HTML,
1820 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
1821 'content_classes' => 'editor-pa-doc',
1822 )
1823 );
1824
1825 ++$doc_index;
1826
1827 }
1828
1829 Helper_Functions::register_element_feedback_controls( $this );
1830
1831 $this->end_controls_section();
1832
1833 $this->start_controls_section(
1834 'premium_video_box_text_style_section',
1835 array(
1836 'label' => __( 'Video Box', 'premium-addons-for-elementor' ),
1837 'tab' => Controls_Manager::TAB_STYLE,
1838 )
1839 );
1840
1841 $this->add_group_control(
1842 Group_Control_Border::get_type(),
1843 array(
1844 'name' => 'image_border',
1845 'selector' => '{{WRAPPER}} .premium-video-box-image-container, {{WRAPPER}} .premium-video-box-video-container',
1846 )
1847 );
1848
1849 // Border Radius Properties sepearated for responsive issues.
1850 $this->add_responsive_control(
1851 'premium_video_box_image_border_radius',
1852 array(
1853 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1854 'type' => Controls_Manager::SLIDER,
1855 'size_units' => array( 'px', '%', 'em' ),
1856 'selectors' => array(
1857 '{{WRAPPER}} .premium-video-box-image-container, {{WRAPPER}} .premium-video-box-video-container' => 'border-top-left-radius: {{SIZE}}{{UNIT}}; border-top-right-radius: {{SIZE}}{{UNIT}}; border-bottom-left-radius: {{SIZE}}{{UNIT}}; border-bottom-right-radius: {{SIZE}}{{UNIT}};',
1858 ),
1859 'condition' => array(
1860 'adv_radius!' => 'yes',
1861 ),
1862 )
1863 );
1864
1865 $this->add_control(
1866 'adv_radius',
1867 array(
1868 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
1869 'type' => Controls_Manager::SWITCHER,
1870 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>',
1871 )
1872 );
1873
1874 $this->add_control(
1875 'adv_radius_value',
1876 array(
1877 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1878 'type' => Controls_Manager::TEXT,
1879 'dynamic' => array( 'active' => true ),
1880 'selectors' => array(
1881 '{{WRAPPER}} .premium-banner-ib' => 'border-radius: {{VALUE}};',
1882 ),
1883 'condition' => array(
1884 'adv_radius' => 'yes',
1885 ),
1886 'ai' => array(
1887 'active' => false,
1888 ),
1889 )
1890 );
1891
1892 $this->add_group_control(
1893 Group_Control_Box_Shadow::get_type(),
1894 array(
1895 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
1896 'name' => 'box_shadow',
1897 'selector' => '{{WRAPPER}} .premium-video-box-video-container',
1898 )
1899 );
1900
1901 $this->add_control(
1902 'image_shadow_notice',
1903 array(
1904 'raw' => __( 'Please note that in case Sticky and Mask Shape options are both enabled, image shadow will be applied only on sticky overlay image', 'premium-addons-for-elementor' ),
1905 'type' => Controls_Manager::RAW_HTML,
1906 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1907 )
1908 );
1909
1910 $this->add_responsive_control(
1911 'columns_spacing',
1912 array(
1913 'label' => __( 'Rows Spacing', 'premium-addons-for-elementor' ),
1914 'type' => Controls_Manager::SLIDER,
1915 'size_units' => array( 'px', '%', 'em' ),
1916 'range' => array(
1917 'px' => array(
1918 'min' => 1,
1919 'max' => 200,
1920 ),
1921 ),
1922 'default' => array(
1923 'size' => 5,
1924 'unit' => 'px',
1925 ),
1926 'condition' => array(
1927 'premium_video_box_video_type' => 'youtube',
1928 'youtube_list' => 'yes',
1929 ),
1930 'separator' => 'before',
1931 'selectors' => array(
1932 '{{WRAPPER}} .premium-video-box-container' => 'margin-bottom: {{SIZE}}{{UNIT}}',
1933 ),
1934 )
1935 );
1936
1937 $this->add_responsive_control(
1938 'premium_blog_posts_spacing',
1939 array(
1940 'label' => __( 'Columns Spacing', 'premium-addons-for-elementor' ),
1941 'type' => Controls_Manager::SLIDER,
1942 'default' => array(
1943 'size' => 5,
1944 ),
1945 'range' => array(
1946 'px' => array(
1947 'min' => 0,
1948 'max' => 50,
1949 ),
1950 ),
1951 'selectors' => array(
1952 '{{WRAPPER}} .premium-video-box-container' => 'padding-right: calc( {{SIZE}}{{UNIT}}/2 ); padding-left: calc( {{SIZE}}{{UNIT}}/2 )',
1953 '{{WRAPPER}} .premium-video-box-playlist-container' => 'margin-left: calc( -{{SIZE}}{{UNIT}}/2 ); margin-right: calc( -{{SIZE}}{{UNIT}}/2 );',
1954 ),
1955 'condition' => array(
1956 'premium_video_box_video_type' => 'youtube',
1957 'youtube_list' => 'yes',
1958 ),
1959 )
1960 );
1961
1962 $this->end_controls_section();
1963
1964 $this->start_controls_section(
1965 'premium_video_box_icon_style',
1966 array(
1967 'label' => __( 'Play Icon', 'premium-addons-for-elementor' ),
1968 'tab' => Controls_Manager::TAB_STYLE,
1969 'condition' => array(
1970 'premium_video_box_play_icon_switcher' => 'yes',
1971 ),
1972 )
1973 );
1974
1975 $this->add_control(
1976 'premium_video_box_play_icon_size',
1977 array(
1978 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1979 'type' => Controls_Manager::SLIDER,
1980 'size_units' => array( 'px', '%', 'em' ),
1981 'default' => array(
1982 'unit' => 'px',
1983 'size' => 30,
1984 ),
1985 'selectors' => array(
1986 '{{WRAPPER}} .premium-video-box-play-icon-container i' => 'font-size: {{SIZE}}{{UNIT}};',
1987 '{{WRAPPER}} .premium-video-box-play-icon-container svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
1988 ),
1989 )
1990 );
1991
1992 $this->add_control(
1993 'premium_video_box_play_icon_color',
1994 array(
1995 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1996 'type' => Controls_Manager::COLOR,
1997 'global' => array(
1998 'default' => Global_Colors::COLOR_PRIMARY,
1999 ),
2000 'selectors' => array(
2001 '{{WRAPPER}} .premium-video-box-play-icon-container i' => 'color: {{VALUE}};',
2002 '{{WRAPPER}} .premium-video-box-play-icon-container svg' => 'fill: {{VALUE}};',
2003 ),
2004 )
2005 );
2006
2007 $this->add_control(
2008 'premium_video_box_play_icon_color_hover',
2009 array(
2010 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
2011 'type' => Controls_Manager::COLOR,
2012 'selectors' => array(
2013 '{{WRAPPER}} .premium-video-box-play-icon-container:hover i' => 'color: {{VALUE}};',
2014 '{{WRAPPER}} .premium-video-box-play-icon-container:hover svg' => 'fill: {{VALUE}};',
2015 ),
2016 )
2017 );
2018
2019 $this->add_control(
2020 'glow_color',
2021 array(
2022 'label' => __( 'Glow Color', 'premium-addons-for-elementor' ),
2023 'type' => Controls_Manager::COLOR,
2024 'selectors' => array(
2025 '{{WRAPPER}}.premium-video__glow-ripple .premium-video-box-play-icon-container:before' => 'color: {{VALUE}}',
2026 '{{WRAPPER}}.premium-video__glow-ripple .premium-video-box-play-icon-container:after' => 'color: {{VALUE}}',
2027 '{{WRAPPER}}.premium-video__glow-radio .premium-video-box-play-icon-container:before' => 'color: {{VALUE}}',
2028 '{{WRAPPER}}.premium-video__glow-radio .premium-video-box-play-icon-container:after' => 'color: {{VALUE}}',
2029 ),
2030 'default' => '#6EC1E4',
2031 'separator' => 'before',
2032 'condition' => array(
2033 'play_glow_effect!' => 'none',
2034 ),
2035 )
2036 );
2037
2038 $this->add_responsive_control(
2039 'glow_size',
2040 array(
2041 'label' => esc_html__( 'Glow Size (px)', 'premium-addons-for-elementor' ),
2042 'type' => Controls_Manager::SLIDER,
2043 'range' => array(
2044 'px' => array(
2045 'min' => 0,
2046 'max' => 200,
2047 'step' => 1,
2048 ),
2049 ),
2050 'default' => array(
2051 'unit' => 'px',
2052 'size' => 15,
2053 ),
2054 'selectors' => array(
2055 '{{WRAPPER}} .premium-video-box-play-icon-container' => '--glow-size: {{SIZE}}{{UNIT}};',
2056 ),
2057 'condition' => array(
2058 'play_glow_effect' => 'ripple',
2059 ),
2060 )
2061 );
2062
2063 $this->add_control(
2064 'wave_scale',
2065 array(
2066 'label' => __( 'Radio Wave Size', 'premium-addons-for-elementor' ),
2067 'type' => Controls_Manager::SLIDER,
2068 'range' => array(
2069 'px' => array(
2070 'min' => 0.5,
2071 'max' => 5,
2072 'step' => 0.1,
2073 ),
2074 ),
2075 'default' => array(
2076 'unit' => 'px',
2077 'size' => 2,
2078 ),
2079 'selectors' => array(
2080 '{{WRAPPER}} .premium-video-box-play-icon-container' => '--glow-scale: {{SIZE}}',
2081 ),
2082 'condition' => array(
2083 'play_glow_effect' => 'radio',
2084 ),
2085 )
2086 );
2087
2088 $this->add_group_control(
2089 Premium_Background::get_type(),
2090 array(
2091 'name' => 'premium_video_box_play_icon_background_color',
2092 'types' => array( 'classic', 'gradient' ),
2093 'selector' => '{{WRAPPER}} .premium-video-box-play-icon-container',
2094 )
2095 );
2096
2097 $this->add_group_control(
2098 Group_Control_Border::get_type(),
2099 array(
2100 'name' => 'icon_border',
2101 'selector' => '{{WRAPPER}} .premium-video-box-play-icon-container',
2102 )
2103 );
2104
2105 $this->add_control(
2106 'premium_video_box_icon_border_radius',
2107 array(
2108 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2109 'type' => Controls_Manager::SLIDER,
2110 'default' => array(
2111 'unit' => 'px',
2112 'size' => 100,
2113 ),
2114 'size_units' => array( 'px', '%', 'em' ),
2115 'selectors' => array(
2116 '{{WRAPPER}} .premium-video-box-play-icon-container' => 'border-radius: {{SIZE}}{{UNIT}};',
2117 ),
2118 )
2119 );
2120
2121 $this->add_responsive_control(
2122 'premium_video_box_icon_padding',
2123 array(
2124 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2125 'type' => Controls_Manager::DIMENSIONS,
2126 'default' => array(
2127 'top' => 20,
2128 'right' => 20,
2129 'bottom' => 20,
2130 'left' => 20,
2131 'unit' => 'px',
2132 ),
2133 'size_units' => array( 'px', 'em', '%' ),
2134 'selectors' => array(
2135 '{{WRAPPER}} .premium-video-box-play-icon-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2136 ),
2137 )
2138 );
2139
2140 $this->add_responsive_control(
2141 'premium_video_box_icon_padding_hover',
2142 array(
2143 'label' => __( 'Hover Padding', 'premium-addons-for-elementor' ),
2144 'type' => Controls_Manager::DIMENSIONS,
2145 'size_units' => array( 'px', 'em', '%' ),
2146 'selectors' => array(
2147 '{{WRAPPER}} .premium-video-box-play-icon-container:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2148 ),
2149 )
2150 );
2151
2152 $this->end_controls_section();
2153
2154 $this->start_controls_section(
2155 'premium_video_box_text_style',
2156 array(
2157 'label' => __( 'Video Description', 'premium-addons-for-elementor' ),
2158 'tab' => Controls_Manager::TAB_STYLE,
2159 'conditions' =>
2160 array(
2161 'terms' => array(
2162 array(
2163 'name' => 'premium_video_box_video_text_switcher',
2164 'value' => 'yes',
2165 ),
2166 $playlist_condition,
2167 ),
2168 ),
2169 )
2170 );
2171
2172 $this->add_control(
2173 'premium_video_box_text_color',
2174 array(
2175 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
2176 'type' => Controls_Manager::COLOR,
2177 'global' => array(
2178 'default' => Global_Colors::COLOR_PRIMARY,
2179 ),
2180 'selectors' => array(
2181 '{{WRAPPER}} .premium-video-box-text' => 'color: {{VALUE}};',
2182 ),
2183 )
2184 );
2185
2186 $this->add_control(
2187 'premium_video_box_text_color_hover',
2188 array(
2189 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ),
2190 'type' => Controls_Manager::COLOR,
2191 'global' => array(
2192 'default' => Global_Colors::COLOR_PRIMARY,
2193 ),
2194 'selectors' => array(
2195 '{{WRAPPER}} .premium-video-box-description-container:hover .premium-video-box-text' => 'color: {{VALUE}};',
2196 ),
2197 )
2198 );
2199
2200 $this->add_group_control(
2201 Group_Control_Typography::get_type(),
2202 array(
2203 'name' => 'text_typography',
2204 'global' => array(
2205 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
2206 ),
2207 'selector' => '{{WRAPPER}} .premium-video-box-text',
2208 )
2209 );
2210
2211 $this->add_control(
2212 'premium_video_box_text_background_color',
2213 array(
2214 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2215 'type' => Controls_Manager::COLOR,
2216 'global' => array(
2217 'default' => Global_Colors::COLOR_SECONDARY,
2218 ),
2219 'selectors' => array(
2220 '{{WRAPPER}} .premium-video-box-description-container' => 'background-color: {{VALUE}};',
2221 ),
2222 )
2223 );
2224
2225 $this->add_responsive_control(
2226 'premium_video_box_text_padding',
2227 array(
2228 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2229 'type' => Controls_Manager::DIMENSIONS,
2230 'size_units' => array( 'px', 'em', '%' ),
2231 'selectors' => array(
2232 '{{WRAPPER}} .premium-video-box-description-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2233 ),
2234 )
2235 );
2236
2237 $this->add_group_control(
2238 Group_Control_Text_Shadow::get_type(),
2239 array(
2240 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
2241 'name' => 'premium_text_shadow',
2242 'selector' => '{{WRAPPER}} .premium-video-box-text',
2243 )
2244 );
2245
2246 $this->end_controls_section();
2247
2248 $this->start_controls_section(
2249 'premium_video_box_sticky_options',
2250 array(
2251 'label' => __( 'Sticky Options', 'premium-addons-for-elementor' ),
2252 'tab' => Controls_Manager::TAB_STYLE,
2253 'conditions' => $sticky_condition,
2254 )
2255 );
2256
2257 $this->add_responsive_control(
2258 'sticky_video_width',
2259 array(
2260 'label' => __( 'Video Size', 'premium-addons-for-elementor' ),
2261 'type' => Controls_Manager::SLIDER,
2262 'size_units' => array( 'px', 'em', '%' ),
2263 'range' => array(
2264 'px' => array(
2265 'min' => 100,
2266 'max' => 1000,
2267 ),
2268 ),
2269 'default' => array(
2270 'size' => 320,
2271 'unit' => 'px',
2272 ),
2273 'mobile_default' => array(
2274 'size' => 250,
2275 'unit' => 'px',
2276 ),
2277 'selectors' => array(
2278 '{{WRAPPER}}.pa-aspect-ratio-169 .premium-video-box-container.premium-video-box-sticky-apply .premium-video-box-inner-wrap,
2279 {{WRAPPER}}.pa-aspect-ratio-169 .premium-video-box-sticky-apply .premium-video-box-image-container' => 'width: {{SIZE}}px; height: calc( {{SIZE}}px * 0.5625 );',
2280 '{{WRAPPER}}.pa-aspect-ratio-43 .premium-video-box-container.premium-video-box-sticky-apply .premium-video-box-inner-wrap,
2281 {{WRAPPER}}.pa-aspect-ratio-43 .premium-video-box-sticky-apply .premium-video-box-image-container' => 'width: {{SIZE}}px; height: calc( {{SIZE}}px * 0.75 );',
2282 '{{WRAPPER}}.pa-aspect-ratio-32 .premium-video-box-container.premium-video-box-sticky-apply .premium-video-box-inner-wrap,
2283 {{WRAPPER}}.pa-aspect-ratio-32 .premium-video-box-sticky-apply .premium-video-box-image-container' => 'width: {{SIZE}}px; height: calc( {{SIZE}}px * 0.6666666666666667 );',
2284 '{{WRAPPER}}.pa-aspect-ratio-916 .premium-video-box-container.premium-video-box-sticky-apply .premium-video-box-inner-wrap,
2285 {{WRAPPER}}.pa-aspect-ratio-916 .premium-video-box-sticky-apply .premium-video-box-image-container' => 'width: {{SIZE}}px; height: calc( {{SIZE}}px * 0.1778 );',
2286 '{{WRAPPER}}.pa-aspect-ratio-11 .premium-video-box-container.premium-video-box-sticky-apply .premium-video-box-inner-wrap,
2287 {{WRAPPER}}.pa-aspect-ratio-11 .premium-video-box-sticky-apply .premium-video-box-image-container' => 'width: {{SIZE}}px; height: calc( {{SIZE}}px * 1 );',
2288 '{{WRAPPER}}.pa-aspect-ratio-219 .premium-video-box-container.premium-video-box-sticky-apply .premium-video-box-inner-wrap,
2289 {{WRAPPER}}.pa-aspect-ratio-219 .premium-video-box-sticky-apply .premium-video-box-image-container' => 'width: {{SIZE}}px; height: calc( {{SIZE}}px * 0.4285 );',
2290 ),
2291 )
2292 );
2293
2294 $this->add_responsive_control(
2295 'sticky_video_margin',
2296 array(
2297 'label' => __( 'Spaces Around', 'premium-addons-for-elementor' ),
2298 'type' => Controls_Manager::DIMENSIONS,
2299 'size_units' => array( 'px', 'em', '%' ),
2300 'selectors' => array(
2301 '{{WRAPPER}}.premium-video-sticky-top-right .premium-video-box-sticky-apply .premium-video-box-inner-wrap' => 'top: {{TOP}}{{UNIT}}; ' . $right_direction . ': {{RIGHT}}{{UNIT}}',
2302 '{{WRAPPER}}.premium-video-sticky-top-left .premium-video-box-sticky-apply .premium-video-box-inner-wrap' => 'top: {{TOP}}{{UNIT}}; ' . $left_direction . ': {{LEFT}}{{UNIT}}',
2303 '{{WRAPPER}}.premium-video-sticky-bottom-right .premium-video-box-sticky-apply .premium-video-box-inner-wrap' => 'bottom: {{BOTTOM}}{{UNIT}}; ' . $right_direction . ': {{RIGHT}}{{UNIT}}',
2304 '{{WRAPPER}}.premium-video-sticky-bottom-left .premium-video-box-sticky-apply .premium-video-box-inner-wrap' => 'bottom: {{BOTTOM}}{{UNIT}}; ' . $left_direction . ': {{LEFT}}{{UNIT}}',
2305 '{{WRAPPER}}.premium-video-sticky-center-left .premium-video-box-sticky-apply .premium-video-box-inner-wrap' => $left_direction . ': {{LEFT}}{{UNIT}}',
2306 '{{WRAPPER}}.premium-video-sticky-center-right .premium-video-box-sticky-apply .premium-video-box-inner-wrap' => $right_direction . ': {{RIGHT}}{{UNIT}}',
2307 ),
2308 )
2309 );
2310
2311 $this->add_group_control(
2312 Group_Control_Box_Shadow::get_type(),
2313 array(
2314 'name' => 'sticky_box_shadow',
2315 'selector' => '{{WRAPPER}} .premium-video-box-sticky-apply .premium-video-box-inner-wrap',
2316 'condition' => array(
2317 'sticky_info_bar_switch!' => 'yes',
2318 ),
2319 )
2320 );
2321
2322 $this->add_control(
2323 'info_bar_shadow_color',
2324 array(
2325 'label' => __( 'Shadow Color', 'premium-addons-for-elementor' ),
2326 'type' => Controls_Manager::COLOR,
2327 'default' => 'rgba(0, 0, 0, 0.5)',
2328 'condition' => array(
2329 'sticky_info_bar_switch' => 'yes',
2330 ),
2331 )
2332 );
2333
2334 $this->add_control(
2335 'sticky_play_icon',
2336 array(
2337 'label' => __( 'Play Icon', 'premium-addons-for-elementor' ),
2338 'type' => Controls_Manager::HEADING,
2339 'separator' => 'before',
2340 'condition' => array(
2341 'premium_video_box_play_icon_switcher' => 'yes',
2342 ),
2343 )
2344 );
2345
2346 $this->add_control(
2347 'premium_video_box_play_icon_sticky_size',
2348 array(
2349 'label' => __( 'Size', 'premium-addons-for-elementor' ),
2350 'type' => Controls_Manager::SLIDER,
2351 'size_units' => array( 'px', '%', 'em' ),
2352 'selectors' => array(
2353 '{{WRAPPER}} .premium-video-box-sticky-apply .premium-video-box-play-icon' => 'font-size: {{SIZE}}{{UNIT}};',
2354 ),
2355 'condition' => array(
2356 'premium_video_box_play_icon_switcher' => 'yes',
2357 ),
2358 )
2359 );
2360
2361 $this->add_responsive_control(
2362 'premium_video_box_icon_sticky_padding',
2363 array(
2364 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2365 'type' => Controls_Manager::DIMENSIONS,
2366 'default' => array(
2367 'top' => 40,
2368 'right' => 40,
2369 'bottom' => 40,
2370 'left' => 40,
2371 'unit' => 'px',
2372 ),
2373 'size_units' => array( 'px', 'em', '%' ),
2374 'selectors' => array(
2375 '{{WRAPPER}} .premium-video-box-sticky-apply .premium-video-box-play-icon ' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2376 ),
2377 'condition' => array(
2378 'premium_video_box_play_icon_switcher' => 'yes',
2379 ),
2380 )
2381 );
2382
2383 $this->add_control(
2384 'premium_video_box_text_sticky_size',
2385 array(
2386 'label' => __( 'Video Text Size', 'premium-addons-for-elementor' ),
2387 'type' => Controls_Manager::SLIDER,
2388 'size_units' => array( 'px', '%', 'em' ),
2389 'selectors' => array(
2390 '{{WRAPPER}} .premium-video-box-sticky-apply .premium-video-box-text' => 'font-size: {{SIZE}}{{UNIT}};',
2391 ),
2392 'condition' => array(
2393 'premium_video_box_video_text_switcher' => 'yes',
2394 ),
2395 )
2396 );
2397
2398 $this->add_control(
2399 'sticky_close',
2400 array(
2401 'label' => __( 'Close Icon', 'premium-addons-for-elementor' ),
2402 'type' => Controls_Manager::HEADING,
2403 'separator' => 'before',
2404 )
2405 );
2406
2407 $this->add_control(
2408 'premium_video_box_sticky_close_color',
2409 array(
2410 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2411 'type' => Controls_Manager::COLOR,
2412 'selectors' => array(
2413 '{{WRAPPER}} .premium-video-box-sticky-close i' => 'color: {{VALUE}}!important',
2414 ),
2415 'global' => array(
2416 'default' => Global_Colors::COLOR_SECONDARY,
2417 ),
2418 )
2419 );
2420
2421 $this->add_control(
2422 'premium_video_box_sticky_close_bg_color',
2423 array(
2424 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2425 'type' => Controls_Manager::COLOR,
2426 'selectors' => array(
2427 '{{WRAPPER}} .premium-video-box-sticky-close' => 'background: {{VALUE}}',
2428 ),
2429 'default' => '#FFF',
2430 )
2431 );
2432
2433 $this->add_responsive_control(
2434 'sticky_video_icon_size',
2435 array(
2436 'label' => __( 'Size', 'premium-addons-for-elementor' ),
2437 'type' => Controls_Manager::SLIDER,
2438 'size_units' => array( 'px', 'em', '%' ),
2439 'default' => array(
2440 'size' => 15,
2441 'unit' => 'px',
2442 ),
2443 'selectors' => array(
2444 '{{WRAPPER}} .premium-video-box-sticky-close i' => 'font-size: {{SIZE}}{{UNIT}}',
2445 ),
2446 )
2447 );
2448
2449 $this->add_control(
2450 'sticky_hint',
2451 array(
2452 'label' => __( 'Info Section', 'premium-addons-for-elementor' ),
2453 'type' => Controls_Manager::HEADING,
2454 'condition' => array(
2455 'sticky_info_bar_switch' => 'yes',
2456 ),
2457 'separator' => 'before',
2458 )
2459 );
2460
2461 $this->add_control(
2462 'premium_video_box_sticky_info_color',
2463 array(
2464 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
2465 'type' => Controls_Manager::COLOR,
2466 'selectors' => array(
2467 '{{WRAPPER}} .premium-video-box-sticky-infobar' => 'color: {{VALUE}}',
2468 ),
2469 'global' => array(
2470 'default' => Global_Colors::COLOR_SECONDARY,
2471 ),
2472 'condition' => array(
2473 'sticky_info_bar_switch' => 'yes',
2474 ),
2475 )
2476 );
2477
2478 $this->add_group_control(
2479 Group_Control_Typography::get_type(),
2480 array(
2481 'name' => 'info_typography',
2482 'global' => array(
2483 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
2484 ),
2485 'selector' => '{{WRAPPER}} .premium-video-box-sticky-infobar',
2486 'condition' => array(
2487 'sticky_info_bar_switch' => 'yes',
2488 ),
2489 )
2490 );
2491
2492 $this->add_control(
2493 'premium_video_box_sticky_info_bg_color',
2494 array(
2495 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2496 'type' => Controls_Manager::COLOR,
2497 'selectors' => array(
2498 '{{WRAPPER}} .premium-video-box-sticky-apply .premium-video-box-sticky-infobar' => 'background: {{VALUE}}',
2499 ),
2500 'default' => '#FFF',
2501 'condition' => array(
2502 'sticky_info_bar_switch' => 'yes',
2503 ),
2504 )
2505 );
2506
2507 $this->end_controls_section();
2508
2509 $this->start_controls_section(
2510 'premium_video_title_style',
2511 array(
2512 'label' => __( 'Video Title', 'premium-addons-for-elementor' ),
2513 'tab' => Controls_Manager::TAB_STYLE,
2514 'condition' => array(
2515 'youtube_list' => 'yes',
2516 'youtube_videos_title' => 'yes',
2517 'premium_video_box_video_type' => 'youtube',
2518 ),
2519 )
2520 );
2521
2522 $this->add_responsive_control(
2523 'premium_video_title_align',
2524 array(
2525 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
2526 'type' => Controls_Manager::CHOOSE,
2527 'options' => array(
2528 'left' => array(
2529 'title' => __( 'Left', 'premium-addons-for-elementor' ),
2530 'icon' => 'eicon-text-align-left',
2531 ),
2532 'center' => array(
2533 'title' => __( 'Center', 'premium-addons-for-elementor' ),
2534 'icon' => 'eicon-text-align-center',
2535 ),
2536 'right' => array(
2537 'title' => __( 'Right', 'premium-addons-for-elementor' ),
2538 'icon' => 'eicon-text-align-right',
2539 ),
2540 ),
2541 'toggle' => false,
2542 'default' => 'center',
2543 'selectors' => array(
2544 '{{WRAPPER}} .premium-youtube-vid-title' => 'text-align: {{VALUE}};',
2545 ),
2546 )
2547 );
2548
2549 $this->add_group_control(
2550 Group_Control_Typography::get_type(),
2551 array(
2552 'name' => 'premium_video_title_typo',
2553 'selector' => '{{WRAPPER}} .premium-youtube-vid-title',
2554 )
2555 );
2556
2557 $this->add_control(
2558 'premium_video_title_color',
2559 array(
2560 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2561 'type' => Controls_Manager::COLOR,
2562 'global' => array(
2563 'default' => Global_Colors::COLOR_PRIMARY,
2564 ),
2565 'selectors' => array(
2566 '{{WRAPPER}} .premium-youtube-vid-title' => 'color: {{VALUE}};',
2567 ),
2568 )
2569 );
2570
2571 $this->add_control(
2572 'premium_video_title_bg_color',
2573 array(
2574 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2575 'type' => Controls_Manager::COLOR,
2576 'selectors' => array(
2577 '{{WRAPPER}} .premium-youtube-vid-title' => 'background-color: {{VALUE}};',
2578 ),
2579 )
2580 );
2581
2582 $this->add_group_control(
2583 Group_Control_Text_Shadow::get_type(),
2584 array(
2585 'name' => 'premium_video_title_text_shadow',
2586 'selector' => '{{WRAPPER}} .premium-youtube-vid-title',
2587 )
2588 );
2589
2590 $this->add_group_control(
2591 Group_Control_Box_Shadow::get_type(),
2592 array(
2593 'label' => __( 'Box Shadow', 'premium-addons-for-elementor' ),
2594 'name' => 'premium_video_title_shadow',
2595 'selector' => '{{WRAPPER}} .premium-youtube-vid-title',
2596 )
2597 );
2598
2599 $this->add_group_control(
2600 Group_Control_Border::get_type(),
2601 array(
2602 'name' => 'premium_video_title_border',
2603 'selector' => '{{WRAPPER}} .premium-youtube-vid-title',
2604 )
2605 );
2606
2607 $this->add_control(
2608 'premium_video_title_border_rad',
2609 array(
2610 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2611 'type' => Controls_Manager::SLIDER,
2612 'size_units' => array( 'px', '%', 'em' ),
2613 'selectors' => array(
2614 '{{WRAPPER}} .premium-youtube-vid-title' => 'border-radius: {{SIZE}}{{UNIT}};',
2615 ),
2616 )
2617 );
2618
2619 $this->add_responsive_control(
2620 'premium_video_title_padding',
2621 array(
2622 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2623 'type' => Controls_Manager::DIMENSIONS,
2624 'size_units' => array( 'px', 'em', '%' ),
2625 'selectors' => array(
2626 '{{WRAPPER}} .premium-youtube-vid-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2627 ),
2628 )
2629 );
2630
2631 $this->add_responsive_control(
2632 'premium_video_title_margin',
2633 array(
2634 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2635 'type' => Controls_Manager::DIMENSIONS,
2636 'size_units' => array( 'px', 'em', '%' ),
2637 'selectors' => array(
2638 '{{WRAPPER}} .premium-youtube-vid-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2639 ),
2640 )
2641 );
2642
2643 $this->end_controls_section();
2644
2645 $this->start_controls_section(
2646 'section_lightbox_style',
2647 array(
2648 'label' => __( 'Lightbox', 'premium-addons-for-elementor' ),
2649 'tab' => Controls_Manager::TAB_STYLE,
2650 'condition' => array(
2651 'video_lightbox' => 'yes',
2652 'video_lightbox_style' => 'elementor',
2653 ),
2654 )
2655 );
2656
2657 $this->add_control(
2658 'lightbox_color',
2659 array(
2660 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2661 'type' => Controls_Manager::COLOR,
2662 'selectors' => array(
2663 '#elementor-lightbox-{{ID}}' => 'background-color: {{VALUE}};',
2664 ),
2665 )
2666 );
2667
2668 $this->add_control(
2669 'lightbox_ui_color',
2670 array(
2671 'label' => __( 'UI Color', 'premium-addons-for-elementor' ),
2672 'type' => Controls_Manager::COLOR,
2673 'selectors' => array(
2674 '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button' => 'color: {{VALUE}}',
2675 ),
2676 )
2677 );
2678
2679 $this->add_control(
2680 'lightbox_ui_color_hover',
2681 array(
2682 'label' => __( 'UI Hover Color', 'premium-addons-for-elementor' ),
2683 'type' => Controls_Manager::COLOR,
2684 'selectors' => array(
2685 '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover' => 'color: {{VALUE}}',
2686 ),
2687 'separator' => 'after',
2688 )
2689 );
2690
2691 $this->add_control(
2692 'lightbox_video_width',
2693 array(
2694 'label' => __( 'Content Width', 'premium-addons-for-elementor' ),
2695 'type' => Controls_Manager::SLIDER,
2696 'default' => array(
2697 'unit' => '%',
2698 ),
2699 'range' => array(
2700 '%' => array(
2701 'min' => 30,
2702 ),
2703 ),
2704 'selectors' => array(
2705 '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
2706 ),
2707 )
2708 );
2709
2710 $this->add_control(
2711 'lightbox_content_position',
2712 array(
2713 'label' => __( 'Content Position', 'premium-addons-for-elementor' ),
2714 'type' => Controls_Manager::SELECT,
2715 'frontend_available' => true,
2716 'options' => array(
2717 '' => __( 'Center', 'premium-addons-for-elementor' ),
2718 'top' => __( 'Top', 'premium-addons-for-elementor' ),
2719 ),
2720 'selectors' => array(
2721 '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
2722 ),
2723 'selectors_dictionary' => array(
2724 'top' => 'top: 60px',
2725 ),
2726 )
2727 );
2728
2729 $this->add_responsive_control(
2730 'lightbox_content_animation',
2731 array(
2732 'label' => __( 'Entrance Animation', 'premium-addons-for-elementor' ),
2733 'type' => Controls_Manager::ANIMATION,
2734 'frontend_available' => true,
2735 )
2736 );
2737
2738 $this->end_controls_section();
2739
2740 $this->update_controls();
2741 }
2742
2743 /**
2744 * Render video box widget output on the frontend.
2745 *
2746 * Written in PHP and used to generate the final HTML.
2747 *
2748 * @since 1.0.0
2749 * @access protected
2750 */
2751 protected function render() {
2752
2753 $settings = $this->get_settings_for_display();
2754
2755 $video_type = $settings['premium_video_box_video_type'];
2756
2757 $lightbox = $settings['video_lightbox'];
2758
2759 $pretty_container = false;
2760
2761 if ( 'youtube' === $video_type && 'yes' === $settings['youtube_list'] ) {
2762
2763 $this->fetch_youtube_playlist_data();
2764
2765 return;
2766
2767 }
2768
2769 $id = $this->get_id();
2770
2771 $params = $this->get_video_params();
2772
2773 $autoplay = $settings['premium_video_box_self_autoplay'];
2774
2775 $image = 'transparent';
2776
2777 // Make sure autoplay is disabled before getting any thumbnails.
2778 if ( 'yes' !== $autoplay ) {
2779
2780 $thumbnail = $this->get_thumbnail( $params['id'] );
2781
2782 if ( ! empty( $thumbnail ) ) {
2783 $image = sprintf( 'url(\'%s\')', $thumbnail );
2784 }
2785 }
2786
2787 $mute = $settings['premium_video_box_mute'];
2788
2789 $playsinline = $settings['play_inline'];
2790
2791 $loop = $settings['premium_video_box_loop'];
2792
2793 $controls = $settings['premium_video_box_controls'];
2794
2795 $hosted_url = '';
2796 $link = '';
2797 $options = '';
2798
2799 if ( 'self' === $video_type ) {
2800
2801 $overlay = $settings['premium_video_box_image_switcher'];
2802
2803 if ( 'yes' !== $overlay ) {
2804 $image = 'transparent';
2805 }
2806
2807 if ( empty( $settings['premium_video_box_self_hosted_remote'] ) ) {
2808 $hosted_url = $settings['premium_video_box_self_hosted']['url'];
2809 } else {
2810 $hosted_url = $settings['premium_video_box_self_hosted_remote'];
2811 }
2812
2813 $video_params = '';
2814
2815 if ( $controls ) {
2816 $video_params .= 'controls ';
2817 }
2818 if ( $mute ) {
2819 $video_params .= 'muted ';
2820 }
2821 if ( $loop ) {
2822 $video_params .= 'loop ';
2823 }
2824 if ( $autoplay ) {
2825
2826 $video_params .= 'playsinline ';
2827 if ( 'yes' !== $settings['autoplay_viewport'] ) {
2828 $video_params .= 'autoplay ';
2829 } else {
2830 $this->add_render_attribute( 'container', 'data-play-viewport', 'true' );
2831 if ( 'yes' === $settings['autoplay_reset'] ) {
2832 $this->add_render_attribute( 'container', 'data-play-reset', 'true' );
2833 }
2834
2835 $video_params .= ' preload="none"';
2836 }
2837 }
2838
2839 if ( $playsinline ) {
2840 $video_params .= 'playsinline ';
2841 }
2842
2843 if ( ! $settings['download_button'] ) {
2844 $video_params .= ' controlsList="nodownload"';
2845 }
2846 } else {
2847 // youtube - vimeo - dailymotion.
2848 $link = $params['link'];
2849
2850 $related = $settings['premium_video_box_suggested_videos'];
2851
2852 $options = 'youtube' === $video_type ? '&rel=' : '?rel=';
2853 $options .= 'yes' === $related ? '1' : '0';
2854 $options .= 'youtube' === $video_type ? '&mute=' : '&muted=';
2855 $options .= 'yes' === $mute ? '1' : '0';
2856 $options .= '&loop=';
2857 $options .= 'yes' === $loop ? '1' : '0';
2858 $options .= '&controls=';
2859 $options .= 'yes' === $controls ? '1' : '0';
2860 $options .= '&playsinline=';
2861 $options .= 'yes' === $playsinline ? '1' : '0';
2862
2863 if ( 'yes' === $autoplay && ! $this->has_image_overlay() ) {
2864
2865 // Autoplay on Viewport.
2866 if ( 'yes' === $settings['autoplay_viewport'] ) {
2867 $this->add_render_attribute( 'container', 'data-play-viewport', 'true' );
2868 }
2869
2870 $options .= '&autoplay=1';
2871 }
2872
2873 if ( 'youtube' === $video_type ) {
2874 $options .= '&cc_load_policy=' . ( 'yes' === $settings['cc_load_policy'] ? '1' : '0' );
2875 } elseif ( 'vimeo' === $video_type ) {
2876
2877 // Filter any parameters after link to be added later.
2878 $query_string = wp_parse_url( $link, PHP_URL_QUERY );
2879
2880 // If video link contains parameters.
2881 if ( false !== strpos( $link, '?' ) ) {
2882 $link = strstr( $link, '?', true );
2883 } else {
2884 $link = str_replace( '#t=', '', $link );
2885 }
2886
2887 $options .= '&color=' . str_replace( '#', '', $settings['vimeo_controls_color'] );
2888
2889 if ( 'yes' === $settings['vimeo_title'] ) {
2890 $options .= '&title=1';
2891 }
2892
2893 if ( 'yes' === $settings['vimeo_portrait'] ) {
2894 $options .= '&portrait=1';
2895 }
2896
2897 if ( 'yes' === $settings['vimeo_byline'] ) {
2898 $options .= '&byline=1';
2899 }
2900
2901 $options .= '&autopause=0';
2902
2903 $options .= '&' . $query_string . '#t=';
2904
2905 } elseif ( 'dailymotion' === $video_type ) {
2906 // dailymotion options.
2907
2908 $logo = $settings['dailymotion_logo'] ? '1' : '0';
2909 $info = $settings['dailymotion_info'] ? '1' : '0';
2910
2911 $options .= '&ui-logo=' . $logo;
2912 $options .= '&ui-start-screen-info=' . $info;
2913
2914 $options .= '&ui-highlight=' . trim( $settings['dm_controls_color'], '#' );
2915 }
2916 }
2917
2918 if ( $settings['premium_video_box_start'] || $settings['premium_video_box_end'] ) {
2919
2920 if ( in_array( $video_type, array( 'youtube', 'dailymotion' ), true ) ) {
2921
2922 if ( $settings['premium_video_box_start'] ) {
2923 $options .= '&start=' . $settings['premium_video_box_start'];
2924 }
2925
2926 if ( $settings['premium_video_box_end'] && 'youtube' === $video_type ) {
2927 $options .= '&end=' . $settings['premium_video_box_end'];
2928 }
2929 } elseif ( 'self' === $video_type ) {
2930
2931 $hosted_url .= '#t=';
2932
2933 if ( $settings['premium_video_box_start'] ) {
2934 $hosted_url .= $settings['premium_video_box_start'];
2935 }
2936
2937 if ( $settings['premium_video_box_end'] ) {
2938 $hosted_url .= ',' . $settings['premium_video_box_end'];
2939 }
2940 }
2941 }
2942
2943 if ( 'self' !== $video_type && 'yes' !== $lightbox ) {
2944
2945 if ( 'youtube' === $video_type && 'yes' === $settings['privacy_mode'] ) {
2946 $link = str_replace( '.com', '-nocookie.com', $link );
2947 }
2948
2949 $this->add_render_attribute(
2950 'video_container',
2951 array(
2952 'data-src' => $link . $options,
2953 )
2954 );
2955 }
2956
2957 $sticky = $settings['premium_video_box_sticky_switcher'];
2958
2959 if ( 'yes' === $sticky ) {
2960
2961 $sticky_play = $settings['premium_video_box_sticky_on_play'];
2962
2963 $sticky_desktop = '';
2964
2965 $sticky_tablet = '';
2966
2967 $sticky_mobile = '';
2968
2969 $sticky_infobar = ( 'yes' === $settings['sticky_info_bar_switch'] ) ? 'premium-video-box-sticky-infobar-wrap' : '';
2970
2971 if ( $settings['premium_video_box_sticky_hide'] ) {
2972 foreach ( $settings['premium_video_box_sticky_hide'] as $element ) {
2973
2974 switch ( $element ) {
2975 case 'desktop':
2976 $sticky_desktop = 'desktop';
2977 break;
2978 case 'tablet':
2979 $sticky_tablet = 'tablet';
2980 break;
2981 case 'mobile':
2982 $sticky_mobile = 'mobile';
2983 break;
2984 }
2985 }
2986 }
2987
2988 $this->add_render_attribute(
2989 'container',
2990 array(
2991 'class' => $sticky_infobar,
2992 'data-sticky' => $sticky,
2993 'data-hide-desktop' => $sticky_desktop,
2994 'data-hide-tablet' => $sticky_tablet,
2995 'data-hide-mobile' => $sticky_mobile,
2996 'data-sticky-play' => $sticky_play,
2997 )
2998 );
2999
3000 if ( ! empty( $settings['sticky_video_margin'] ) ) {
3001 $this->add_render_attribute( 'container', 'data-sticky-margin', $settings['sticky_video_margin']['bottom'] );
3002 }
3003 }
3004
3005 if ( 'yes' === $lightbox ) {
3006
3007 $lightbox_settings = array(
3008 'type' => $settings['video_lightbox_style'],
3009 );
3010
3011 if ( 'elementor' === $settings['video_lightbox_style'] && 'dailymotion' !== $video_type ) {
3012
3013 $lightbox_options = array(
3014 'type' => 'video',
3015 'videoType' => 'self' === $video_type ? 'hosted' : $video_type,
3016 'url' => 'self' === $video_type ? $hosted_url : $link . $options,
3017 'modalOptions' => array(
3018 'id' => 'elementor-lightbox-' . $id,
3019 'entranceAnimation' => $settings['lightbox_content_animation'],
3020 'entranceAnimation_tablet' => $settings['lightbox_content_animation_tablet'],
3021 'entranceAnimation_mobile' => $settings['lightbox_content_animation_mobile'],
3022 'videoAspectRatio' => $settings['aspect_ratio'],
3023 ),
3024 );
3025
3026 if ( 'self' === $video_type ) {
3027 $lightbox_options['videoParams'] = $this->get_hosted_params( $settings );
3028 }
3029
3030 $this->add_render_attribute(
3031 'video_container',
3032 array(
3033 'data-elementor-open-lightbox' => 'yes',
3034 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ),
3035 )
3036 );
3037 } else {
3038
3039 $rel = sprintf( 'prettyPhoto[premium-videobox-%s]', $id );
3040 $link = ( 'self' === $video_type ) ? $hosted_url : $link . $options . '&autoplay=1&iframe=true';
3041 $pretty_container = true;
3042
3043 $this->add_render_attribute(
3044 'video_lightbox_container',
3045 array(
3046 'class' => 'premium-vid-lightbox-container',
3047 'data-rel' => $rel,
3048 'href' => $link,
3049 )
3050 );
3051
3052 // make sure that lightbox type is prettyphoto when dailymotion || prettyphoto.
3053 $lightbox_settings['type'] = 'prettyphoto'; // TODO: remove when dailymotion issue is fixed.
3054 $lightbox_settings['theme'] = $settings['video_lightbox_theme'];
3055 }
3056
3057 $this->add_render_attribute(
3058 'container',
3059 array(
3060 'data-lightbox' => wp_json_encode( $lightbox_settings ),
3061 )
3062 );
3063 }
3064
3065 $this->add_inline_editing_attributes( 'premium_video_box_description_text' );
3066
3067 $this->add_render_attribute(
3068 'container',
3069 array(
3070 'id' => 'premium-video-box-container-' . $id,
3071 'class' => 'premium-video-box-container',
3072 'data-overlay' => 'yes' === $settings['premium_video_box_image_switcher'] ? 'true' : 'false',
3073 'data-type' => $video_type,
3074 'data-thumbnail' => ! empty( $thumbnail ),
3075 'data-hover' => $settings['premium_video_box_img_effect'],
3076 )
3077 );
3078
3079 $this->add_render_attribute(
3080 'video_container',
3081 array(
3082 'class' => 'premium-video-box-video-container',
3083 )
3084 );
3085
3086 $this->add_render_attribute(
3087 'video_wrap',
3088 array(
3089 'class' => 'premium-video-box-inner-wrap',
3090 )
3091 );
3092
3093 $animation_class = $settings['premium_video_box_animation'];
3094
3095 if ( '' !== $settings['premium_video_box_animation'] ) {
3096
3097 $animation_dur = 'animated-' . $settings['premium_video_box_animation_duration'];
3098
3099 $this->add_render_attribute(
3100 'video_wrap',
3101 'data-video-animation',
3102 array(
3103 $animation_class,
3104 $animation_dur,
3105 )
3106 );
3107
3108 $delay = '' !== $settings['premium_video_box_animation_delay'] ? $settings['premium_video_box_animation_delay'] : 0;
3109
3110 $this->add_render_attribute( 'video_wrap', 'data-delay-animation', $delay );
3111 }
3112
3113 $this->add_render_attribute( 'info_bar', 'class', 'premium-video-box-sticky-infobar' );
3114
3115 if ( 'yes' === $settings['sticky_info_bar_switch'] ) {
3116 $this->add_render_attribute( 'info_bar', 'style', 'box-shadow:' . $settings['info_bar_shadow_color'] . ' 0px 5px 10px -5px ' );
3117 }
3118
3119 $this->add_render_attribute(
3120 'image_container',
3121 array(
3122 'style' => 'background-image:' . $image,
3123 'class' => array(
3124 'premium-video-box-image-container',
3125 $settings['premium_video_box_img_effect'],
3126 ),
3127 )
3128 );
3129
3130 if ( 'yes' === $settings['mask_video_box_switcher'] ) {
3131
3132 $this->add_render_attribute( 'container', 'data-pa-mask', 'true' );
3133 $this->add_render_attribute( 'mask', 'class', 'premium-video-box-mask-media' );
3134
3135 if ( 'blur' === $settings['premium_video_box_img_effect'] ) {
3136 $this->add_render_attribute( 'image_container', 'class', 'premium-video-box-mask-media' );
3137 }
3138
3139 if ( '' !== $settings['mask_shape_video_box']['url'] && 'yes' === $settings['video_box_shadow'] ) {
3140
3141 $this->add_render_attribute( 'mask_filter', 'class', 'premium-video-box-mask-filter' );
3142
3143 }
3144 }
3145
3146 if ( ! empty( $settings['background_image']['url'] ) ) {
3147 $this->add_render_attribute(
3148 'background',
3149 array(
3150 'class' => 'premium-video-box-background',
3151 'src' => $settings['background_image']['url'],
3152 )
3153 );
3154 }
3155
3156 ?>
3157
3158
3159 <?php if ( ! empty( $settings['background_image']['url'] ) ) : ?>
3160 <img <?php $this->print_render_attribute_string( 'background' ); ?>>
3161 <?php endif; ?>
3162
3163 <?php if ( 'yes' === $settings['mask_video_box_switcher'] ) : ?>
3164 <div <?php $this->print_render_attribute_string( 'mask_filter' ); ?>>
3165 <?php endif; ?>
3166 <div <?php $this->print_render_attribute_string( 'container' ); ?>>
3167 <div <?php $this->print_render_attribute_string( 'mask' ); ?> >
3168 <?php $this->get_vimeo_header( $params['id'] ); ?>
3169
3170 <div <?php $this->print_render_attribute_string( 'video_wrap' ); ?>>
3171 <div <?php $this->print_render_attribute_string( 'video_container' ); ?>>
3172 <?php if ( $pretty_container ) : ?>
3173 <a <?php $this->print_render_attribute_string( 'video_lightbox_container' ); ?>></a>
3174 <?php endif; ?>
3175
3176 <?php if ( 'self' === $video_type ) : ?>
3177 <video src="<?php echo esc_url( $hosted_url ); ?>" <?php echo wp_kses_post( $video_params ); ?>></video>
3178 <?php endif; ?>
3179 </div>
3180 <div <?php $this->print_render_attribute_string( 'image_container' ); ?>></div>
3181 <?php if ( 'yes' === $sticky ) { ?>
3182 <span class="premium-video-box-sticky-close"><i class="fas fa-times" aria-hidden="true"></i></span>
3183 <?php } ?>
3184 <?php if ( 'yes' === $settings['sticky_info_bar_switch'] && '' !== $settings['sticky_info_bar_text'] ) { ?>
3185 <div <?php $this->print_render_attribute_string( 'info_bar' ); ?>><?php echo wp_kses_post( $settings['sticky_info_bar_text'] ); ?></div>
3186 <?php } ?>
3187 <?php if ( 'yes' === $settings['premium_video_box_play_icon_switcher'] && 'yes' !== $autoplay && ! empty( $thumbnail ) ) : ?>
3188 <div class="premium-video-box-play-icon-container">
3189 <?php
3190 Icons_Manager::render_icon(
3191 array(
3192 'library' => 'fa-solid',
3193 'value' => 'fas fa-play',
3194 ),
3195 array(
3196 'class' => array( 'premium-video-box-play-icon' ),
3197 'aria-hidden' => 'true',
3198 )
3199 );
3200 ?>
3201 </div>
3202 <?php endif; ?>
3203 <?php if ( 'yes' === $settings['premium_video_box_video_text_switcher'] && ! empty( $settings['premium_video_box_description_text'] ) ) : ?>
3204 <div class="premium-video-box-description-container">
3205 <p class="premium-video-box-text">
3206 <span <?php $this->print_render_attribute_string( 'premium_video_box_description_text' ); ?>>
3207 <?php echo wp_kses_post( $settings['premium_video_box_description_text'] ); ?>
3208 </span>
3209 </p>
3210 </div>
3211 <?php endif; ?>
3212 </div>
3213
3214 </div>
3215 </div>
3216 <?php if ( 'yes' === $settings['mask_video_box_switcher'] ) : ?>
3217 </div>
3218 <?php endif; ?>
3219
3220 <?php
3221 }
3222
3223 /**
3224 * Get Hosted Videos Parameters
3225 *
3226 * @since 3.7.0
3227 * @access private
3228 *
3229 * @param array $item image repeater item.
3230 */
3231 private function get_hosted_params( $item ) {
3232
3233 $video_params = array();
3234
3235 if ( $item['premium_video_box_controls'] ) {
3236 $video_params['controls'] = '';
3237 }
3238
3239 if ( $item['premium_video_box_mute'] ) {
3240 $video_params['muted'] = 'muted';
3241 }
3242
3243 if ( $item['premium_video_box_loop'] ) {
3244 $video_params['loop'] = '';
3245 }
3246
3247 if ( ! $item['download_button'] ) {
3248 $video_params['controlsList'] = 'nodownload';
3249 }
3250
3251 return $video_params;
3252 }
3253
3254 /**
3255 * Get video thumbnail
3256 *
3257 * @access public
3258 *
3259 * @param string $video_id video ID.
3260 */
3261 private function get_thumbnail( $video_id = '' ) {
3262
3263 $settings = $this->get_settings_for_display();
3264
3265 $type = $settings['premium_video_box_video_type'];
3266
3267 $overlay = $settings['premium_video_box_image_switcher'];
3268
3269 if ( 'yes' === $overlay || 'self' === $type ) {
3270
3271 $thumbnail_src = $settings['premium_video_box_image']['url'];
3272
3273 // add default placeholder for self-hosted video if overlay is enabled.
3274 if ( 'self' === $type && ! $thumbnail_src ) {
3275 $thumbnail_src = Utils::get_placeholder_image_src();
3276 }
3277
3278 return $thumbnail_src;
3279 }
3280
3281 // Check thumbnail size option only for Youtube videos.
3282 $size = '';
3283 if ( 'youtube' === $type ) {
3284 $size = $settings['premium_video_box_yt_thumbnail_size'];
3285 }
3286
3287 $thumbnail_src = Helper_Functions::get_video_thumbnail( $video_id, $type, $size );
3288
3289 return $thumbnail_src;
3290 }
3291
3292 /**
3293 * Get video params
3294 *
3295 * Get video ID and url
3296 *
3297 * @access public
3298 *
3299 * @param string $video_url video URL.
3300 *
3301 * @return array video parameters
3302 */
3303 private function get_video_params( $video_url = '' ) {
3304
3305 $settings = $this->get_settings_for_display();
3306
3307 $type = $settings['premium_video_box_video_type'];
3308
3309 if ( 'self' === $type ) {
3310 return array(
3311 'link' => '',
3312 'id' => '',
3313 );
3314 }
3315
3316 $identifier = $settings['premium_video_box_video_id_embed_selection'];
3317
3318 $id = $settings['premium_video_box_video_id'];
3319
3320 $embed = $settings['premium_video_box_video_embed'];
3321
3322 $link = $video_url;
3323
3324 if ( empty( $video_url ) ) {
3325 $link = $settings['premium_video_box_link'];
3326 }
3327
3328 if ( ! empty( $link ) ) {
3329
3330 $video_props = Embed::get_video_properties( $link );
3331 $link = Embed::get_embed_url( $link );
3332 $id = $video_props['video_id'];
3333
3334 } elseif ( ! empty( $id ) || ! empty( $embed ) ) {
3335
3336 if ( 'id' === $identifier ) {
3337 $link = 'youtube' === $type ? sprintf( 'https://www.youtube.com/embed/%s', $id ) : sprintf( 'https://player.vimeo.com/video/%s', $id );
3338 } else {
3339 $link = $embed;
3340 }
3341 }
3342
3343 return array(
3344 'link' => $link,
3345 'id' => $id,
3346 );
3347 }
3348
3349 /**
3350 * Get Vimeo header.
3351 *
3352 * Get Vimeo video meta data.
3353 *
3354 * @access private
3355 *
3356 * @param string $id video ID.
3357 */
3358 private function get_vimeo_header( $id ) {
3359
3360 $settings = $this->get_settings_for_display();
3361
3362 if ( 'vimeo' !== $settings['premium_video_box_video_type'] ) {
3363 return;
3364 }
3365
3366 $vimeo_data = Helper_Functions::get_vimeo_video_data( $id );
3367
3368 if ( 'yes' === $settings['vimeo_portrait'] || 'yes' === $settings['vimeo_title'] || 'yes' === $settings['vimeo_byline']
3369 ) {
3370 ?>
3371 <div class="premium-video-box-vimeo-wrap">
3372 <?php if ( 'yes' === $settings['vimeo_portrait'] && ! empty( $vimeo_data['portrait'] ) ) { ?>
3373 <div class="premium-video-box-vimeo-portrait">
3374 <a href="<?php echo esc_url( $vimeo_data['url'] ); ?>" target="_blank">
3375 <img src="<?php echo esc_url( $vimeo_data['portrait'] ); ?>" alt="<?php echo esc_attr( $vimeo_data['user'] ); ?>">
3376 </a>
3377 </div>
3378 <?php } ?>
3379 <?php
3380 if ( 'yes' === $settings['vimeo_title'] || 'yes' === $settings['vimeo_byline'] ) {
3381 ?>
3382 <div class="premium-video-box-vimeo-headers">
3383 <?php if ( 'yes' === $settings['vimeo_title'] && ! empty( $vimeo_data['title'] ) ) { ?>
3384 <div class="premium-video-box-vimeo-title">
3385 <a href="<?php echo esc_url( $settings['premium_video_box_link'] ); ?>" target="_blank">
3386 <?php echo wp_kses_post( $vimeo_data['title'] ); ?>
3387 </a>
3388 </div>
3389 <?php } ?>
3390 <?php if ( 'yes' === $settings['vimeo_byline'] && ! empty( $vimeo_data['user'] ) ) { ?>
3391 <div class="premium-video-box-vimeo-byline">
3392 <?php echo esc_html__( 'from ', 'premium-addons-for-elementor' ); ?> <a href="<?php echo esc_url( $vimeo_data['url'] ); ?>" target="_blank"><?php echo wp_kses_post( $vimeo_data['user'] ); ?></a>
3393 </div>
3394 <?php } ?>
3395 </div>
3396 <?php } ?>
3397 </div>
3398 <?php } ?>
3399 <?php
3400
3401 return isset( $vimeo_data['user'] ) ? true : false;
3402 }
3403
3404 /**
3405 * Has Image Overlay
3406 *
3407 * Check if video overlay option is enabled
3408 *
3409 * @access private
3410 *
3411 * @return boolean video overlay.
3412 */
3413 private function has_image_overlay() {
3414
3415 $settings = $this->get_settings_for_display();
3416
3417 return ! empty( $settings['premium_video_box_image']['url'] ) && 'yes' === $settings['premium_video_box_image_switcher'];
3418 }
3419
3420 /**
3421 * Render Youtube Playlist
3422 *
3423 * Render the HTML Markup for a Youtube playlist
3424 *
3425 * @since 4.0.0
3426 * @access private
3427 *
3428 * @param array $playlist_videos Playlist Videos.
3429 */
3430 private function render_grid_youtube_playlist( $playlist_videos ) {
3431
3432 $settings = $this->get_settings_for_display();
3433
3434 $source = $settings['source'];
3435
3436 $lightbox = $settings['video_lightbox'];
3437
3438 $limit = 9999;
3439
3440 if ( ! empty( $settings['limit_num'] ) ) {
3441 $limit = $settings['limit_num'];
3442 }
3443
3444 $this->add_render_attribute(
3445 'playlist_container',
3446 array(
3447 'class' => 'premium-video-box-playlist-container',
3448 )
3449 );
3450
3451 if ( 'yes' === $lightbox ) {
3452
3453 $this->add_render_attribute(
3454 'playlist_container',
3455 array(
3456 'data-lightbox' => wp_json_encode(
3457 array(
3458 'type' => $settings['video_lightbox_style'],
3459 'theme' => $settings['video_lightbox_theme'],
3460 )
3461 ),
3462 )
3463 );
3464 }
3465
3466 ?>
3467 <div <?php $this->print_render_attribute_string( 'playlist_container' ); ?>>
3468 <?php
3469 if ( count( $playlist_videos ) ) {
3470
3471 $limit_counter = 0;
3472
3473 foreach ( $playlist_videos as $index => $video ) {
3474
3475 if ( 'playlist' === $source ) {
3476 $id = $video->snippet->resourceId->videoId;
3477 } else {
3478
3479 if ( ! isset( $video->id->videoId ) ) {
3480 continue;
3481 }
3482
3483 $id = $video->id->videoId;
3484 }
3485
3486 if ( 'playlist' === $source && ! in_array( $video->status->privacyStatus, array( 'public', 'unlisted' ), true ) ) {
3487 continue;
3488 }
3489
3490 if ( $limit_counter === $limit ) {
3491 break;
3492 }
3493
3494 ++$limit_counter;
3495
3496 $video_url = sprintf( 'https://www.youtube.com/watch?v=%s', $id );
3497
3498 $video_params = $this->get_video_params( $video_url );
3499
3500 $link = $video_params['link'];
3501
3502 $size = $settings['premium_video_box_yt_thumbnail_size'];
3503
3504 $thumbnails_url = sprintf( 'url(\'https://i.ytimg.com/vi/%s/%s.jpg\')', $id, $size );
3505
3506 $related = $settings['premium_video_box_suggested_videos'];
3507
3508 $mute = $settings['premium_video_box_mute'];
3509
3510 $loop = $settings['premium_video_box_loop'];
3511
3512 $playsinline = $settings['play_inline'];
3513
3514 $options = '&rel=';
3515 $options .= 'yes' === $related ? '1' : '0';
3516 $options .= '&mute=';
3517 $options .= 'yes' === $mute ? '1' : '0';
3518 $options .= '&loop=';
3519 $options .= 'yes' === $loop ? '1' : '0';
3520 $options .= '&playsinline=';
3521 $options .= 'yes' === $playsinline ? '1' : '0';
3522
3523 if ( $settings['premium_video_box_start'] ) {
3524 $options .= '&start=' . $settings['premium_video_box_start'];
3525 }
3526
3527 if ( $settings['premium_video_box_end'] ) {
3528 $options .= '&end=' . $settings['premium_video_box_end'];
3529 }
3530
3531 if ( 'yes' === $settings['youtube_videos_title'] ) {
3532 $video_title = $video->snippet->title;
3533
3534 $vid_title_tag = Helper_Functions::validate_html_tag( $settings['youtube_videos_title_tag'] );
3535 }
3536
3537 $title_link = 'yes' === $settings['youtube_videos_title_link'] ? '<a href="' . $video_url . '" target="_blank">' : '';
3538
3539 $link_close = 'yes' === $settings['youtube_videos_title_link'] ? '</a>' : '';
3540
3541 if ( 'yes' === $lightbox ) {
3542
3543 $lightbox_key = 'video_lightbox_' . $id;
3544
3545 $lightbox_options = array(
3546 'privacy' => 'yes',
3547 );
3548
3549 if ( 'elementor' === $settings['video_lightbox_style'] ) {
3550
3551 $this->add_render_attribute(
3552 'video_container' . $id,
3553 array(
3554 'data-elementor-open-lightbox' => 'yes',
3555 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ),
3556 'data-elementor-lightbox-video' => $link,
3557 'data-elementor-lightbox-slideshow' => count( $playlist_videos ) > 1 ? $this->get_id() : false,
3558 )
3559 );
3560 } else {
3561
3562 $rel = sprintf( 'prettyPhoto[premium-videobox-%s]', $this->get_id() );
3563
3564 $this->add_render_attribute(
3565 'video_lightbox_container' . $id,
3566 array(
3567 'class' => 'premium-vid-lightbox-container',
3568 'data-rel' => $rel,
3569 'href' => $link . $options . '&autoplay=1&iframe=true',
3570 )
3571 );
3572 }
3573 } else {
3574 $this->add_render_attribute(
3575 'video_container' . $id,
3576 array(
3577 'data-src' => $link . $options,
3578 )
3579 );
3580 }
3581
3582 $this->add_render_attribute(
3583 'video_container' . $id,
3584 array(
3585 'class' => 'premium-video-box-video-container',
3586 )
3587 );
3588
3589 $this->add_render_attribute(
3590 'container' . $id,
3591 array(
3592 'id' => 'premium-video-box-container-' . $id,
3593 'class' => 'premium-video-box-container',
3594 )
3595 );
3596
3597 if ( 'yes' === $settings['privacy_mode'] ) {
3598 $link = str_replace( '.com', '-nocookie.com', $link );
3599 }
3600
3601 $this->add_render_attribute(
3602 'image_container' . $id,
3603 array(
3604 'style' => 'background-image:' . $thumbnails_url,
3605 'class' => array(
3606 'premium-video-box-image-container',
3607 $settings['premium_video_box_img_effect'],
3608 ),
3609 )
3610 );
3611
3612 $this->add_render_attribute( 'mask' . $id, 'class', 'premium-video-box-trigger' );
3613
3614 if ( 'yes' === $settings['mask_video_box_switcher'] ) {
3615
3616 $this->add_render_attribute( 'container' . $id, 'data-pa-mask', 'true' );
3617 $this->add_render_attribute( 'mask' . $id, 'class', 'premium-video-box-mask-media' );
3618
3619 if ( 'blur' === $settings['premium_video_box_img_effect'] ) {
3620 $this->add_render_attribute( 'image_container' . $id, 'class', 'premium-video-box-mask-media' );
3621 }
3622
3623 if ( '' !== $settings['mask_shape_video_box']['url'] && 'yes' === $settings['video_box_shadow'] ) {
3624
3625 $this->add_render_attribute( 'container' . $id, 'class', 'premium-video-box-mask-filter' );
3626
3627 }
3628 }
3629
3630 ?>
3631
3632 <?php
3633
3634 if ( $index < 2 && 'layout2' === $settings['playlist_layout'] ) :
3635 ?>
3636 <div class="premium-videobox-column">
3637 <?php endif; ?>
3638
3639 <div <?php $this->print_render_attribute_string( 'container' . $id ); ?>>
3640 <div <?php $this->print_render_attribute_string( 'mask' . $id ); ?>>
3641 <div <?php $this->print_render_attribute_string( 'video_container' . $id ); ?>>
3642 <?php if ( 'yes' === $lightbox && $settings['video_lightbox_style'] ) : ?>
3643 <a <?php $this->print_render_attribute_string( 'video_lightbox_container' . $id ); ?>></a>
3644 <?php endif; ?>
3645 </div>
3646 <div <?php $this->print_render_attribute_string( 'image_container' . $id ); ?> ></div>
3647 <?php if ( 'yes' === $settings['premium_video_box_play_icon_switcher'] ) : ?>
3648 <div class="premium-video-box-play-icon-container">
3649 <?php
3650 Icons_Manager::render_icon(
3651 array(
3652 'library' => 'eicons',
3653 'value' => 'eicon-play',
3654 ),
3655 array(
3656 'class' => array( 'premium-video-box-play-icon' ),
3657 'aria-hidden' => 'true',
3658 )
3659 );
3660 ?>
3661 </div>
3662 <?php endif; ?>
3663 </div>
3664 <?php
3665 if ( 'yes' === $settings['youtube_videos_title'] ) :
3666 echo wp_kses_post( $title_link );
3667 ?>
3668 <<?php echo wp_kses_post( $vid_title_tag ); ?> class="premium-youtube-vid-title" > <?php echo esc_html( $video_title ); ?> </<?php echo wp_kses_post( $vid_title_tag ); ?>>
3669 <?php
3670 echo wp_kses_post( $link_close );
3671 endif;
3672 ?>
3673 </div>
3674
3675 <?php if ( 0 === $index && 'layout2' === $settings['playlist_layout'] ) : ?>
3676 </div>
3677 <?php endif; ?>
3678
3679 <?php
3680
3681 }
3682
3683 if ( 'layout2' === $settings['playlist_layout'] ) :
3684 ?>
3685 </div>
3686 <?php
3687 endif;
3688 }
3689 ?>
3690 </div>
3691 <?php
3692 }
3693
3694 /**
3695 * Fetch Youtube Playlist Data
3696 *
3697 * Fetch API Data for a Youtube playlist
3698 *
3699 * @since 4.0.0
3700 * @access private
3701 */
3702 private function fetch_youtube_playlist_data() {
3703
3704 $settings = $this->get_settings_for_display();
3705
3706 $widget_id = $this->get_id();
3707
3708 $api_key = Admin_Helper::get_integrations_settings()['premium-youtube-api'];
3709
3710 if ( empty( $api_key ) || '1' === $api_key ) { // phpcs:ignore WordPress.PHP.StrictComparisons
3711 ?>
3712 <div class="premium-error-notice">
3713 <?php
3714 $doc_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/how-to-enable-youtube-data-api-for-premium-video-box-widget/', 'video-widget', 'wp-editor', 'get-support' );
3715 $message = __( 'Please make sure to set your Youtube API key in ', 'premium-addons-for-elementor' );
3716 $message .= sprintf( '<a href="%1$s" target="_blank">%2$s</a>', admin_url( 'admin.php?page=premium-addons#tab=integrations' ), __( 'Integrations', 'premium-addons-for-elementor' ) );
3717 $message .= __( ' tab. For further information about getting an API key, please check this ', 'premium-addons-for-elementor' );
3718 $message .= sprintf( '<a href="%1$s" target="_blank">%2$s</a>', $doc_url, __( 'article', 'premium-addons-for-elementor' ) );
3719 echo wp_kses_post( $message );
3720 ?>
3721 </div>
3722 <?php
3723 return false;
3724 }
3725
3726 if ( empty( $settings['playlist_id'] ) && empty( $settings['channel_id'] ) ) {
3727 ?>
3728 <div class="premium-error-notice">
3729 <?php echo esc_html__( 'Please Enter a Valid API Key & Channel/Playlist ID', 'premium-addons-for-elementor' ); ?>
3730 </div>
3731 <?php
3732 return false;
3733 }
3734
3735 if ( 'playlist' === $settings['source'] ) {
3736
3737 $source = $settings['playlist_id'];
3738 $api_url = 'https://www.googleapis.com/youtube/v3/playlistItems?key=' . $api_key . '&playlistId=' . $source . '&part=snippet,id,status&order=date&maxResults=50';
3739 } else {
3740 $source = $settings['channel_id'];
3741 $api_url = 'https://www.googleapis.com/youtube/v3/search?key=' . $api_key . '&channelId=' . $source . '&part=snippet,id&order=date&maxResults=50';
3742 }
3743
3744 $transient_name = sprintf( 'pa_videos_%s_%s', $source, $widget_id );
3745
3746 $response_json = get_transient( $transient_name );
3747
3748 if ( false === $response_json ) {
3749
3750 $api_response = wp_remote_get( $api_url ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get -- Core HTTP API; plugin is not VIP-hosted and vip_safe_wp_remote_get() is unavailable.
3751
3752 $response_json = wp_remote_retrieve_body( $api_response );
3753 $response_json = json_decode( $response_json );
3754
3755 $transient = $settings['reload'];
3756
3757 $expire_time = Helper_Functions::transient_expire( $transient );
3758
3759 if ( isset( $response_json->items ) ) {
3760 set_transient( $transient_name, $response_json, $expire_time );
3761 }
3762 }
3763
3764 $playlist_videos = isset( $response_json->items ) ? $response_json->items : '';
3765
3766 if ( empty( $playlist_videos ) ) {
3767 ?>
3768 <div class="premium-error-notice">
3769 <?php echo esc_html__( 'Something went wrong. It seems like the playlist you selected does not have any videos', 'premium-addons-for-elementor' ); ?>
3770 </div>
3771 <?php
3772 return false;
3773 }
3774
3775 $this->render_grid_youtube_playlist( $playlist_videos );
3776 }
3777
3778 /**
3779 * Update Controls
3780 *
3781 * @since 4.9.58
3782 * @access private
3783 */
3784 private function update_controls() {
3785
3786 $this->update_responsive_control(
3787 'premium_video_box_image_border_radius',
3788 array(
3789 'type' => Controls_Manager::DIMENSIONS,
3790 'selectors' => array(
3791 '{{WRAPPER}} .premium-video-box-image-container, {{WRAPPER}} .premium-video-box-video-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
3792 ),
3793 'condition' => array(
3794 'adv_radius!' => 'yes',
3795 ),
3796
3797 )
3798 );
3799 }
3800 }
3801