PluginProbe
Elementor Website Builder – more than just a page builder / 3.1.0-beta1
Elementor Website Builder – more than just a page builder v3.1.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 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 All 457 releases
← All changes | includes/widgets/video.php +146 -439 4.2.4 → 3.1.0-beta1 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,60 +84,16 @@
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
120 - * @access protected
121 - *
122 - * @return array Widget promotion data.
123 - */
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 96 * @since 3.1.0
142 97 * @access protected
143 98 */
144 99 protected function register_controls() {
@@ -144,9 +99,9 @@
144 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,17 +106,16 @@
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 119 'frontend_available' => true,
166 120 ]
167 121 );
@@ -168,9 +122,9 @@
168 122
169 123 $this->add_control(
170 124 'youtube_url',
171 125 [
172 - 'label' => esc_html__( 'Link', 'elementor' ),
126 + 'label' => __( 'Link', 'elementor' ),
173 127 'type' => Controls_Manager::TEXT,
174 128 'dynamic' => [
175 129 'active' => true,
176 130 'categories' => [
@@ -177,17 +131,14 @@
177 131 TagsModule::POST_META_CATEGORY,
178 132 TagsModule::URL_CATEGORY,
179 133 ],
180 134 ],
181 - 'placeholder' => esc_html__( 'Enter your URL', 'elementor' ) . ' (YouTube)',
135 + 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (YouTube)',
182 136 'default' => 'https://www.youtube.com/watch?v=XHOmBV4js_E',
183 137 'label_block' => true,
184 138 'condition' => [
185 139 'video_type' => 'youtube',
186 140 ],
187 - 'ai' => [
188 - 'active' => false,
189 - ],
190 141 'frontend_available' => true,
191 142 ]
192 143 );
193 144
@@ -193,9 +144,9 @@
193 144
194 145 $this->add_control(
195 146 'vimeo_url',
196 147 [
197 - 'label' => esc_html__( 'Link', 'elementor' ),
148 + 'label' => __( 'Link', 'elementor' ),
198 149 'type' => Controls_Manager::TEXT,
199 150 'dynamic' => [
200 151 'active' => true,
201 152 'categories' => [
@@ -202,17 +153,14 @@
202 153 TagsModule::POST_META_CATEGORY,
203 154 TagsModule::URL_CATEGORY,
204 155 ],
205 156 ],
206 - 'placeholder' => esc_html__( 'Enter your URL', 'elementor' ) . ' (Vimeo)',
157 + 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (Vimeo)',
207 158 'default' => 'https://vimeo.com/235215203',
208 159 'label_block' => true,
209 160 'condition' => [
210 161 'video_type' => 'vimeo',
211 162 ],
212 - 'ai' => [
213 - 'active' => false,
214 - ],
215 163 ]
216 164 );
217 165
218 166 $this->add_control(
@@ -217,9 +165,9 @@
217 165
218 166 $this->add_control(
219 167 'dailymotion_url',
220 168 [
221 - 'label' => esc_html__( 'Link', 'elementor' ),
169 + 'label' => __( 'Link', 'elementor' ),
222 170 'type' => Controls_Manager::TEXT,
223 171 'dynamic' => [
224 172 'active' => true,
225 173 'categories' => [
@@ -226,17 +174,14 @@
226 174 TagsModule::POST_META_CATEGORY,
227 175 TagsModule::URL_CATEGORY,
228 176 ],
229 177 ],
230 - 'placeholder' => esc_html__( 'Enter your URL', 'elementor' ) . ' (Dailymotion)',
178 + 'placeholder' => __( 'Enter your URL', 'elementor' ) . ' (Dailymotion)',
231 179 'default' => 'https://www.dailymotion.com/video/x6tqhqb',
232 180 'label_block' => true,
233 181 'condition' => [
234 182 'video_type' => 'dailymotion',
235 183 ],
236 - 'ai' => [
237 - 'active' => false,
238 - ],
239 184 ]
240 185 );
241 186
242 187 $this->add_control(
@@ -241,12 +186,12 @@
241 186
242 187 $this->add_control(
243 188 'insert_url',
244 189 [
245 - 'label' => esc_html__( 'External URL', 'elementor' ),
190 + 'label' => __( 'External URL', 'elementor' ),
246 191 'type' => Controls_Manager::SWITCHER,
247 192 'condition' => [
248 - 'video_type' => [ 'hosted', 'videopress' ],
193 + 'video_type' => 'hosted',
249 194 ],
250 195 ]
251 196 );
252 197
@@ -252,9 +197,9 @@
252 197
253 198 $this->add_control(
254 199 'hosted_url',
255 200 [
256 - 'label' => esc_html__( 'Choose Video File', 'elementor' ),
201 + 'label' => __( 'Choose File', 'elementor' ),
257 202 'type' => Controls_Manager::MEDIA,
258 203 'dynamic' => [
259 204 'active' => true,
260 205 'categories' => [
@@ -260,13 +205,11 @@
260 205 'categories' => [
261 206 TagsModule::MEDIA_CATEGORY,
262 207 ],
263 208 ],
264 - 'media_types' => [
265 - 'video',
266 - ],
209 + 'media_type' => 'video',
267 210 'condition' => [
268 - 'video_type' => [ 'hosted', 'videopress' ],
211 + 'video_type' => 'hosted',
269 212 'insert_url' => '',
270 213 ],
271 214 ]
272 215 );
@@ -273,9 +216,9 @@
273 216
274 217 $this->add_control(
275 218 'external_url',
276 219 [
277 - 'label' => esc_html__( 'URL', 'elementor' ),
220 + 'label' => __( 'URL', 'elementor' ),
278 221 'type' => Controls_Manager::URL,
279 222 'autocomplete' => false,
280 223 'options' => false,
281 224 'label_block' => true,
@@ -286,9 +229,10 @@
286 229 TagsModule::POST_META_CATEGORY,
287 230 TagsModule::URL_CATEGORY,
288 231 ],
289 232 ],
290 - 'placeholder' => esc_html__( 'Enter your URL', 'elementor' ),
233 + 'media_type' => 'video',
234 + 'placeholder' => __( 'Enter your URL', 'elementor' ),
291 235 'condition' => [
292 236 'video_type' => 'hosted',
293 237 'insert_url' => 'yes',
294 238 ],
@@ -295,42 +239,14 @@
295 239 ]
296 240 );
297 241
298 242 $this->add_control(
299 - 'videopress_url',
300 - [
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 - ],
317 - 'condition' => [
318 - 'video_type' => 'videopress',
319 - 'insert_url' => 'yes',
320 - ],
321 -
322 - ]
323 - );
324 -
325 - $this->add_control(
326 243 'start',
327 244 [
328 - 'label' => esc_html__( 'Start Time', 'elementor' ),
245 + 'label' => __( 'Start Time', 'elementor' ),
329 246 'type' => Controls_Manager::NUMBER,
330 - 'description' => esc_html__( 'Specify a start time (in seconds)', 'elementor' ),
247 + 'description' => __( 'Specify a start time (in seconds)', 'elementor' ),
331 248 'frontend_available' => true,
332 - 'separator' => 'before',
333 249 ]
334 250 );
335 251
336 252 $this->add_control(
@@ -335,11 +251,11 @@
335 251
336 252 $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' => [
343 259 'video_type' => [ 'youtube', 'hosted' ],
344 260 ],
345 261 'frontend_available' => true,
@@ -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,15 +273,9 @@
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 279 'frontend_available' => true,
370 280 ]
371 281 );
@@ -372,9 +282,9 @@
372 282
373 283 $this->add_control(
374 284 'play_on_mobile',
375 285 [
376 - 'label' => esc_html__( 'Play On Mobile', 'elementor' ),
286 + 'label' => __( 'Play On Mobile', 'elementor' ),
377 287 'type' => Controls_Manager::SWITCHER,
378 288 'condition' => [
379 289 'autoplay' => 'yes',
380 290 ],
@@ -384,9 +294,9 @@
384 294
385 295 $this->add_control(
386 296 'mute',
387 297 [
388 - 'label' => esc_html__( 'Mute', 'elementor' ),
298 + 'label' => __( 'Mute', 'elementor' ),
389 299 'type' => Controls_Manager::SWITCHER,
390 300 'frontend_available' => true,
391 301 ]
392 302 );
@@ -393,9 +303,9 @@
393 303
394 304 $this->add_control(
395 305 'loop',
396 306 [
397 - 'label' => esc_html__( 'Loop', 'elementor' ),
307 + 'label' => __( 'Loop', 'elementor' ),
398 308 'type' => Controls_Manager::SWITCHER,
399 309 'condition' => [
400 310 'video_type!' => 'dailymotion',
401 311 ],
@@ -405,12 +315,12 @@
405 315
406 316 $this->add_control(
407 317 'controls',
408 318 [
409 - 'label' => esc_html__( 'Player Controls', 'elementor' ),
319 + 'label' => __( 'Player Controls', 'elementor' ),
410 320 'type' => Controls_Manager::SWITCHER,
411 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
412 - 'label_on' => esc_html__( 'Show', 'elementor' ),
321 + 'label_off' => __( 'Hide', 'elementor' ),
322 + 'label_on' => __( 'Show', 'elementor' ),
413 323 'default' => 'yes',
414 324 'condition' => [
415 325 'video_type!' => 'vimeo',
416 326 ],
@@ -420,12 +330,12 @@
420 330
421 331 $this->add_control(
422 332 'showinfo',
423 333 [
424 - 'label' => esc_html__( 'Video Info', 'elementor' ),
334 + 'label' => __( 'Video Info', 'elementor' ),
425 335 'type' => Controls_Manager::SWITCHER,
426 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
427 - 'label_on' => esc_html__( 'Show', 'elementor' ),
336 + 'label_off' => __( 'Hide', 'elementor' ),
337 + 'label_on' => __( 'Show', 'elementor' ),
428 338 'default' => 'yes',
429 339 'condition' => [
430 340 'video_type' => [ 'dailymotion' ],
431 341 ],
@@ -432,11 +342,11 @@
432 342 ]
433 343 );
434 344
435 345 $this->add_control(
436 - 'cc_load_policy',
346 + 'modestbranding',
437 347 [
438 - 'label' => esc_html__( 'Captions', 'elementor' ),
348 + 'label' => __( 'Modest Branding', 'elementor' ),
439 349 'type' => Controls_Manager::SWITCHER,
440 350 'condition' => [
441 351 'video_type' => [ 'youtube' ],
442 352 'controls' => 'yes',
@@ -447,12 +357,12 @@
447 357
448 358 $this->add_control(
449 359 'logo',
450 360 [
451 - 'label' => esc_html__( 'Logo', 'elementor' ),
361 + 'label' => __( 'Logo', 'elementor' ),
452 362 'type' => Controls_Manager::SWITCHER,
453 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
454 - 'label_on' => esc_html__( 'Show', 'elementor' ),
363 + 'label_off' => __( 'Hide', 'elementor' ),
364 + 'label_on' => __( 'Show', 'elementor' ),
455 365 'default' => 'yes',
456 366 'condition' => [
457 367 'video_type' => [ 'dailymotion' ],
458 368 ],
@@ -462,13 +372,13 @@
462 372 // YouTube.
463 373 $this->add_control(
464 374 'yt_privacy',
465 375 [
466 - 'label' => esc_html__( 'Privacy Mode', 'elementor' ),
376 + 'label' => __( 'Privacy Mode', 'elementor' ),
467 377 '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' ),
378 + 'description' => __( 'When you turn on privacy mode, YouTube won\'t store information about visitors on your website unless they play the video.', 'elementor' ),
469 379 'condition' => [
470 - 'video_type' => [ 'youtube', 'vimeo' ],
380 + 'video_type' => 'youtube',
471 381 ],
472 382 'frontend_available' => true,
473 383 ]
474 384 );
@@ -473,49 +383,15 @@
473 383 ]
474 384 );
475 385
476 386 $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 387 'rel',
512 388 [
513 - 'label' => esc_html__( 'Suggested Videos', 'elementor' ),
389 + 'label' => __( 'Suggested Videos', 'elementor' ),
514 390 'type' => Controls_Manager::SELECT,
515 391 'options' => [
516 - '' => esc_html__( 'Current Video Channel', 'elementor' ),
517 - 'yes' => esc_html__( 'Any Video', 'elementor' ),
392 + '' => __( 'Current Video Channel', 'elementor' ),
393 + 'yes' => __( 'Any Video', 'elementor' ),
518 394 ],
519 395 'condition' => [
520 396 'video_type' => 'youtube',
521 397 ],
@@ -525,12 +401,12 @@
525 401 // Vimeo.
526 402 $this->add_control(
527 403 'vimeo_title',
528 404 [
529 - 'label' => esc_html__( 'Intro Title', 'elementor' ),
405 + 'label' => __( 'Intro Title', 'elementor' ),
530 406 'type' => Controls_Manager::SWITCHER,
531 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
532 - 'label_on' => esc_html__( 'Show', 'elementor' ),
407 + 'label_off' => __( 'Hide', 'elementor' ),
408 + 'label_on' => __( 'Show', 'elementor' ),
533 409 'default' => 'yes',
534 410 'condition' => [
535 411 'video_type' => 'vimeo',
536 412 ],
@@ -539,12 +415,12 @@
539 415
540 416 $this->add_control(
541 417 'vimeo_portrait',
542 418 [
543 - 'label' => esc_html__( 'Intro Portrait', 'elementor' ),
419 + 'label' => __( 'Intro Portrait', 'elementor' ),
544 420 'type' => Controls_Manager::SWITCHER,
545 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
546 - 'label_on' => esc_html__( 'Show', 'elementor' ),
421 + 'label_off' => __( 'Hide', 'elementor' ),
422 + 'label_on' => __( 'Show', 'elementor' ),
547 423 'default' => 'yes',
548 424 'condition' => [
549 425 'video_type' => 'vimeo',
550 426 ],
@@ -553,12 +429,12 @@
553 429
554 430 $this->add_control(
555 431 'vimeo_byline',
556 432 [
557 - 'label' => esc_html__( 'Intro Byline', 'elementor' ),
433 + 'label' => __( 'Intro Byline', 'elementor' ),
558 434 'type' => Controls_Manager::SWITCHER,
559 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
560 - 'label_on' => esc_html__( 'Show', 'elementor' ),
435 + 'label_off' => __( 'Hide', 'elementor' ),
436 + 'label_on' => __( 'Show', 'elementor' ),
561 437 'default' => 'yes',
562 438 'condition' => [
563 439 'video_type' => 'vimeo',
564 440 ],
@@ -567,9 +443,9 @@
567 443
568 444 $this->add_control(
569 445 'color',
570 446 [
571 - 'label' => esc_html__( 'Controls Color', 'elementor' ),
447 + 'label' => __( 'Controls Color', 'elementor' ),
572 448 'type' => Controls_Manager::COLOR,
573 449 'default' => '',
574 450 'condition' => [
575 451 'video_type' => [ 'vimeo', 'dailymotion' ],
@@ -579,12 +455,12 @@
579 455
580 456 $this->add_control(
581 457 'download_button',
582 458 [
583 - 'label' => esc_html__( 'Download Button', 'elementor' ),
459 + 'label' => __( 'Download Button', 'elementor' ),
584 460 'type' => Controls_Manager::SWITCHER,
585 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
586 - 'label_on' => esc_html__( 'Show', 'elementor' ),
461 + 'label_off' => __( 'Hide', 'elementor' ),
462 + 'label_on' => __( 'Show', 'elementor' ),
587 463 'condition' => [
588 464 'video_type' => 'hosted',
589 465 ],
590 466 ]
@@ -590,41 +466,27 @@
590 466 ]
591 467 );
592 468
593 469 $this->add_control(
594 - 'preload',
470 + 'poster',
595 471 [
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' ),
472 + 'label' => __( 'Poster', 'elementor' ),
473 + 'type' => Controls_Manager::MEDIA,
474 + 'dynamic' => [
475 + 'active' => true,
602 476 ],
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',
609 477 'condition' => [
610 478 'video_type' => 'hosted',
611 - 'autoplay' => '',
612 479 ],
613 480 ]
614 481 );
615 482
616 483 $this->add_control(
617 - 'poster',
484 + 'view',
618 485 [
619 - 'label' => esc_html__( 'Poster', 'elementor' ),
620 - 'type' => Controls_Manager::MEDIA,
621 - 'dynamic' => [
622 - 'active' => true,
623 - ],
624 - 'condition' => [
625 - 'video_type' => 'hosted',
626 - ],
486 + 'label' => __( 'View', 'elementor' ),
487 + 'type' => Controls_Manager::HIDDEN,
488 + 'default' => 'youtube',
627 489 ]
628 490 );
629 491
630 492 $this->end_controls_section();
@@ -631,9 +493,9 @@
631 493
632 494 $this->start_controls_section(
633 495 'section_image_overlay',
634 496 [
635 - 'label' => esc_html__( 'Image Overlay', 'elementor' ),
497 + 'label' => __( 'Image Overlay', 'elementor' ),
636 498 ]
637 499 );
638 500
639 501 $this->add_control(
@@ -638,12 +500,12 @@
638 500
639 501 $this->add_control(
640 502 'show_image_overlay',
641 503 [
642 - 'label' => esc_html__( 'Image Overlay', 'elementor' ),
504 + 'label' => __( 'Image Overlay', 'elementor' ),
643 505 'type' => Controls_Manager::SWITCHER,
644 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
645 - 'label_on' => esc_html__( 'Show', 'elementor' ),
506 + 'label_off' => __( 'Hide', 'elementor' ),
507 + 'label_on' => __( 'Show', 'elementor' ),
646 508 'frontend_available' => true,
647 509 ]
648 510 );
649 511
@@ -649,9 +511,9 @@
649 511
650 512 $this->add_control(
651 513 'image_overlay',
652 514 [
653 - 'label' => esc_html__( 'Choose Image', 'elementor' ),
515 + 'label' => __( 'Choose Image', 'elementor' ),
654 516 'type' => Controls_Manager::MEDIA,
655 517 'default' => [
656 518 'url' => Utils::get_placeholder_image_src(),
657 519 ],
@@ -664,13 +526,26 @@
664 526 'frontend_available' => true,
665 527 ]
666 528 );
667 529
530 + $this->add_control(
531 + 'lazy_load',
532 + [
533 + 'label' => __( 'Lazy Load', 'elementor' ),
534 + 'type' => Controls_Manager::SWITCHER,
535 + 'condition' => [
536 + 'show_image_overlay' => 'yes',
537 + 'video_type!' => 'hosted',
538 + ],
539 + ]
540 + );
541 +
668 542 $this->add_group_control(
669 543 Group_Control_Image_Size::get_type(),
670 544 [
671 545 'name' => 'image_overlay', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `image_overlay_size` and `image_overlay_custom_dimension`.
672 546 'default' => 'full',
547 + 'separator' => 'none',
673 548 'condition' => [
674 549 'show_image_overlay' => 'yes',
675 550 ],
676 551 ]
@@ -678,14 +553,11 @@
678 553
679 554 $this->add_control(
680 555 'show_play_icon',
681 556 [
682 - 'label' => esc_html__( 'Play Icon', 'elementor' ),
557 + 'label' => __( 'Play Icon', 'elementor' ),
683 558 'type' => Controls_Manager::SWITCHER,
684 559 'default' => 'yes',
685 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
686 - 'label_on' => esc_html__( 'Show', 'elementor' ),
687 - 'separator' => 'before',
688 560 'condition' => [
689 561 'show_image_overlay' => 'yes',
690 562 'image_overlay[url]!' => '',
691 563 ],
@@ -692,50 +564,15 @@
692 564 ]
693 565 );
694 566
695 567 $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 568 'lightbox',
732 569 [
733 - 'label' => esc_html__( 'Lightbox', 'elementor' ),
570 + 'label' => __( 'Lightbox', 'elementor' ),
734 571 'type' => Controls_Manager::SWITCHER,
735 572 'frontend_available' => true,
736 - 'label_off' => esc_html__( 'Off', 'elementor' ),
737 - 'label_on' => esc_html__( 'On', 'elementor' ),
573 + 'label_off' => __( 'Off', 'elementor' ),
574 + 'label_on' => __( 'On', 'elementor' ),
738 575 'condition' => [
739 576 'show_image_overlay' => 'yes',
740 577 'image_overlay[url]!' => '',
741 578 ],
@@ -747,9 +584,9 @@
747 584
748 585 $this->start_controls_section(
749 586 'section_video_style',
750 587 [
751 - 'label' => esc_html__( 'Video', 'elementor' ),
588 + 'label' => __( 'Video', 'elementor' ),
752 589 'tab' => Controls_Manager::TAB_STYLE,
753 590 ]
754 591 );
755 592
@@ -755,9 +592,9 @@
755 592
756 593 $this->add_control(
757 594 'aspect_ratio',
758 595 [
759 - 'label' => esc_html__( 'Aspect Ratio', 'elementor' ),
596 + 'label' => __( 'Aspect Ratio', 'elementor' ),
760 597 'type' => Controls_Manager::SELECT,
761 598 'options' => [
762 599 '169' => '16:9',
763 600 '219' => '21:9',
@@ -765,20 +602,11 @@
765 602 '32' => '3:2',
766 603 '11' => '1:1',
767 604 '916' => '9:16',
768 605 ],
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 606 'default' => '169',
778 - 'selectors' => [
779 - '{{WRAPPER}} .elementor-wrapper' => '--video-aspect-ratio: {{VALUE}}',
780 - ],
607 + 'prefix_class' => 'elementor-aspect-ratio-',
608 + 'frontend_available' => true,
781 609 ]
782 610 );
783 611
784 612 $this->add_group_control(
@@ -788,31 +616,18 @@
788 616 'selector' => '{{WRAPPER}} .elementor-wrapper',
789 617 ]
790 618 );
791 619
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 620 $this->add_control(
807 621 'play_icon_title',
808 622 [
809 - 'label' => esc_html__( 'Play Icon', 'elementor' ),
623 + 'label' => __( 'Play Icon', 'elementor' ),
810 624 'type' => Controls_Manager::HEADING,
811 625 'condition' => [
812 626 'show_image_overlay' => 'yes',
813 627 'show_play_icon' => 'yes',
814 628 ],
629 + 'separator' => 'before',
815 630 ]
816 631 );
817 632
818 633 $this->add_control(
@@ -817,13 +632,12 @@
817 632
818 633 $this->add_control(
819 634 'play_icon_color',
820 635 [
821 - 'label' => esc_html__( 'Color', 'elementor' ),
636 + 'label' => __( 'Color', 'elementor' ),
822 637 'type' => Controls_Manager::COLOR,
823 638 'selectors' => [
824 639 '{{WRAPPER}} .elementor-custom-embed-play i' => 'color: {{VALUE}}',
825 - '{{WRAPPER}} .elementor-custom-embed-play svg' => 'fill: {{VALUE}}',
826 640 ],
827 641 'condition' => [
828 642 'show_image_overlay' => 'yes',
829 643 'show_play_icon' => 'yes',
@@ -833,11 +647,10 @@
833 647
834 648 $this->add_responsive_control(
835 649 'play_icon_size',
836 650 [
837 - 'label' => esc_html__( 'Size', 'elementor' ),
651 + 'label' => __( 'Size', 'elementor' ),
838 652 'type' => Controls_Manager::SLIDER,
839 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
840 653 'range' => [
841 654 'px' => [
842 655 'min' => 10,
843 656 'max' => 300,
@@ -843,11 +656,9 @@
843 656 'max' => 300,
844 657 ],
845 658 ],
846 659 'selectors' => [
847 - // Not using a CSS vars because the default size value is coming from a global scss file.
848 660 '{{WRAPPER}} .elementor-custom-embed-play i' => 'font-size: {{SIZE}}{{UNIT}}',
849 - '{{WRAPPER}} .elementor-custom-embed-play svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
850 661 ],
851 662 'condition' => [
852 663 'show_image_overlay' => 'yes',
853 664 'show_play_icon' => 'yes',
@@ -861,15 +672,14 @@
861 672 'name' => 'play_icon_text_shadow',
862 673 'selector' => '{{WRAPPER}} .elementor-custom-embed-play i',
863 674 'fields_options' => [
864 675 'text_shadow_type' => [
865 - 'label' => esc_html__( 'Shadow', 'elementor' ),
676 + 'label' => _x( 'Shadow', 'Text Shadow Control', 'elementor' ),
866 677 ],
867 678 ],
868 679 'condition' => [
869 680 'show_image_overlay' => 'yes',
870 681 'show_play_icon' => 'yes',
871 - 'play_icon[library]!' => 'svg',
872 682 ],
873 683 ]
874 684 );
875 685
@@ -877,9 +687,9 @@
877 687
878 688 $this->start_controls_section(
879 689 'section_lightbox_style',
880 690 [
881 - 'label' => esc_html__( 'Lightbox', 'elementor' ),
691 + 'label' => __( 'Lightbox', 'elementor' ),
882 692 'tab' => Controls_Manager::TAB_STYLE,
883 693 'condition' => [
884 694 'show_image_overlay' => 'yes',
885 695 'image_overlay[url]!' => '',
@@ -890,9 +700,9 @@
890 700
891 701 $this->add_control(
892 702 'lightbox_color',
893 703 [
894 - 'label' => esc_html__( 'Background Color', 'elementor' ),
704 + 'label' => __( 'Background Color', 'elementor' ),
895 705 'type' => Controls_Manager::COLOR,
896 706 'selectors' => [
897 707 '#elementor-lightbox-{{ID}}' => 'background-color: {{VALUE}};',
898 708 ],
@@ -901,13 +711,12 @@
901 711
902 712 $this->add_control(
903 713 'lightbox_ui_color',
904 714 [
905 - 'label' => esc_html__( 'UI Color', 'elementor' ),
715 + 'label' => __( 'UI Color', 'elementor' ),
906 716 'type' => Controls_Manager::COLOR,
907 717 'selectors' => [
908 718 '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button' => 'color: {{VALUE}}',
909 - '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button svg' => 'fill: {{VALUE}}',
910 719 ],
911 720 ]
912 721 );
913 722
@@ -913,96 +722,67 @@
913 722
914 723 $this->add_control(
915 724 'lightbox_ui_color_hover',
916 725 [
917 - 'label' => esc_html__( 'UI Hover Color', 'elementor' ),
726 + 'label' => __( 'UI Hover Color', 'elementor' ),
918 727 'type' => Controls_Manager::COLOR,
919 728 'selectors' => [
920 729 '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover' => 'color: {{VALUE}}',
921 - '#elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover svg' => 'fill: {{VALUE}}',
922 730 ],
731 + 'separator' => 'after',
923 732 ]
924 733 );
925 734
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 735 $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 736 'lightbox_video_width',
953 737 [
954 - 'label' => esc_html__( 'Content Width', 'elementor' ),
738 + 'label' => __( 'Content Width', 'elementor' ),
955 739 'type' => Controls_Manager::SLIDER,
956 - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
957 740 'default' => [
958 741 'unit' => '%',
959 742 ],
960 - // 'selectors' => [
961 - // '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
962 - // ],
963 - 'condition' => [
964 - 'lightbox_video_width!' => '',
965 - 'lightbox_content_position!' => '',
743 + 'range' => [
744 + '%' => [
745 + 'min' => 30,
746 + ],
966 747 ],
748 + 'selectors' => [
749 + '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
750 + ],
967 751 ]
968 752 );
969 753
970 - // Deprecated control. Visible only if it was previously in use.
971 754 $this->add_control(
972 755 'lightbox_content_position',
973 756 [
974 - 'label' => esc_html__( 'Content Position', 'elementor' ),
757 + 'label' => __( 'Content Position', 'elementor' ),
975 758 'type' => Controls_Manager::SELECT,
976 759 'frontend_available' => true,
977 760 'options' => [
978 - '' => esc_html__( 'Center', 'elementor' ),
979 - 'top' => esc_html__( 'Top', 'elementor' ),
761 + '' => __( 'Center', 'elementor' ),
762 + 'top' => __( 'Top', 'elementor' ),
980 763 ],
981 - // 'selectors' => [
982 - // '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
983 - // ],
764 + 'selectors' => [
765 + '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
766 + ],
984 767 'selectors_dictionary' => [
985 768 'top' => 'top: 60px',
986 769 ],
987 - 'condition' => [
988 - 'lightbox_video_width!' => '',
989 - 'lightbox_content_position!' => '',
990 - ],
991 770 ]
992 771 );
993 772
773 + $this->add_responsive_control(
774 + 'lightbox_content_animation',
775 + [
776 + 'label' => __( 'Entrance Animation', 'elementor' ),
777 + 'type' => Controls_Manager::ANIMATION,
778 + 'frontend_available' => true,
779 + ]
780 + );
781 +
994 782 $this->end_controls_section();
995 783 }
996 784
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 785 /**
1006 786 * Render video widget output on the frontend.
1007 787 *
1008 788 * Written in PHP and used to generate the final HTML.
@@ -1017,12 +797,8 @@
1017 797
1018 798 if ( 'hosted' === $settings['video_type'] ) {
1019 799 $video_url = $this->get_hosted_video_url();
1020 800 } else {
1021 - if ( 'videopress' === $settings['video_type'] ) {
1022 - $video_url = $this->get_videopress_video_url();
1023 - }
1024 -
1025 801 $embed_params = $this->get_embed_params();
1026 802 $embed_options = $this->get_embed_options();
1027 803 }
1028 804
@@ -1048,9 +824,9 @@
1048 824
1049 825 if ( $is_static_render_mode ) {
1050 826 $video_html = Embed::get_embed_thumbnail_html( $video_url, $post_id );
1051 827 // YouTube API requires a different markup which was set above.
1052 - } elseif ( 'youtube' !== $settings['video_type'] ) {
828 + } else if ( 'youtube' !== $settings['video_type'] ) {
1053 829 $video_html = Embed::get_embed_html( $video_url, $embed_params, $embed_options );
1054 830 }
1055 831 }
1056 832
@@ -1061,14 +837,18 @@
1061 837 }
1062 838
1063 839 $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-wrapper' );
1064 840
841 + if ( ! $settings['lightbox'] ) {
842 + $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-fit-aspect-ratio' );
843 + }
844 +
1065 845 $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-open-' . ( $settings['lightbox'] ? 'lightbox' : 'inline' ) );
1066 846 ?>
1067 - <div <?php $this->print_render_attribute_string( 'video-wrapper' ); ?>>
847 + <div <?php echo $this->get_render_attribute_string( 'video-wrapper' ); ?>>
1068 848 <?php
1069 849 if ( ! $settings['lightbox'] ) {
1070 - Utils::print_unescaped_internal_string( $video_html ); // XSS ok.
850 + echo $video_html; // XSS ok.
1071 851 }
1072 852
1073 853 if ( $this->has_image_overlay() ) {
1074 854 $this->add_render_attribute( 'image-overlay', 'class', 'elementor-custom-embed-image-overlay' );
@@ -1083,15 +863,14 @@
1083 863 $lightbox_options = [
1084 864 'type' => 'video',
1085 865 'videoType' => $settings['video_type'],
1086 866 'url' => $lightbox_url,
1087 - 'autoplay' => $settings['autoplay'],
1088 867 'modalOptions' => [
1089 868 'id' => 'elementor-lightbox-' . $this->get_id(),
1090 869 'entranceAnimation' => $settings['lightbox_content_animation'],
1091 870 'entranceAnimation_tablet' => $settings['lightbox_content_animation_tablet'],
1092 871 'entranceAnimation_mobile' => $settings['lightbox_content_animation_mobile'],
1093 - 'videoAspectRatio' => $settings['aspect_ratio'] ?? '169',
872 + 'videoAspectRatio' => $settings['aspect_ratio'],
1094 873 ],
1095 874 ];
1096 875
1097 876 if ( 'hosted' === $settings['video_type'] ) {
@@ -1100,9 +879,8 @@
1100 879
1101 880 $this->add_render_attribute( 'image-overlay', [
1102 881 'data-elementor-open-lightbox' => 'yes',
1103 882 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ),
1104 - 'data-e-action-hash' => Plugin::instance()->frontend->create_action_hash( 'lightbox', $lightbox_options ),
1105 883 ] );
1106 884
1107 885 if ( Plugin::$instance->editor->is_edit_mode() ) {
1108 886 $this->add_render_attribute( 'image-overlay', [
@@ -1119,23 +897,16 @@
1119 897
1120 898 $this->add_render_attribute( 'image-overlay', 'style', 'background-image: url(' . $image_url . ');' );
1121 899 }
1122 900 ?>
1123 - <div <?php $this->print_render_attribute_string( 'image-overlay' ); ?>>
901 + <div <?php echo $this->get_render_attribute_string( 'image-overlay' ); ?>>
1124 902 <?php if ( $settings['lightbox'] ) : ?>
1125 - <?php Group_Control_Image_Size::print_attachment_image_html( $settings, 'image_overlay' ); ?>
903 + <?php echo Group_Control_Image_Size::get_attachment_image_html( $settings, 'image_overlay' ); ?>
1126 904 <?php endif; ?>
1127 905 <?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 - ?>
906 + <div class="elementor-custom-embed-play" role="button">
907 + <i class="eicon-play" aria-hidden="true"></i>
908 + <span class="elementor-screen-only"><?php echo __( 'Play Video', 'elementor' ); ?></span>
1138 909 </div>
1139 910 <?php endif; ?>
1140 911 </div>
1141 912 <?php } ?>
@@ -1145,9 +916,9 @@
1145 916
1146 917 /**
1147 918 * Render video widget as plain content.
1148 919 *
1149 - * Override the default behavior, by printing the video URL instead of rendering it.
920 + * Override the default behavior, by printing the video URL insted of rendering it.
1150 921 *
1151 922 * @since 1.4.5
1152 923 * @access public
1153 924 */
@@ -1193,9 +964,9 @@
1193 964 'loop',
1194 965 'controls',
1195 966 'mute',
1196 967 'rel',
1197 - 'cc_load_policy',
968 + 'modestbranding',
1198 969 ];
1199 970
1200 971 if ( $settings['loop'] ) {
1201 972 $video_properties = Embed::get_video_properties( $settings['youtube_url'] );
@@ -1219,12 +990,8 @@
1219 990
1220 991 $params['color'] = str_replace( '#', '', $settings['color'] );
1221 992
1222 993 $params['autopause'] = '0';
1223 -
1224 - if ( ! empty( $settings['yt_privacy'] ) ) {
1225 - $params['dnt'] = 'true';
1226 - }
1227 994 } elseif ( 'dailymotion' === $settings['video_type'] ) {
1228 995 $params_dictionary = [
1229 996 'controls',
1230 997 'mute',
@@ -1236,12 +1003,8 @@
1236 1003
1237 1004 $params['start'] = $settings['start'];
1238 1005
1239 1006 $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 1007 }
1245 1008
1246 1009 foreach ( $params_dictionary as $key => $param_name ) {
1247 1010 $setting_name = $param_name;
@@ -1308,12 +1071,8 @@
1308 1071 $video_params[ $option_name ] = '';
1309 1072 }
1310 1073 }
1311 1074
1312 - if ( $settings['preload'] ) {
1313 - $video_params['preload'] = $settings['preload'];
1314 - }
1315 -
1316 1075 if ( $settings['mute'] ) {
1317 1076 $video_params['muted'] = 'muted';
1318 1077 }
1319 1078
@@ -1332,8 +1091,9 @@
1332 1091 return $video_params;
1333 1092 }
1334 1093
1335 1094 /**
1095 + * @param bool $from_media
1336 1096 *
1337 1097 * @return string
1338 1098 * @since 2.1.0
1339 1099 * @access private
@@ -1366,39 +1126,9 @@
1366 1126 return $video_url;
1367 1127 }
1368 1128
1369 1129 /**
1370 - * Get the VideoPress video URL from the current selected settings.
1371 1130 *
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 1131 * @since 2.1.0
1402 1132 * @access private
1403 1133 */
1404 1134 private function render_hosted_video() {
@@ -1407,32 +1137,9 @@
1407 1137 return;
1408 1138 }
1409 1139
1410 1140 $video_params = $this->get_hosted_params();
1411 - /* Sometimes the video url is base64, therefore we use `esc_attr` in `src`. */
1412 1141 ?>
1413 - <video class="elementor-video" src="<?php echo esc_attr( $video_url ); ?>" <?php Utils::print_html_attributes( $video_params ); ?>></video>
1142 + <video class="elementor-video" src="<?php echo esc_url( $video_url ); ?>" <?php echo Utils::render_html_attributes( $video_params ); ?>></video>
1414 1143 <?php
1415 - }
1416 -
1417 - public function render_markdown(): string {
1418 - $settings = $this->get_settings_for_display();
1419 - $video_type = $settings['video_type'] ?? 'youtube';
1420 - $url = '';
1421 -
1422 - if ( 'hosted' === $video_type ) {
1423 - if ( ! empty( $settings['insert_url'] ) ) {
1424 - $url = $settings['external_url']['url'] ?? '';
1425 - } else {
1426 - $url = $settings['hosted_url']['url'] ?? '';
1427 - }
1428 - } else {
1429 - $url = $settings[ $video_type . '_url' ] ?? '';
1430 - }
1431 -
1432 - if ( empty( $url ) ) {
1433 - return '';
1434 - }
1435 -
1436 - return '[Video](' . esc_url( $url ) . ')';
1437 1144 }
1438 1145 }