PluginProbe
Elementor Website Builder – more than just a page builder / 3.27.4
Elementor Website Builder – more than just a page builder v3.27.4
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 +28 -47 4.2.0-dev23.27.4 View file →
@@ -115,30 +115,8 @@
115 115 * Register video widget controls.
116 116 *
117 117 * Adds different input fields to allow the user to change and customize the widget settings.
118 118 *
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 119 * @since 3.1.0
142 120 * @access protected
143 121 */
144 122 protected function register_controls() {
@@ -432,8 +410,21 @@
432 410 ]
433 411 );
434 412
435 413 $this->add_control(
414 + 'modestbranding',
415 + [
416 + 'label' => esc_html__( 'Modest Branding', 'elementor' ),
417 + 'type' => Controls_Manager::SWITCHER,
418 + 'condition' => [
419 + 'video_type' => [ 'youtube' ],
420 + 'controls' => 'yes',
421 + ],
422 + 'frontend_available' => true,
423 + ]
424 + );
425 +
426 + $this->add_control(
436 427 'cc_load_policy',
437 428 [
438 429 'label' => esc_html__( 'Captions', 'elementor' ),
439 430 'type' => Controls_Manager::SWITCHER,
@@ -626,8 +617,18 @@
626 617 ],
627 618 ]
628 619 );
629 620
621 + if ( ! Utils::has_pro() ) {
622 + $this->add_control(
623 + Utils::VIDEO_PLAYLIST . '_promotion',
624 + [
625 + 'label' => esc_html__( 'Video Playlist widget', 'elementor' ),
626 + 'type' => Promotion_Control::TYPE,
627 + ]
628 + );
629 + }
630 +
630 631 $this->end_controls_section();
631 632
632 633 $this->start_controls_section(
633 634 'section_image_overlay',
@@ -957,9 +958,9 @@
957 958 'default' => [
958 959 'unit' => '%',
959 960 ],
960 961 // 'selectors' => [
961 - // '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
962 + // '(desktop+)#elementor-lightbox-{{ID}} .elementor-video-container' => 'width: {{SIZE}}{{UNIT}};',
962 963 // ],
963 964 'condition' => [
964 965 'lightbox_video_width!' => '',
965 966 'lightbox_content_position!' => '',
@@ -978,9 +979,9 @@
978 979 '' => esc_html__( 'Center', 'elementor' ),
979 980 'top' => esc_html__( 'Top', 'elementor' ),
980 981 ],
981 982 // 'selectors' => [
982 - // '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
983 + // '#elementor-lightbox-{{ID}} .elementor-video-container' => '{{VALUE}}; transform: translateX(-50%);',
983 984 // ],
984 985 'selectors_dictionary' => [
985 986 'top' => 'top: 60px',
986 987 ],
@@ -1048,9 +1049,9 @@
1048 1049
1049 1050 if ( $is_static_render_mode ) {
1050 1051 $video_html = Embed::get_embed_thumbnail_html( $video_url, $post_id );
1051 1052 // YouTube API requires a different markup which was set above.
1052 - } elseif ( 'youtube' !== $settings['video_type'] ) {
1053 + } else if ( 'youtube' !== $settings['video_type'] ) {
1053 1054 $video_html = Embed::get_embed_html( $video_url, $embed_params, $embed_options );
1054 1055 }
1055 1056 }
1056 1057
@@ -1193,8 +1194,9 @@
1193 1194 'loop',
1194 1195 'controls',
1195 1196 'mute',
1196 1197 'rel',
1198 + 'modestbranding',
1197 1199 'cc_load_policy',
1198 1200 ];
1199 1201
1200 1202 if ( $settings['loop'] ) {
@@ -1332,8 +1334,9 @@
1332 1334 return $video_params;
1333 1335 }
1334 1336
1335 1337 /**
1338 + * @param bool $from_media
1336 1339 *
1337 1340 * @return string
1338 1341 * @since 2.1.0
1339 1342 * @access private
@@ -1411,28 +1414,6 @@
1411 1414 /* Sometimes the video url is base64, therefore we use `esc_attr` in `src`. */
1412 1415 ?>
1413 1416 <video class="elementor-video" src="<?php echo esc_attr( $video_url ); ?>" <?php Utils::print_html_attributes( $video_params ); ?>></video>
1414 1417 <?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 1418 }
1438 1419 }