start_controls_section( 'section_video', [ 'label' => __( 'Video Settings', 'easy-elements' ), ] ); $this->add_control( 'display_type', [ 'label' => __( 'Display Type', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'default' => 'normal', 'options' => [ 'normal' => __( 'Normal Only', 'easy-elements' ), 'popup' => __( 'Popup Only', 'easy-elements' ), ], ] ); $this->add_control( 'video_type', [ 'label' => __( 'Video Type', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'default' => 'youtube', 'options' => [ 'youtube' => __( 'YouTube', 'easy-elements' ), 'vimeo' => __( 'Vimeo', 'easy-elements' ), 'self_hosted'=> __( 'Self Hosted', 'easy-elements' ), ], ] ); $this->add_control( 'video_url', [ 'label' => __( 'Video URL', 'easy-elements' ), 'type' => Controls_Manager::TEXT, 'default' => 'https://www.youtube.com/watch?v=hDABYoas7SY', 'placeholder' => __( 'https://www.youtube.com/watch?v=hDABYoas7SY', 'easy-elements' ), 'condition' => [ 'video_type' => 'youtube', ], ] ); $this->add_control( 'video_url_vimeo', [ 'label' => __( 'Video URL', 'easy-elements' ), 'type' => Controls_Manager::TEXT, 'default' => 'https://vimeo.com/347119375', 'placeholder' => __( 'https://vimeo.com/347119375', 'easy-elements' ), 'condition' => [ 'video_type' => 'vimeo', ], ] ); $this->add_control( 'self_hosted_video', [ 'label' => __( 'Self Hosted Video', 'easy-elements' ), 'type' => Controls_Manager::MEDIA, 'media_type' => 'video', 'condition' => [ 'video_type' => 'self_hosted', ], ] ); $this->add_responsive_control( 'video_height', [ 'label' => __( 'Video Height', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'vh' ], 'range' => [ 'px' => [ 'min' => 100, 'max' => 1000, ], 'vh' => [ 'min' => 10, 'max' => 100, ], ], 'default' => [ 'size' => 700, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-wrapper iframe' => 'height: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eel-video-popup-wrapper video' => 'height: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'display_type' => 'normal', ], ] ); $this->add_responsive_control( 'video_max_width', [ 'label' => __( 'Video Max Width', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 100, 'max' => 1920, ], '%' => [ 'min' => 10, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-wrapper iframe.eel-normal-video' => 'max-width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eel-video-popup-wrapper video.eel-normal-video' => 'max-width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'display_type' => 'normal', ], ] ); $this->add_responsive_control( 'video_border_radius_normal', [ 'label' => __( 'Video Border Radius', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-wrapper iframe.eel-normal-video' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .eel-video-popup-wrapper video.eel-normal-video' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'display_type' => 'normal', ], ] ); $this->add_group_control( \Elementor\Group_Control_Css_Filter::get_type(), [ 'name' => 'video_filters', 'label' => __( 'CSS Filters', 'easy-elements' ), 'selector' => '{{WRAPPER}} .eel-video-popup-wrapper iframe, {{WRAPPER}} .eel-video-popup-wrapper video', ] ); $this->add_control( 'popup_trigger_text', [ 'label' => __( 'Trigger Text', 'easy-elements' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Play Video', 'easy-elements' ), 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_responsive_control( 'popup_icon_spacing', [ 'label' => __( 'Text Spacing', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'default' => [ 'size' => 8, 'unit' => 'px', ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-btn .eel-icon-wrap + .eel-trigger-text' => 'margin-left: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eel-video-popup-btn .eel-trigger-text + .eel-icon-wrap' => 'margin-left: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_control( 'popup_text_color', [ 'label' => __( 'Text Color', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel-video-popup-btn .eel-trigger-text' => 'color: {{VALUE}};', ], 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'popup_text_typography', 'label' => __( 'Typography', 'easy-elements' ), 'selector' => '{{WRAPPER}} .eel-video-popup-btn .eel-trigger-text', 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_control( 'popup_icon_show', [ 'label' => __( 'Show Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off' => __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => 'yes', 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_control( 'popup_icon_hover_show', [ 'label' => __( 'Default Hide & Hover Show', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off' => __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes' ], ] ); $this->add_control( 'popup_trigger_icon', [ 'label' => __( 'Icon', 'easy-elements' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => '', 'library' => 'fa-solid', ], 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_control( 'popup_icon_position', [ 'label' => __( 'Icon Position', 'easy-elements' ), 'type' => Controls_Manager::SELECT, 'default' => 'before', 'options' => [ 'before' => __( 'Before Text', 'easy-elements' ), 'after' => __( 'After Text', 'easy-elements' ), ], 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_control( 'popup_icon_color', [ 'label' => __( 'Icon Color', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel-video-popup-btn i' => 'color: {{VALUE}};', '{{WRAPPER}} .eel-video-popup-btn svg' => 'color: {{VALUE}};', '{{WRAPPER}} .eel-video-popup-btn svg path' => 'fill: {{VALUE}};', ], 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => __( 'Icon Size', 'easy-elements' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 8, 'max' => 100, ], ], 'default' => [ 'size' => 20, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-btn i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eel-video-popup-btn svg' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eel-video-popup-btn svg path' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_control( 'icon_bg_color', [ 'label' => __( 'Circle Background Color', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel-video-popup-btn .eel-icon-wrap' => 'background-color: {{VALUE}};', ], 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_responsive_control( 'circle_size', [ 'label' => __( 'Circle Size', 'easy-elements' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 10, 'max' => 200 ], ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-btn .eel-icon-wrap' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; place-content: center;', ], 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_responsive_control( 'icon_border_radius', [ 'label' => __( 'Circle Border Radius', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-btn .eel-icon-wrap, {{WRAPPER}} .eel-icon-wrap .eel-overlay-play' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'circle_shadow', 'label' => __( 'Circle Shadow', 'easy-elements' ), 'selector' => '{{WRAPPER}} .eel-video-popup-btn .eel-icon-wrap', 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'button_border', 'label' => __( 'Button Border', 'easy-elements' ), 'selector' => '{{WRAPPER}} .eel-video-popup-btn .eel-icon-wrap', 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_control( 'circle_glow', [ 'label' => __( 'Active Ripple', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'On', 'easy-elements' ), 'label_off' => __( 'Off', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'display_type' => 'popup', 'popup_icon_show' => 'yes', ], ] ); $this->add_control( 'glow_color', [ 'label' => __( 'Ripple Color', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(102, 102, 102, 0.1)', 'selectors' => [ '{{WRAPPER}} .eel-video-popup-btn.eel-glow-active .eel-icon-wrap' => '--glow-color: {{VALUE}};', ], 'condition' => [ 'display_type' => 'popup', 'circle_glow' => 'yes', ], ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'wrap_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .eel-video-popup-wrapper', 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_responsive_control( 'wrap_radius', [ 'label' => __( 'Border Radius', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_responsive_control( 'wrap_padding', [ 'label' => __( 'Padding', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'display_type' => 'popup', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_video_self_options', [ 'label' => __( 'Video Settings', 'easy-elements' ), 'condition' => [ 'display_type' => 'normal', 'video_type' => 'self_hosted', ], ] ); $this->add_control( 'self_hosted_autoplay', [ 'label' => __( 'Autoplay', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off' => __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'display_type' => 'normal', 'video_type' => 'self_hosted', ], ] ); $this->add_control( 'self_hosted_loop', [ 'label' => __( 'Loop', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off' => __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'display_type' => 'normal', 'video_type' => 'self_hosted', ], ] ); $this->add_control( 'self_hosted_muted', [ 'label' => __( 'Muted', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off' => __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', 'condition' => [ 'display_type' => 'normal', 'video_type' => 'self_hosted', ], ] ); $this->add_control( 'self_hosted_controls', [ 'label' => __( 'Show Controls', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off' => __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => 'yes', 'condition' => [ 'display_type' => 'normal', 'video_type' => 'self_hosted', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_video_options', [ 'label' => __( 'Video Settings', 'easy-elements' ), 'condition' => [ 'display_type' => 'normal', 'video_type!' => 'self_hosted', ], ] ); $this->add_control( 'autoplay', [ 'label' => __( 'Autoplay', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off'=> __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'mute', [ 'label' => __( 'Mute', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off'=> __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'loop', [ 'label' => __( 'Loop', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off'=> __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'controls', [ 'label' => __( 'Player Controls', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'easy-elements' ), 'label_off'=> __( 'No', 'easy-elements' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'privacy_mode', [ 'label' => __( 'Privacy Mode', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'On', 'easy-elements' ), 'label_off'=> __( 'Off', 'easy-elements' ), 'return_value' => 'yes', 'description' => __( 'YouTube nocookie / Vimeo DNT', 'easy-elements' ), ] ); $this->add_control( 'yt_suggested', [ 'label' => __( 'Suggested Videos', 'easy-elements' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'easy-elements' ), 'label_off'=> __( 'Hide', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', 'description' => __( 'Show suggested videos at end', 'easy-elements' ), 'condition' => [ 'video_type' => 'youtube', ], ] ); $this->add_control( 'yt_start_time', [ 'label' => __( 'Start Time (seconds)', 'easy-elements' ), 'type' => Controls_Manager::NUMBER, 'min' => 0, 'default' => '', 'description' => __( 'Start video from specific second', 'easy-elements' ), 'condition' => [ 'video_type' => 'youtube', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_image_overlay', [ 'label' => __( 'Video Overlay', 'easy-elements' ), 'condition' => [ 'display_type' => 'normal', ], ] ); $this->add_control( 'show_image_overlay', [ 'label' => __( 'Image Overlay', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'On', 'easy-elements' ), 'label_off'=> __( 'Off', 'easy-elements' ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'overlay_image', [ 'label' => __( 'Choose Image', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'condition' => [ 'show_image_overlay' => 'yes', ], ] ); $this->add_control( 'overlay_image_size', [ 'label' => __( 'Image Resolution', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'full', 'options' => [ 'thumbnail' => __( 'Thumbnail', 'easy-elements' ), 'medium' => __( 'Medium', 'easy-elements' ), 'large' => __( 'Large', 'easy-elements' ), 'full' => __( 'Full', 'easy-elements' ), ], 'condition' => [ 'show_image_overlay' => 'yes', ], ] ); $this->add_control( 'overlay_play_icon', [ 'label' => __( 'Play Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'condition' => [ 'show_image_overlay' => 'yes', ], ] ); $this->add_control( 'overlay_icon', [ 'label' => __( 'Icon', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::ICONS, 'condition' => [ 'show_image_overlay' => 'yes', 'overlay_play_icon' => 'yes', ], ] ); $this->add_control( 'overlay_lightbox', [ 'label' => __( 'Lightbox', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'return_value' => 'yes', 'default' => '', 'condition' => [ 'show_image_overlay' => 'yes', ], ] ); $this->add_control( 'lightbox_animation', [ 'label' => __( 'Animation', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::ANIMATION, 'default' => '', 'condition' => [ 'overlay_lightbox' => 'yes', 'show_image_overlay' => 'yes', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_video_popup_overlay_settings', [ 'label' => __( 'Play Button Overlay Settings', 'easy-elements' ), 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_control( 'popup_play_overlay', [ 'label' => __( 'Play Overlay', 'easy-elements' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Play', 'easy-elements' ), ] ); $this->add_control( 'popup_play_color', [ 'label' => esc_html__('Text Color', 'easy-elements'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel-icon-wrap .eel-overlay-play' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'popup_play__typography', 'selector' => '{{WRAPPER}} .eel-icon-wrap .eel-overlay-play', ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'background_overly_play', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .eel-icon-wrap .eel-overlay-play', ] ); $this->end_controls_section(); $this->start_controls_section( 'video_icon_settings_style', [ 'label' => __( 'Video Overlay Style', 'easy-elements' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'display_type' => 'normal', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__('Icon Color', 'easy-elements'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel-overlay-play-icon' => 'color: {{VALUE}};', '{{WRAPPER}} .eel-overlay-play-icon svg path' => 'fill: {{VALUE}};', ], ] ); $this->add_responsive_control( 'video_icon_size', [ 'label' => esc_html__('Icon Size', 'easy-elements'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em', '%'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 200, ], 'em' => [ 'min' => 0.5, 'max' => 10, ], '%' => [ 'min' => 10, 'max' => 200, ], ], 'selectors' => [ '{{WRAPPER}} .eel-overlay-play-icon i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eel-overlay-play-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'video_border', 'selector' => '{{WRAPPER}} .eel-overlay-play-icon', ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'video_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .eel-overlay-play-icon', ] ); $this->add_responsive_control( 'video_border_radius', [ 'label' => esc_html__('Border Radius', 'easy-elements'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .eel-overlay-play-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'custom_circle_normal_size', [ 'label' => esc_html__('Circle Size', 'easy-elements'), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', '%' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 300, ], 'em' => [ 'min' => 0.5, 'max' => 20, ], '%' => [ 'min' => 5, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel-overlay-play-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'popup_style_section', [ 'label' => __( 'Popup Style', 'easy-elements' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'display_type' => 'popup', ], ] ); $this->add_control( 'popup_overlay_bg', [ 'label' => __( 'Overlay Background', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eel-video-popup-overlay' => 'background: {{VALUE}};', ], ] ); $this->add_responsive_control( 'popup_content_max_width', [ 'label' => __( 'Popup Max Width', 'easy-elements' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 300, 'max' => 1920, ], '%' => [ 'min' => 30, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-content' => 'max-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'popup_content_height', [ 'label' => __( 'Popup Height', 'easy-elements' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'vh' ], 'range' => [ 'px' => [ 'min' => 200, 'max' => 1080, ], 'vh' => [ 'min' => 20, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-iframe-wrapper' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'popup_content_border_radius', [ 'label' => __( 'Popup Border Radius', 'easy-elements' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eel-video-popup-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', ], ] ); $this->add_control( 'popup_close_color', [ 'label' => __( 'Close Button Color', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel-video-popup-close' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'popup_close_bg', [ 'label' => __( 'Close Button Background', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eel-video-popup-close' => 'background: {{VALUE}};', ], ] ); $this->end_controls_section(); } private function get_youtube_id( $url ) { preg_match('/(?:v=|\/)([0-9A-Za-z_-]{11}).*/', $url, $matches); return $matches[1] ?? ''; } private function get_vimeo_id( $url ) { preg_match('/(\d+)/', $url, $matches); return $matches[1] ?? ''; } protected function render() { $settings = $this->get_settings_for_display(); $embed_type = $settings['video_type']; $display_type = $settings['display_type']; $video_url = ''; /* ----------------------------------------- * Get Video URL * ----------------------------------------- */ if ( $embed_type === 'self_hosted' && ! empty( $settings['self_hosted_video']['url'] ) ) { $video_url = $settings['self_hosted_video']['url']; } elseif ( $embed_type === 'youtube' && ! empty( $settings['video_url'] ) ) { $video_url = $settings['video_url']; } elseif ( $embed_type === 'vimeo' && ! empty( $settings['video_url_vimeo'] ) ) { $video_url = $settings['video_url_vimeo']; } if ( empty( $video_url ) ) { return; } $video_id = uniqid( 'eel_video_' ); $circle_glow = ( ! empty( $settings['circle_glow'] ) && $settings['circle_glow'] === 'yes' ) ? 'eel-glow-active' : ''; $icon_hide_h_show = ( ! empty( $settings['popup_icon_hover_show'] ) && $settings['popup_icon_hover_show'] === 'yes' ) ? 'eel-vicon-hide-show' : ''; echo '