PluginProbe
Elementor Website Builder – more than just a page builder / 3.23.0-dev3
Elementor Website Builder – more than just a page builder v3.23.0-dev3
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 +10 -49 4.2.03.23.0-dev3 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 }
@@ -93,26 +92,8 @@
93 92 return false;
94 93 }
95 94
96 95 /**
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 96 * Register video widget controls.
116 97 *
117 98 * Adds different input fields to allow the user to change and customize the widget settings.
118 99 *
@@ -432,11 +413,11 @@
432 413 ]
433 414 );
434 415
435 416 $this->add_control(
436 - 'cc_load_policy',
417 + 'modestbranding',
437 418 [
438 - 'label' => esc_html__( 'Captions', 'elementor' ),
419 + 'label' => esc_html__( 'Modest Branding', 'elementor' ),
439 420 'type' => Controls_Manager::SWITCHER,
440 421 'condition' => [
441 422 'video_type' => [ 'youtube' ],
442 423 'controls' => 'yes',
@@ -957,9 +938,9 @@
957 938 'default' => [
958 939 'unit' => '%',
959 940 ],
960 941 // 'selectors' => [
961 - // '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
942 + // '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
962 943 // ],
963 944 'condition' => [
964 945 'lightbox_video_width!' => '',
965 946 'lightbox_content_position!' => '',
@@ -978,9 +959,9 @@
978 959 '' => esc_html__( 'Center', 'elementor' ),
979 960 'top' => esc_html__( 'Top', 'elementor' ),
980 961 ],
981 962 // 'selectors' => [
982 - // '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
963 + // '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
983 964 // ],
984 965 'selectors_dictionary' => [
985 966 'top' => 'top: 60px',
986 967 ],
@@ -1048,9 +1029,9 @@
1048 1029
1049 1030 if ( $is_static_render_mode ) {
1050 1031 $video_html = Embed::get_embed_thumbnail_html( $video_url, $post_id );
1051 1032 // YouTube API requires a different markup which was set above.
1052 - } elseif ( 'youtube' !== $settings['video_type'] ) {
1033 + } else if ( 'youtube' !== $settings['video_type'] ) {
1053 1034 $video_html = Embed::get_embed_html( $video_url, $embed_params, $embed_options );
1054 1035 }
1055 1036 }
1056 1037
@@ -1089,9 +1070,9 @@
1089 1070 'id' => 'elementor-lightbox-' . $this->get_id(),
1090 1071 'entranceAnimation' => $settings['lightbox_content_animation'],
1091 1072 'entranceAnimation_tablet' => $settings['lightbox_content_animation_tablet'],
1092 1073 'entranceAnimation_mobile' => $settings['lightbox_content_animation_mobile'],
1093 - 'videoAspectRatio' => $settings['aspect_ratio'] ?? '169',
1074 + 'videoAspectRatio' => $settings['aspect_ratio'],
1094 1075 ],
1095 1076 ];
1096 1077
1097 1078 if ( 'hosted' === $settings['video_type'] ) {
@@ -1134,8 +1115,9 @@
1134 1115 ];
1135 1116 }
1136 1117 Icons_Manager::render_icon( $settings['play_icon'], [ 'aria-hidden' => 'true' ] );
1137 1118 ?>
1119 + <span class="elementor-screen-only"><?php $this->print_a11y_text( $settings['image_overlay'] ); ?></span>
1138 1120 </div>
1139 1121 <?php endif; ?>
1140 1122 </div>
1141 1123 <?php } ?>
@@ -1145,9 +1127,9 @@
1145 1127
1146 1128 /**
1147 1129 * Render video widget as plain content.
1148 1130 *
1149 - * Override the default behavior, by printing the video URL instead of rendering it.
1131 + * Override the default behavior, by printing the video URL insted of rendering it.
1150 1132 *
1151 1133 * @since 1.4.5
1152 1134 * @access public
1153 1135 */
@@ -1193,9 +1175,9 @@
1193 1175 'loop',
1194 1176 'controls',
1195 1177 'mute',
1196 1178 'rel',
1197 - 'cc_load_policy',
1179 + 'modestbranding',
1198 1180 ];
1199 1181
1200 1182 if ( $settings['loop'] ) {
1201 1183 $video_properties = Embed::get_video_properties( $settings['youtube_url'] );
@@ -1332,8 +1314,9 @@
1332 1314 return $video_params;
1333 1315 }
1334 1316
1335 1317 /**
1318 + * @param bool $from_media
1336 1319 *
1337 1320 * @return string
1338 1321 * @since 2.1.0
1339 1322 * @access private
@@ -1411,28 +1394,6 @@
1411 1394 /* Sometimes the video url is base64, therefore we use `esc_attr` in `src`. */
1412 1395 ?>
1413 1396 <video class="elementor-video" src="<?php echo esc_attr( $video_url ); ?>" <?php Utils::print_html_attributes( $video_params ); ?>></video>
1414 1397 <?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 1398 }
1438 1399 }