PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.2
Elementor Website Builder – more than just a page builder v3.0.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/widgets/video.php +155 -451 4.0.73.0.2 View file →
@@ -1,9 +1,8 @@
1 1 <?php
2 2 namespace Elementor;
3 3
4 4 use Elementor\Modules\DynamicTags\Module as TagsModule;
5 -use Elementor\Modules\Promotions\Controls\Promotion_Control;
6 5
7 6 if ( ! defined( 'ABSPATH' ) ) {
8 7 exit; // Exit if accessed directly.
9 8 }
@@ -41,9 +40,9 @@
41 40 *
42 41 * @return string Widget title.
43 42 */
44 43 public function get_title() {
45 - return esc_html__( 'Video', 'elementor' );
44 + return __( 'Video', 'elementor' );
46 45 }
47 46
48 47 /**
49 48 * Get widget icon.
@@ -85,68 +84,24 @@
85 84 *
86 85 * @return array Widget keywords.
87 86 */
88 87 public function get_keywords() {
89 - return [ 'video', 'player', 'embed', 'youtube', 'vimeo', 'dailymotion', 'videopress' ];
88 + return [ 'video', 'player', 'embed', 'youtube', 'vimeo', 'dailymotion' ];
90 89 }
91 90
92 - protected function is_dynamic_content(): bool {
93 - return false;
94 - }
95 -
96 91 /**
97 - * Get style dependencies.
98 - *
99 - * Retrieve the list of style dependencies the widget requires.
100 - *
101 - * @since 3.24.0
102 - * @access public
103 - *
104 - * @return array Widget style dependencies.
105 - */
106 - public function get_style_depends(): array {
107 - return [ 'widget-video' ];
108 - }
109 -
110 - public function has_widget_inner_wrapper(): bool {
111 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
112 - }
113 -
114 - /**
115 92 * Register video widget controls.
116 93 *
117 94 * Adds different input fields to allow the user to change and customize the widget settings.
118 95 *
119 - * @since 3.19.0
96 + * @since 1.0.0
120 97 * @access protected
121 - *
122 - * @return array Widget promotion data.
123 98 */
124 - protected function get_upsale_data() {
125 - return [
126 - 'condition' => ! Utils::has_pro(),
127 - 'image' => esc_url( ELEMENTOR_ASSETS_URL . 'images/go-pro.svg' ),
128 - 'image_alt' => esc_attr__( 'Upgrade', 'elementor' ),
129 - 'title' => esc_html__( "Grab your visitors' attention", 'elementor' ),
130 - 'description' => esc_html__( 'Get the Video Playlist widget and grow your toolbox with Elementor Pro.', 'elementor' ),
131 - 'upgrade_url' => esc_url( 'https://go.elementor.com/go-pro-video-widget/' ),
132 - 'upgrade_text' => esc_html__( 'Upgrade Now', 'elementor' ),
133 - ];
134 - }
135 -
136 - /**
137 - * Register video widget controls.
138 - *
139 - * Adds different input fields to allow the user to change and customize the widget settings.
140 - *
141 - * @since 3.1.0
142 - * @access protected
143 - */
144 - protected function register_controls() {
99 + protected function _register_controls() {
145 100 $this->start_controls_section(
146 101 'section_video',
147 102 [
148 - 'label' => esc_html__( 'Video', 'elementor' ),
103 + 'label' => __( 'Video', 'elementor' ),
149 104 ]
150 105 );
151 106
152 107 $this->add_control(
@@ -151,19 +106,17 @@
151 106
152 107 $this->add_control(
153 108 'video_type',
154 109 [
155 - 'label' => esc_html__( 'Source', 'elementor' ),
110 + 'label' => __( 'Source', 'elementor' ),
156 111 'type' => Controls_Manager::SELECT,
157 112 'default' => 'youtube',
158 113 'options' => [
159 - 'youtube' => esc_html__( 'YouTube', 'elementor' ),
160 - 'vimeo' => esc_html__( 'Vimeo', 'elementor' ),
161 - 'dailymotion' => esc_html__( 'Dailymotion', 'elementor' ),
162 - 'videopress' => esc_html__( 'VideoPress', 'elementor' ),
163 - 'hosted' => esc_html__( 'Self Hosted', 'elementor' ),
114 + 'youtube' => __( 'YouTube', 'elementor' ),
115 + 'vimeo' => __( 'Vimeo', 'elementor' ),
116 + 'dailymotion' => __( 'Dailymotion', 'elementor' ),
117 + 'hosted' => __( 'Self Hosted', 'elementor' ),
164 118 ],
165 - 'frontend_available' => true,
166 119 ]
167 120 );
168 121
169 122 $this->add_control(
@@ -168,9 +121,9 @@
168 121
169 122 $this->add_control(
170 123 'youtube_url',
171 124 [
172 - 'label' => esc_html__( 'Link', 'elementor' ),
125 + 'label' => __( 'Link', 'elementor' ),
173 126 'type' => Controls_Manager::TEXT,
174 127 'dynamic' => [
175 128 'active' => true,
176 129 'categories' => [
@@ -177,18 +130,14 @@
177 130 TagsModule::POST_META_CATEGORY,
178 131 TagsModule::URL_CATEGORY,
179 132 ],
180 133 ],
181 - 'placeholder' => esc_html__( 'Enter your URL', 'elementor' ) . ' (YouTube)',
134 + 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (YouTube)',
182 135 'default' => 'https://www.youtube.com/watch?v=XHOmBV4js_E',
183 136 'label_block' => true,
184 137 'condition' => [
185 138 'video_type' => 'youtube',
186 139 ],
187 - 'ai' => [
188 - 'active' => false,
189 - ],
190 - 'frontend_available' => true,
191 140 ]
192 141 );
193 142
194 143 $this->add_control(
@@ -193,9 +142,9 @@
193 142
194 143 $this->add_control(
195 144 'vimeo_url',
196 145 [
197 - 'label' => esc_html__( 'Link', 'elementor' ),
146 + 'label' => __( 'Link', 'elementor' ),
198 147 'type' => Controls_Manager::TEXT,
199 148 'dynamic' => [
200 149 'active' => true,
201 150 'categories' => [
@@ -202,17 +151,14 @@
202 151 TagsModule::POST_META_CATEGORY,
203 152 TagsModule::URL_CATEGORY,
204 153 ],
205 154 ],
206 - 'placeholder' => esc_html__( 'Enter your URL', 'elementor' ) . ' (Vimeo)',
155 + 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (Vimeo)',
207 156 'default' => 'https://vimeo.com/235215203',
208 157 'label_block' => true,
209 158 'condition' => [
210 159 'video_type' => 'vimeo',
211 160 ],
212 - 'ai' => [
213 - 'active' => false,
214 - ],
215 161 ]
216 162 );
217 163
218 164 $this->add_control(
@@ -217,9 +163,9 @@
217 163
218 164 $this->add_control(
219 165 'dailymotion_url',
220 166 [
221 - 'label' => esc_html__( 'Link', 'elementor' ),
167 + 'label' => __( 'Link', 'elementor' ),
222 168 'type' => Controls_Manager::TEXT,
223 169 'dynamic' => [
224 170 'active' => true,
225 171 'categories' => [
@@ -226,17 +172,14 @@
226 172 TagsModule::POST_META_CATEGORY,
227 173 TagsModule::URL_CATEGORY,
228 174 ],
229 175 ],
230 - 'placeholder' => esc_html__( 'Enter your URL', 'elementor' ) . ' (Dailymotion)',
176 + 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (Dailymotion)',
231 177 'default' => 'https://www.dailymotion.com/video/x6tqhqb',
232 178 'label_block' => true,
233 179 'condition' => [
234 180 'video_type' => 'dailymotion',
235 181 ],
236 - 'ai' => [
237 - 'active' => false,
238 - ],
239 182 ]
240 183 );
241 184
242 185 $this->add_control(
@@ -241,12 +184,12 @@
241 184
242 185 $this->add_control(
243 186 'insert_url',
244 187 [
245 - 'label' => esc_html__( 'External URL', 'elementor' ),
188 + 'label' => __( 'External URL', 'elementor' ),
246 189 'type' => Controls_Manager::SWITCHER,
247 190 'condition' => [
248 - 'video_type' => [ 'hosted', 'videopress' ],
191 + 'video_type' => 'hosted',
249 192 ],
250 193 ]
251 194 );
252 195
@@ -252,9 +195,9 @@
252 195
253 196 $this->add_control(
254 197 'hosted_url',
255 198 [
256 - 'label' => esc_html__( 'Choose Video File', 'elementor' ),
199 + 'label' => __( 'Choose File', 'elementor' ),
257 200 'type' => Controls_Manager::MEDIA,
258 201 'dynamic' => [
259 202 'active' => true,
260 203 'categories' => [
@@ -260,13 +203,11 @@
260 203 'categories' => [
261 204 TagsModule::MEDIA_CATEGORY,
262 205 ],
263 206 ],
264 - 'media_types' => [
265 - 'video',
266 - ],
207 + 'media_type' => 'video',
267 208 'condition' => [
268 - 'video_type' => [ 'hosted', 'videopress' ],
209 + 'video_type' => 'hosted',
269 210 'insert_url' => '',
270 211 ],
271 212 ]
272 213 );
@@ -273,9 +214,9 @@
273 214
274 215 $this->add_control(
275 216 'external_url',
276 217 [
277 - 'label' => esc_html__( 'URL', 'elementor' ),
218 + 'label' => __( 'URL', 'elementor' ),
278 219 'type' => Controls_Manager::URL,
279 220 'autocomplete' => false,
280 221 'options' => false,
281 222 'label_block' => true,
@@ -286,9 +227,10 @@
286 227 TagsModule::POST_META_CATEGORY,
287 228 TagsModule::URL_CATEGORY,
288 229 ],
289 230 ],
290 - 'placeholder' => esc_html__( 'Enter your URL', 'elementor' ),
231 + 'media_type' => 'video',
232 + 'placeholder' => __( 'Enter your URL', 'elementor' ),
291 233 'condition' => [
292 234 'video_type' => 'hosted',
293 235 'insert_url' => 'yes',
294 236 ],
@@ -295,55 +237,29 @@
295 237 ]
296 238 );
297 239
298 240 $this->add_control(
299 - 'videopress_url',
241 + 'start',
300 242 [
301 - 'label' => esc_html__( 'URL', 'elementor' ),
302 - 'type' => Controls_Manager::TEXT,
303 - 'label_block' => true,
304 - 'show_label' => false,
305 - 'default' => 'https://videopress.com/v/ZCAOzTNk',
306 - 'dynamic' => [
307 - 'active' => true,
308 - 'categories' => [
309 - TagsModule::POST_META_CATEGORY,
310 - TagsModule::URL_CATEGORY,
311 - ],
312 - ],
313 - 'placeholder' => esc_html__( 'VideoPress URL', 'elementor' ),
314 - 'ai' => [
315 - 'active' => false,
316 - ],
243 + 'label' => __( 'Start Time', 'elementor' ),
244 + 'type' => Controls_Manager::NUMBER,
245 + 'description' => __( 'Specify a start time (in seconds)', 'elementor' ),
317 246 'condition' => [
318 - 'video_type' => 'videopress',
319 - 'insert_url' => 'yes',
247 + 'loop' => '',
320 248 ],
321 -
322 249 ]
323 250 );
324 251
325 252 $this->add_control(
326 - 'start',
327 - [
328 - 'label' => esc_html__( 'Start Time', 'elementor' ),
329 - 'type' => Controls_Manager::NUMBER,
330 - 'description' => esc_html__( 'Specify a start time (in seconds)', 'elementor' ),
331 - 'frontend_available' => true,
332 - 'separator' => 'before',
333 - ]
334 - );
335 -
336 - $this->add_control(
337 253 'end',
338 254 [
339 - 'label' => esc_html__( 'End Time', 'elementor' ),
255 + 'label' => __( 'End Time', 'elementor' ),
340 256 'type' => Controls_Manager::NUMBER,
341 - 'description' => esc_html__( 'Specify an end time (in seconds)', 'elementor' ),
257 + 'description' => __( 'Specify an end time (in seconds)', 'elementor' ),
342 258 'condition' => [
259 + 'loop' => '',
343 260 'video_type' => [ 'youtube', 'hosted' ],
344 261 ],
345 - 'frontend_available' => true,
346 262 ]
347 263 );
348 264
349 265 $this->add_control(
@@ -348,9 +264,9 @@
348 264
349 265 $this->add_control(
350 266 'video_options',
351 267 [
352 - 'label' => esc_html__( 'Video Options', 'elementor' ),
268 + 'label' => __( 'Video Options', 'elementor' ),
353 269 'type' => Controls_Manager::HEADING,
354 270 'separator' => 'before',
355 271 ]
356 272 );
@@ -357,17 +273,10 @@
357 273
358 274 $this->add_control(
359 275 'autoplay',
360 276 [
361 - 'label' => esc_html__( 'Autoplay', 'elementor' ),
362 - 'description' => sprintf(
363 - /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
364 - esc_html__( 'Note: Autoplay is affected by %1$s Google’s Autoplay policy %2$s on Chrome browsers.', 'elementor' ),
365 - '<a href="https://developers.google.com/web/updates/2017/09/autoplay-policy-changes" target="_blank">',
366 - '</a>'
367 - ),
277 + 'label' => __( 'Autoplay', 'elementor' ),
368 278 'type' => Controls_Manager::SWITCHER,
369 - 'frontend_available' => true,
370 279 ]
371 280 );
372 281
373 282 $this->add_control(
@@ -372,14 +281,13 @@
372 281
373 282 $this->add_control(
374 283 'play_on_mobile',
375 284 [
376 - 'label' => esc_html__( 'Play On Mobile', 'elementor' ),
285 + 'label' => __( 'Play On Mobile', 'elementor' ),
377 286 'type' => Controls_Manager::SWITCHER,
378 287 'condition' => [
379 288 'autoplay' => 'yes',
380 289 ],
381 - 'frontend_available' => true,
382 290 ]
383 291 );
384 292
385 293 $this->add_control(
@@ -384,11 +292,10 @@
384 292
385 293 $this->add_control(
386 294 'mute',
387 295 [
388 - 'label' => esc_html__( 'Mute', 'elementor' ),
296 + 'label' => __( 'Mute', 'elementor' ),
389 297 'type' => Controls_Manager::SWITCHER,
390 - 'frontend_available' => true,
391 298 ]
392 299 );
393 300
394 301 $this->add_control(
@@ -393,14 +300,13 @@
393 300
394 301 $this->add_control(
395 302 'loop',
396 303 [
397 - 'label' => esc_html__( 'Loop', 'elementor' ),
304 + 'label' => __( 'Loop', 'elementor' ),
398 305 'type' => Controls_Manager::SWITCHER,
399 306 'condition' => [
400 307 'video_type!' => 'dailymotion',
401 308 ],
402 - 'frontend_available' => true,
403 309 ]
404 310 );
405 311
406 312 $this->add_control(
@@ -405,17 +311,16 @@
405 311
406 312 $this->add_control(
407 313 'controls',
408 314 [
409 - 'label' => esc_html__( 'Player Controls', 'elementor' ),
315 + 'label' => __( 'Player Controls', 'elementor' ),
410 316 'type' => Controls_Manager::SWITCHER,
411 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
412 - 'label_on' => esc_html__( 'Show', 'elementor' ),
317 + 'label_off' => __( 'Hide', 'elementor' ),
318 + 'label_on' => __( 'Show', 'elementor' ),
413 319 'default' => 'yes',
414 320 'condition' => [
415 321 'video_type!' => 'vimeo',
416 322 ],
417 - 'frontend_available' => true,
418 323 ]
419 324 );
420 325
421 326 $this->add_control(
@@ -420,12 +325,12 @@
420 325
421 326 $this->add_control(
422 327 'showinfo',
423 328 [
424 - 'label' => esc_html__( 'Video Info', 'elementor' ),
329 + 'label' => __( 'Video Info', 'elementor' ),
425 330 'type' => Controls_Manager::SWITCHER,
426 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
427 - 'label_on' => esc_html__( 'Show', 'elementor' ),
331 + 'label_off' => __( 'Hide', 'elementor' ),
332 + 'label_on' => __( 'Show', 'elementor' ),
428 333 'default' => 'yes',
429 334 'condition' => [
430 335 'video_type' => [ 'dailymotion' ],
431 336 ],
@@ -432,17 +337,16 @@
432 337 ]
433 338 );
434 339
435 340 $this->add_control(
436 - 'cc_load_policy',
341 + 'modestbranding',
437 342 [
438 - 'label' => esc_html__( 'Captions', 'elementor' ),
343 + 'label' => __( 'Modest Branding', 'elementor' ),
439 344 'type' => Controls_Manager::SWITCHER,
440 345 'condition' => [
441 346 'video_type' => [ 'youtube' ],
442 347 'controls' => 'yes',
443 348 ],
444 - 'frontend_available' => true,
445 349 ]
446 350 );
447 351
448 352 $this->add_control(
@@ -447,12 +351,12 @@
447 351
448 352 $this->add_control(
449 353 'logo',
450 354 [
451 - 'label' => esc_html__( 'Logo', 'elementor' ),
355 + 'label' => __( 'Logo', 'elementor' ),
452 356 'type' => Controls_Manager::SWITCHER,
453 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
454 - 'label_on' => esc_html__( 'Show', 'elementor' ),
357 + 'label_off' => __( 'Hide', 'elementor' ),
358 + 'label_on' => __( 'Show', 'elementor' ),
455 359 'default' => 'yes',
456 360 'condition' => [
457 361 'video_type' => [ 'dailymotion' ],
458 362 ],
@@ -462,60 +366,25 @@
462 366 // YouTube.
463 367 $this->add_control(
464 368 'yt_privacy',
465 369 [
466 - 'label' => esc_html__( 'Privacy Mode', 'elementor' ),
370 + 'label' => __( 'Privacy Mode', 'elementor' ),
467 371 'type' => Controls_Manager::SWITCHER,
468 - 'description' => esc_html__( 'When you turn on privacy mode, YouTube/Vimeo won\'t store information about visitors on your website unless they play the video.', 'elementor' ),
372 + 'description' => __( 'When you turn on privacy mode, YouTube won\'t store information about visitors on your website unless they play the video.', 'elementor' ),
469 373 'condition' => [
470 - 'video_type' => [ 'youtube', 'vimeo' ],
374 + 'video_type' => 'youtube',
471 375 ],
472 - 'frontend_available' => true,
473 376 ]
474 377 );
475 378
476 379 $this->add_control(
477 - 'lazy_load',
478 - [
479 - 'label' => esc_html__( 'Lazy Load', 'elementor' ),
480 - 'type' => Controls_Manager::SWITCHER,
481 - 'conditions' => [
482 - 'relation' => 'or',
483 - 'terms' => [
484 - [
485 - 'name' => 'video_type',
486 - 'operator' => '===',
487 - 'value' => 'youtube',
488 - ],
489 - [
490 - 'relation' => 'and',
491 - 'terms' => [
492 - [
493 - 'name' => 'show_image_overlay',
494 - 'operator' => '===',
495 - 'value' => 'yes',
496 - ],
497 - [
498 - 'name' => 'video_type',
499 - 'operator' => '!==',
500 - 'value' => 'hosted',
501 - ],
502 - ],
503 - ],
504 - ],
505 - ],
506 - 'frontend_available' => true,
507 - ]
508 - );
509 -
510 - $this->add_control(
511 380 'rel',
512 381 [
513 - 'label' => esc_html__( 'Suggested Videos', 'elementor' ),
382 + 'label' => __( 'Suggested Videos', 'elementor' ),
514 383 'type' => Controls_Manager::SELECT,
515 384 'options' => [
516 - '' => esc_html__( 'Current Video Channel', 'elementor' ),
517 - 'yes' => esc_html__( 'Any Video', 'elementor' ),
385 + '' => __( 'Current Video Channel', 'elementor' ),
386 + 'yes' => __( 'Any Video', 'elementor' ),
518 387 ],
519 388 'condition' => [
520 389 'video_type' => 'youtube',
521 390 ],
@@ -525,12 +394,12 @@
525 394 // Vimeo.
526 395 $this->add_control(
527 396 'vimeo_title',
528 397 [
529 - 'label' => esc_html__( 'Intro Title', 'elementor' ),
398 + 'label' => __( 'Intro Title', 'elementor' ),
530 399 'type' => Controls_Manager::SWITCHER,
531 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
532 - 'label_on' => esc_html__( 'Show', 'elementor' ),
400 + 'label_off' => __( 'Hide', 'elementor' ),
401 + 'label_on' => __( 'Show', 'elementor' ),
533 402 'default' => 'yes',
534 403 'condition' => [
535 404 'video_type' => 'vimeo',
536 405 ],
@@ -539,12 +408,12 @@
539 408
540 409 $this->add_control(
541 410 'vimeo_portrait',
542 411 [
543 - 'label' => esc_html__( 'Intro Portrait', 'elementor' ),
412 + 'label' => __( 'Intro Portrait', 'elementor' ),
544 413 'type' => Controls_Manager::SWITCHER,
545 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
546 - 'label_on' => esc_html__( 'Show', 'elementor' ),
414 + 'label_off' => __( 'Hide', 'elementor' ),
415 + 'label_on' => __( 'Show', 'elementor' ),
547 416 'default' => 'yes',
548 417 'condition' => [
549 418 'video_type' => 'vimeo',
550 419 ],
@@ -553,12 +422,12 @@
553 422
554 423 $this->add_control(
555 424 'vimeo_byline',
556 425 [
557 - 'label' => esc_html__( 'Intro Byline', 'elementor' ),
426 + 'label' => __( 'Intro Byline', 'elementor' ),
558 427 'type' => Controls_Manager::SWITCHER,
559 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
560 - 'label_on' => esc_html__( 'Show', 'elementor' ),
428 + 'label_off' => __( 'Hide', 'elementor' ),
429 + 'label_on' => __( 'Show', 'elementor' ),
561 430 'default' => 'yes',
562 431 'condition' => [
563 432 'video_type' => 'vimeo',
564 433 ],
@@ -567,9 +436,9 @@
567 436
568 437 $this->add_control(
569 438 'color',
570 439 [
571 - 'label' => esc_html__( 'Controls Color', 'elementor' ),
440 + 'label' => __( 'Controls Color', 'elementor' ),
572 441 'type' => Controls_Manager::COLOR,
573 442 'default' => '',
574 443 'condition' => [
575 444 'video_type' => [ 'vimeo', 'dailymotion' ],
@@ -579,12 +448,12 @@
579 448
580 449 $this->add_control(
581 450 'download_button',
582 451 [
583 - 'label' => esc_html__( 'Download Button', 'elementor' ),
452 + 'label' => __( 'Download Button', 'elementor' ),
584 453 'type' => Controls_Manager::SWITCHER,
585 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
586 - 'label_on' => esc_html__( 'Show', 'elementor' ),
454 + 'label_off' => __( 'Hide', 'elementor' ),
455 + 'label_on' => __( 'Show', 'elementor' ),
587 456 'condition' => [
588 457 'video_type' => 'hosted',
589 458 ],
590 459 ]
@@ -590,41 +459,24 @@
590 459 ]
591 460 );
592 461
593 462 $this->add_control(
594 - 'preload',
463 + 'poster',
595 464 [
596 - 'label' => esc_html__( 'Preload', 'elementor' ),
597 - 'type' => Controls_Manager::SELECT,
598 - 'options' => [
599 - 'metadata' => esc_html__( 'Metadata', 'elementor' ),
600 - 'auto' => esc_html__( 'Auto', 'elementor' ),
601 - 'none' => esc_html__( 'None', 'elementor' ),
602 - ],
603 - 'description' => sprintf(
604 - '%1$s <a target="_blank" href="https://go.elementor.com/preload-video/">%2$s</a>',
605 - esc_html__( 'Preload attribute lets you specify how the video should be loaded when the page loads.', 'elementor' ),
606 - esc_html__( 'Learn more', 'elementor' ),
607 - ),
608 - 'default' => 'metadata',
465 + 'label' => __( 'Poster', 'elementor' ),
466 + 'type' => Controls_Manager::MEDIA,
609 467 'condition' => [
610 468 'video_type' => 'hosted',
611 - 'autoplay' => '',
612 469 ],
613 470 ]
614 471 );
615 472
616 473 $this->add_control(
617 - 'poster',
474 + 'view',
618 475 [
619 - 'label' => esc_html__( 'Poster', 'elementor' ),
620 - 'type' => Controls_Manager::MEDIA,
621 - 'dynamic' => [
622 - 'active' => true,
623 - ],
624 - 'condition' => [
625 - 'video_type' => 'hosted',
626 - ],
476 + 'label' => __( 'View', 'elementor' ),
477 + 'type' => Controls_Manager::HIDDEN,
478 + 'default' => 'youtube',
627 479 ]
628 480 );
629 481
630 482 $this->end_controls_section();
@@ -631,9 +483,9 @@
631 483
632 484 $this->start_controls_section(
633 485 'section_image_overlay',
634 486 [
635 - 'label' => esc_html__( 'Image Overlay', 'elementor' ),
487 + 'label' => __( 'Image Overlay', 'elementor' ),
636 488 ]
637 489 );
638 490
639 491 $this->add_control(
@@ -638,13 +490,12 @@
638 490
639 491 $this->add_control(
640 492 'show_image_overlay',
641 493 [
642 - 'label' => esc_html__( 'Image Overlay', 'elementor' ),
494 + 'label' => __( 'Image Overlay', 'elementor' ),
643 495 'type' => Controls_Manager::SWITCHER,
644 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
645 - 'label_on' => esc_html__( 'Show', 'elementor' ),
646 - 'frontend_available' => true,
496 + 'label_off' => __( 'Hide', 'elementor' ),
497 + 'label_on' => __( 'Show', 'elementor' ),
647 498 ]
648 499 );
649 500
650 501 $this->add_control(
@@ -649,9 +500,9 @@
649 500
650 501 $this->add_control(
651 502 'image_overlay',
652 503 [
653 - 'label' => esc_html__( 'Choose Image', 'elementor' ),
504 + 'label' => __( 'Choose Image', 'elementor' ),
654 505 'type' => Controls_Manager::MEDIA,
655 506 'default' => [
656 507 'url' => Utils::get_placeholder_image_src(),
657 508 ],
@@ -660,17 +511,29 @@
660 511 ],
661 512 'condition' => [
662 513 'show_image_overlay' => 'yes',
663 514 ],
664 - 'frontend_available' => true,
665 515 ]
666 516 );
667 517
518 + $this->add_control(
519 + 'lazy_load',
520 + [
521 + 'label' => __( 'Lazy Load', 'elementor' ),
522 + 'type' => Controls_Manager::SWITCHER,
523 + 'condition' => [
524 + 'show_image_overlay' => 'yes',
525 + 'video_type!' => 'hosted',
526 + ],
527 + ]
528 + );
529 +
668 530 $this->add_group_control(
669 531 Group_Control_Image_Size::get_type(),
670 532 [
671 533 'name' => 'image_overlay', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `image_overlay_size` and `image_overlay_custom_dimension`.
672 534 'default' => 'full',
535 + 'separator' => 'none',
673 536 'condition' => [
674 537 'show_image_overlay' => 'yes',
675 538 ],
676 539 ]
@@ -678,14 +541,11 @@
678 541
679 542 $this->add_control(
680 543 'show_play_icon',
681 544 [
682 - 'label' => esc_html__( 'Play Icon', 'elementor' ),
545 + 'label' => __( 'Play Icon', 'elementor' ),
683 546 'type' => Controls_Manager::SWITCHER,
684 547 'default' => 'yes',
685 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
686 - 'label_on' => esc_html__( 'Show', 'elementor' ),
687 - 'separator' => 'before',
688 548 'condition' => [
689 549 'show_image_overlay' => 'yes',
690 550 'image_overlay[url]!' => '',
691 551 ],
@@ -692,50 +552,15 @@
692 552 ]
693 553 );
694 554
695 555 $this->add_control(
696 - 'play_icon',
697 - [
698 - 'label' => esc_html__( 'Icon', 'elementor' ),
699 - 'type' => Controls_Manager::ICONS,
700 - 'fa4compatibility' => 'icon',
701 - 'skin' => 'inline',
702 - 'label_block' => false,
703 - 'skin_settings' => [
704 - 'inline' => [
705 - 'none' => [
706 - 'label' => 'Default',
707 - 'icon' => 'eicon-play',
708 - ],
709 - 'icon' => [
710 - 'icon' => 'eicon-star',
711 - ],
712 - ],
713 - ],
714 - 'recommended' => [
715 - 'fa-regular' => [
716 - 'play-circle',
717 - ],
718 - 'fa-solid' => [
719 - 'play',
720 - 'play-circle',
721 - ],
722 - ],
723 - 'condition' => [
724 - 'show_image_overlay' => 'yes',
725 - 'show_play_icon!' => '',
726 - ],
727 - ]
728 - );
729 -
730 - $this->add_control(
731 556 'lightbox',
732 557 [
733 - 'label' => esc_html__( 'Lightbox', 'elementor' ),
558 + 'label' => __( 'Lightbox', 'elementor' ),
734 559 'type' => Controls_Manager::SWITCHER,
735 560 'frontend_available' => true,
736 - 'label_off' => esc_html__( 'Off', 'elementor' ),
737 - 'label_on' => esc_html__( 'On', 'elementor' ),
561 + 'label_off' => __( 'Off', 'elementor' ),
562 + 'label_on' => __( 'On', 'elementor' ),
738 563 'condition' => [
739 564 'show_image_overlay' => 'yes',
740 565 'image_overlay[url]!' => '',
741 566 ],
@@ -747,9 +572,9 @@
747 572
748 573 $this->start_controls_section(
749 574 'section_video_style',
750 575 [
751 - 'label' => esc_html__( 'Video', 'elementor' ),
576 + 'label' => __( 'Video', 'elementor' ),
752 577 'tab' => Controls_Manager::TAB_STYLE,
753 578 ]
754 579 );
755 580
@@ -755,9 +580,9 @@
755 580
756 581 $this->add_control(
757 582 'aspect_ratio',
758 583 [
759 - 'label' => esc_html__( 'Aspect Ratio', 'elementor' ),
584 + 'label' => __( 'Aspect Ratio', 'elementor' ),
760 585 'type' => Controls_Manager::SELECT,
761 586 'options' => [
762 587 '169' => '16:9',
763 588 '219' => '21:9',
@@ -765,20 +590,11 @@
765 590 '32' => '3:2',
766 591 '11' => '1:1',
767 592 '916' => '9:16',
768 593 ],
769 - 'selectors_dictionary' => [
770 - '169' => '1.77777', // 16 / 9
771 - '219' => '2.33333', // 21 / 9
772 - '43' => '1.33333', // 4 / 3
773 - '32' => '1.5', // 3 / 2
774 - '11' => '1', // 1 / 1
775 - '916' => '0.5625', // 9 / 16
776 - ],
777 594 'default' => '169',
778 - 'selectors' => [
779 - '{{WRAPPER}} .elementor-wrapper' => '--video-aspect-ratio: {{VALUE}}',
780 - ],
595 + 'prefix_class' => 'elementor-aspect-ratio-',
596 + 'frontend_available' => true,
781 597 ]
782 598 );
783 599
784 600 $this->add_group_control(
@@ -788,31 +604,18 @@
788 604 'selector' => '{{WRAPPER}} .elementor-wrapper',
789 605 ]
790 606 );
791 607
792 - $this->end_controls_section();
793 -
794 - $this->start_controls_section(
795 - 'section_image_overlay_style',
796 - [
797 - 'label' => esc_html__( 'Image Overlay', 'elementor' ),
798 - 'tab' => Controls_Manager::TAB_STYLE,
799 - 'condition' => [
800 - 'show_image_overlay' => 'yes',
801 - 'show_play_icon' => 'yes',
802 - ],
803 - ]
804 - );
805 -
806 608 $this->add_control(
807 609 'play_icon_title',
808 610 [
809 - 'label' => esc_html__( 'Play Icon', 'elementor' ),
611 + 'label' => __( 'Play Icon', 'elementor' ),
810 612 'type' => Controls_Manager::HEADING,
811 613 'condition' => [
812 614 'show_image_overlay' => 'yes',
813 615 'show_play_icon' => 'yes',
814 616 ],
617 + 'separator' => 'before',
815 618 ]
816 619 );
817 620
818 621 $this->add_control(
@@ -817,13 +620,12 @@
817 620
818 621 $this->add_control(
819 622 'play_icon_color',
820 623 [
821 - 'label' => esc_html__( 'Color', 'elementor' ),
624 + 'label' => __( 'Color', 'elementor' ),
822 625 'type' => Controls_Manager::COLOR,
823 626 'selectors' => [
824 627 '{{WRAPPER}} .elementor-custom-embed-play i' => 'color: {{VALUE}}',
825 - '{{WRAPPER}} .elementor-custom-embed-play svg' => 'fill: {{VALUE}}',
826 628 ],
827 629 'condition' => [
828 630 'show_image_overlay' => 'yes',
829 631 'show_play_icon' => 'yes',
@@ -833,11 +635,10 @@
833 635
834 636 $this->add_responsive_control(
835 637 'play_icon_size',
836 638 [
837 - 'label' => esc_html__( 'Size', 'elementor' ),
639 + 'label' => __( 'Size', 'elementor' ),
838 640 'type' => Controls_Manager::SLIDER,
839 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
840 641 'range' => [
841 642 'px' => [
842 643 'min' => 10,
843 644 'max' => 300,
@@ -843,11 +644,9 @@
843 644 'max' => 300,
844 645 ],
845 646 ],
846 647 'selectors' => [
847 - // Not using a CSS vars because the default size value is coming from a global scss file.
848 648 '{{WRAPPER}} .elementor-custom-embed-play i' => 'font-size: {{SIZE}}{{UNIT}}',
849 - '{{WRAPPER}} .elementor-custom-embed-play svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
850 649 ],
851 650 'condition' => [
852 651 'show_image_overlay' => 'yes',
853 652 'show_play_icon' => 'yes',
@@ -861,15 +660,14 @@
861 660 'name' => 'play_icon_text_shadow',
862 661 'selector' => '{{WRAPPER}} .elementor-custom-embed-play i',
863 662 'fields_options' => [
864 663 'text_shadow_type' => [
865 - 'label' => esc_html__( 'Shadow', 'elementor' ),
664 + 'label' => _x( 'Shadow', 'Text Shadow Control', 'elementor' ),
866 665 ],
867 666 ],
868 667 'condition' => [
869 668 'show_image_overlay' => 'yes',
870 669 'show_play_icon' => 'yes',
871 - 'play_icon[library]!' => 'svg',
872 670 ],
873 671 ]
874 672 );
875 673
@@ -877,9 +675,9 @@
877 675
878 676 $this->start_controls_section(
879 677 'section_lightbox_style',
880 678 [
881 - 'label' => esc_html__( 'Lightbox', 'elementor' ),
679 + 'label' => __( 'Lightbox', 'elementor' ),
882 680 'tab' => Controls_Manager::TAB_STYLE,
883 681 'condition' => [
884 682 'show_image_overlay' => 'yes',
885 683 'image_overlay[url]!' => '',
@@ -890,9 +688,9 @@
890 688
891 689 $this->add_control(
892 690 'lightbox_color',
893 691 [
894 - 'label' => esc_html__( 'Background Color', 'elementor' ),
692 + 'label' => __( 'Background Color', 'elementor' ),
895 693 'type' => Controls_Manager::COLOR,
896 694 'selectors' => [
897 695 '#elementor-lightbox-{{ID}}' => 'background-color: {{VALUE}};',
898 696 ],
@@ -901,13 +699,12 @@
901 699
902 700 $this->add_control(
903 701 'lightbox_ui_color',
904 702 [
905 - 'label' => esc_html__( 'UI Color', 'elementor' ),
703 + 'label' => __( 'UI Color', 'elementor' ),
906 704 'type' => Controls_Manager::COLOR,
907 705 'selectors' => [
908 706 '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button' => 'color: {{VALUE}}',
909 - '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button svg' => 'fill: {{VALUE}}',
910 707 ],
911 708 ]
912 709 );
913 710
@@ -913,96 +710,67 @@
913 710
914 711 $this->add_control(
915 712 'lightbox_ui_color_hover',
916 713 [
917 - 'label' => esc_html__( 'UI Hover Color', 'elementor' ),
714 + 'label' => __( 'UI Hover Color', 'elementor' ),
918 715 'type' => Controls_Manager::COLOR,
919 716 'selectors' => [
920 717 '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover' => 'color: {{VALUE}}',
921 - '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover svg' => 'fill: {{VALUE}}',
922 718 ],
719 + 'separator' => 'after',
923 720 ]
924 721 );
925 722
926 - $this->add_responsive_control(
927 - 'lightbox_content_animation',
928 - [
929 - 'label' => esc_html__( 'Entrance Animation', 'elementor' ),
930 - 'type' => Controls_Manager::ANIMATION,
931 - 'frontend_available' => true,
932 - 'separator' => 'before',
933 - ]
934 - );
935 -
936 723 $this->add_control(
937 - 'deprecation_warning',
938 - [
939 - 'type' => Controls_Manager::ALERT,
940 - 'alert_type' => 'danger',
941 - 'content' => esc_html__( 'Note: These controls have been deprecated and are only visible if they were previously in use. The video’s width and position are now set based on its aspect ratio.', 'elementor' ),
942 - 'separator' => 'before',
943 - 'condition' => [
944 - 'lightbox_video_width!' => '',
945 - 'lightbox_content_position!' => '',
946 - ],
947 - ]
948 - );
949 -
950 - // Deprecated control. Visible only if it was previously in use.
951 - $this->add_control(
952 724 'lightbox_video_width',
953 725 [
954 - 'label' => esc_html__( 'Content Width', 'elementor' ),
726 + 'label' => __( 'Content Width', 'elementor' ),
955 727 'type' => Controls_Manager::SLIDER,
956 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
957 728 'default' => [
958 729 'unit' => '%',
959 730 ],
960 - // 'selectors' => [
961 - // '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
962 - // ],
963 - 'condition' => [
964 - 'lightbox_video_width!' => '',
965 - 'lightbox_content_position!' => '',
731 + 'range' => [
732 + '%' => [
733 + 'min' => 30,
734 + ],
966 735 ],
736 + 'selectors' => [
737 + '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
738 + ],
967 739 ]
968 740 );
969 741
970 - // Deprecated control. Visible only if it was previously in use.
971 742 $this->add_control(
972 743 'lightbox_content_position',
973 744 [
974 - 'label' => esc_html__( 'Content Position', 'elementor' ),
745 + 'label' => __( 'Content Position', 'elementor' ),
975 746 'type' => Controls_Manager::SELECT,
976 747 'frontend_available' => true,
977 748 'options' => [
978 - '' => esc_html__( 'Center', 'elementor' ),
979 - 'top' => esc_html__( 'Top', 'elementor' ),
749 + '' => __( 'Center', 'elementor' ),
750 + 'top' => __( 'Top', 'elementor' ),
980 751 ],
981 - // 'selectors' => [
982 - // '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
983 - // ],
752 + 'selectors' => [
753 + '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
754 + ],
984 755 'selectors_dictionary' => [
985 756 'top' => 'top: 60px',
986 757 ],
987 - 'condition' => [
988 - 'lightbox_video_width!' => '',
989 - 'lightbox_content_position!' => '',
990 - ],
991 758 ]
992 759 );
993 760
761 + $this->add_responsive_control(
762 + 'lightbox_content_animation',
763 + [
764 + 'label' => __( 'Entrance Animation', 'elementor' ),
765 + 'type' => Controls_Manager::ANIMATION,
766 + 'frontend_available' => true,
767 + ]
768 + );
769 +
994 770 $this->end_controls_section();
995 771 }
996 772
997 - public function print_a11y_text( $image_overlay ) {
998 - if ( empty( $image_overlay['alt'] ) ) {
999 - echo esc_html__( 'Play Video', 'elementor' );
1000 - } else {
1001 - echo esc_html__( 'Play Video about', 'elementor' ) . ' ' . esc_attr( $image_overlay['alt'] );
1002 - }
1003 - }
1004 -
1005 773 /**
1006 774 * Render video widget output on the frontend.
1007 775 *
1008 776 * Written in PHP and used to generate the final HTML.
@@ -1016,15 +784,8 @@
1016 784 $video_url = $settings[ $settings['video_type'] . '_url' ];
1017 785
1018 786 if ( 'hosted' === $settings['video_type'] ) {
1019 787 $video_url = $this->get_hosted_video_url();
1020 - } else {
1021 - if ( 'videopress' === $settings['video_type'] ) {
1022 - $video_url = $this->get_videopress_video_url();
1023 - }
1024 -
1025 - $embed_params = $this->get_embed_params();
1026 - $embed_options = $this->get_embed_options();
1027 788 }
1028 789
1029 790 if ( empty( $video_url ) ) {
1030 791 return;
@@ -1029,15 +790,9 @@
1029 790 if ( empty( $video_url ) ) {
1030 791 return;
1031 792 }
1032 793
1033 - if ( 'youtube' === $settings['video_type'] ) {
1034 - $video_html = '<div class="elementor-video"></div>';
1035 - }
1036 -
1037 794 if ( 'hosted' === $settings['video_type'] ) {
1038 - $this->add_render_attribute( 'video-wrapper', 'class', 'e-hosted-video' );
1039 -
1040 795 ob_start();
1041 796
1042 797 $this->render_hosted_video();
1043 798
@@ -1042,15 +797,18 @@
1042 797 $this->render_hosted_video();
1043 798
1044 799 $video_html = ob_get_clean();
1045 800 } else {
801 + $embed_params = $this->get_embed_params();
802 +
803 + $embed_options = $this->get_embed_options();
804 +
1046 805 $is_static_render_mode = Plugin::$instance->frontend->is_static_render_mode();
1047 806 $post_id = get_queried_object_id();
1048 807
1049 808 if ( $is_static_render_mode ) {
1050 809 $video_html = Embed::get_embed_thumbnail_html( $video_url, $post_id );
1051 - // YouTube API requires a different markup which was set above.
1052 - } elseif ( 'youtube' !== $settings['video_type'] ) {
810 + } else {
1053 811 $video_html = Embed::get_embed_html( $video_url, $embed_params, $embed_options );
1054 812 }
1055 813 }
1056 814
@@ -1061,14 +819,18 @@
1061 819 }
1062 820
1063 821 $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-wrapper' );
1064 822
823 + if ( ! $settings['lightbox'] ) {
824 + $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-fit-aspect-ratio' );
825 + }
826 +
1065 827 $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-open-' . ( $settings['lightbox'] ? 'lightbox' : 'inline' ) );
1066 828 ?>
1067 - <div <?php $this->print_render_attribute_string( 'video-wrapper' ); ?>>
829 + <div <?php echo $this->get_render_attribute_string( 'video-wrapper' ); ?>>
1068 830 <?php
1069 831 if ( ! $settings['lightbox'] ) {
1070 - Utils::print_unescaped_internal_string( $video_html ); // XSS ok.
832 + echo $video_html; // XSS ok.
1071 833 }
1072 834
1073 835 if ( $this->has_image_overlay() ) {
1074 836 $this->add_render_attribute( 'image-overlay', 'class', 'elementor-custom-embed-image-overlay' );
@@ -1083,15 +845,14 @@
1083 845 $lightbox_options = [
1084 846 'type' => 'video',
1085 847 'videoType' => $settings['video_type'],
1086 848 'url' => $lightbox_url,
1087 - 'autoplay' => $settings['autoplay'],
1088 849 'modalOptions' => [
1089 850 'id' => 'elementor-lightbox-' . $this->get_id(),
1090 851 'entranceAnimation' => $settings['lightbox_content_animation'],
1091 852 'entranceAnimation_tablet' => $settings['lightbox_content_animation_tablet'],
1092 853 'entranceAnimation_mobile' => $settings['lightbox_content_animation_mobile'],
1093 - 'videoAspectRatio' => $settings['aspect_ratio'] ?? '169',
854 + 'videoAspectRatio' => $settings['aspect_ratio'],
1094 855 ],
1095 856 ];
1096 857
1097 858 if ( 'hosted' === $settings['video_type'] ) {
@@ -1100,9 +861,8 @@
1100 861
1101 862 $this->add_render_attribute( 'image-overlay', [
1102 863 'data-elementor-open-lightbox' => 'yes',
1103 864 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ),
1104 - 'data-e-action-hash' => Plugin::instance()->frontend->create_action_hash( 'lightbox', $lightbox_options ),
1105 865 ] );
1106 866
1107 867 if ( Plugin::$instance->editor->is_edit_mode() ) {
1108 868 $this->add_render_attribute( 'image-overlay', [
@@ -1109,33 +869,19 @@
1109 869 'class' => 'elementor-clickable',
1110 870 ] );
1111 871 }
1112 872 } else {
1113 - // When there is an image URL but no ID, it means the overlay image is the placeholder. In this case, get the placeholder URL.
1114 - if ( empty( $settings['image_overlay']['id'] && ! empty( $settings['image_overlay']['url'] ) ) ) {
1115 - $image_url = $settings['image_overlay']['url'];
1116 - } else {
1117 - $image_url = Group_Control_Image_Size::get_attachment_image_src( $settings['image_overlay']['id'], 'image_overlay', $settings );
1118 - }
1119 -
1120 - $this->add_render_attribute( 'image-overlay', 'style', 'background-image: url(' . $image_url . ');' );
873 + $this->add_render_attribute( 'image-overlay', 'style', 'background-image: url(' . Group_Control_Image_Size::get_attachment_image_src( $settings['image_overlay']['id'], 'image_overlay', $settings ) . ');' );
1121 874 }
1122 875 ?>
1123 - <div <?php $this->print_render_attribute_string( 'image-overlay' ); ?>>
876 + <div <?php echo $this->get_render_attribute_string( 'image-overlay' ); ?>>
1124 877 <?php if ( $settings['lightbox'] ) : ?>
1125 - <?php Group_Control_Image_Size::print_attachment_image_html( $settings, 'image_overlay' ); ?>
878 + <?php echo Group_Control_Image_Size::get_attachment_image_html( $settings, 'image_overlay' ); ?>
1126 879 <?php endif; ?>
1127 880 <?php if ( 'yes' === $settings['show_play_icon'] ) : ?>
1128 - <div class="elementor-custom-embed-play" role="button" aria-label="<?php $this->print_a11y_text( $settings['image_overlay'] ); ?>" tabindex="0">
1129 - <?php
1130 - if ( empty( $settings['play_icon']['value'] ) ) {
1131 - $settings['play_icon'] = [
1132 - 'library' => 'eicons',
1133 - 'value' => 'eicon-play',
1134 - ];
1135 - }
1136 - Icons_Manager::render_icon( $settings['play_icon'], [ 'aria-hidden' => 'true' ] );
1137 - ?>
881 + <div class="elementor-custom-embed-play" role="button">
882 + <i class="eicon-play" aria-hidden="true"></i>
883 + <span class="elementor-screen-only"><?php echo __( 'Play Video', 'elementor' ); ?></span>
1138 884 </div>
1139 885 <?php endif; ?>
1140 886 </div>
1141 887 <?php } ?>
@@ -1145,9 +891,9 @@
1145 891
1146 892 /**
1147 893 * Render video widget as plain content.
1148 894 *
1149 - * Override the default behavior, by printing the video URL instead of rendering it.
895 + * Override the default behavior, by printing the video URL insted of rendering it.
1150 896 *
1151 897 * @since 1.4.5
1152 898 * @access public
1153 899 */
@@ -1193,9 +939,9 @@
1193 939 'loop',
1194 940 'controls',
1195 941 'mute',
1196 942 'rel',
1197 - 'cc_load_policy',
943 + 'modestbranding',
1198 944 ];
1199 945
1200 946 if ( $settings['loop'] ) {
1201 947 $video_properties = Embed::get_video_properties( $settings['youtube_url'] );
@@ -1219,12 +965,8 @@
1219 965
1220 966 $params['color'] = str_replace( '#', '', $settings['color'] );
1221 967
1222 968 $params['autopause'] = '0';
1223 -
1224 - if ( ! empty( $settings['yt_privacy'] ) ) {
1225 - $params['dnt'] = 'true';
1226 - }
1227 969 } elseif ( 'dailymotion' === $settings['video_type'] ) {
1228 970 $params_dictionary = [
1229 971 'controls',
1230 972 'mute',
@@ -1236,12 +978,8 @@
1236 978
1237 979 $params['start'] = $settings['start'];
1238 980
1239 981 $params['endscreen-enable'] = '0';
1240 - } elseif ( 'videopress' === $settings['video_type'] ) {
1241 - $params_dictionary = $this->get_params_dictionary_for_videopress();
1242 -
1243 - $params['at'] = $settings['start'];
1244 982 }
1245 983
1246 984 foreach ( $params_dictionary as $key => $param_name ) {
1247 985 $setting_name = $param_name;
@@ -1308,12 +1046,8 @@
1308 1046 $video_params[ $option_name ] = '';
1309 1047 }
1310 1048 }
1311 1049
1312 - if ( $settings['preload'] ) {
1313 - $video_params['preload'] = $settings['preload'];
1314 - }
1315 -
1316 1050 if ( $settings['mute'] ) {
1317 1051 $video_params['muted'] = 'muted';
1318 1052 }
1319 1053
@@ -1332,8 +1066,9 @@
1332 1066 return $video_params;
1333 1067 }
1334 1068
1335 1069 /**
1070 + * @param bool $from_media
1336 1071 *
1337 1072 * @return string
1338 1073 * @since 2.1.0
1339 1074 * @access private
@@ -1366,39 +1101,9 @@
1366 1101 return $video_url;
1367 1102 }
1368 1103
1369 1104 /**
1370 - * Get the VideoPress video URL from the current selected settings.
1371 1105 *
1372 - * @return string
1373 - */
1374 - private function get_videopress_video_url() {
1375 - $settings = $this->get_settings_for_display();
1376 -
1377 - if ( ! empty( $settings['insert_url'] ) ) {
1378 - return $settings['videopress_url'];
1379 - }
1380 -
1381 - return $settings['hosted_url']['url'];
1382 - }
1383 -
1384 - /**
1385 - * Get the params dictionary for VideoPress videos.
1386 - *
1387 - * @return array
1388 - */
1389 - private function get_params_dictionary_for_videopress() {
1390 - return [
1391 - 'controls',
1392 - 'autoplay' => 'autoPlay',
1393 - 'mute' => 'muted',
1394 - 'loop',
1395 - 'play_on_mobile' => 'playsinline',
1396 - ];
1397 - }
1398 -
1399 - /**
1400 - *
1401 1106 * @since 2.1.0
1402 1107 * @access private
1403 1108 */
1404 1109 private function render_hosted_video() {
@@ -1407,10 +1112,9 @@
1407 1112 return;
1408 1113 }
1409 1114
1410 1115 $video_params = $this->get_hosted_params();
1411 - /* Sometimes the video url is base64, therefore we use `esc_attr` in `src`. */
1412 1116 ?>
1413 - <video class="elementor-video" src="<?php echo esc_attr( $video_url ); ?>" <?php Utils::print_html_attributes( $video_params ); ?>></video>
1117 + <video class="elementor-video" src="<?php echo esc_url( $video_url ); ?>" <?php echo Utils::render_html_attributes( $video_params ); ?>></video>
1414 1118 <?php
1415 1119 }
1416 1120 }