<?php
/**
 * Elementor Video Widget.
 *
 * Elementor widget that inserts an embbedable content into the page, from any given URL.
 *
 * @since 1.0.5
 */
class Elementor_EA_Video_Widget extends \Elementor\Widget_Base {

	/**
	 * Get widget name.
	 *
	 * Retrieve Video widget name.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'ea-video';
	}

	/**
	 * Get widget title.
	 *
	 * Retrieve Video widget title.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return __( 'Video', 'endless-addons' );
	}

	/**
	 * Get widget icon.
	 *
	 * Retrieve Video widget icon.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'fa fa-video-camera';
	}

	/**
	 * Get widget categories.
	 *
	 * Retrieve the list of categories the Video widget belongs to.
	 *
	 * @since 1.0.5
	 * @access public
	 *
	 * @return array Widget categories.
	 */
	public function get_categories() {
		return [ 'endless-elements' ];
	}

	/**
	 * Register Video widget controls.
	 *
	 * Adds different input fields to allow the user to change and customize the widget settings.
	 *
	 * @since 1.0.5
	 * @access protected
	 */
	protected function register_controls() {

		$this->start_controls_section(
			'default_section',
			[    
				'label' => __( 'Settings', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT
			]
		);

		$this->add_control(
			'show_video',
			[
				'label' => __( 'Show/Hide Video Section', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::CHOOSE,
				'options' => [
					'show' => [
						'title' => __( 'Show', 'endless-addons' ),
						'icon' => 'fa fa-check'
					],
					'hide' => [
						'title' => __( 'Hide', 'endless-addons' ),
						'icon' => 'fa fa-close'
					]
				],
				'default' => 'show',
				'toggle' => true
			]
		);

		$this->add_control(
			'select_video_style',
			[
				'label' => __( 'Select Video Style', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'style-01' => __( 'Style 01', 'endless-addons' ),
					'style-02' => __( 'Style 02', 'endless-addons' ),
					'style-03' => __( 'Style 03', 'endless-addons' ),
					'style-04' => __( 'Style 04', 'endless-addons' ),
					'style-05' => __( 'Style 05', 'endless-addons' ),
					'style-06' => __( 'Style 06', 'endless-addons' ),
					'style-07' => __( 'Style 07', 'endless-addons' )
				],
				'default' => 'style-01'
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'video_section',
			[
				'label' => __( 'Video Section', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'video_section_title',
			[
				'label' => __( 'Section Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Design 1', 'endless-addons' )
			]
		);

		$this->add_control(
			'video_section_desc',
			[
				'label' => __( 'Section Description', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::WYSIWYG,
				'input_type' => 'WYSIWYG',
				'placeholder' => __( 'Description', 'endless-addons' ),
				'default' => __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt dolore magna aliqua. Quis ipsum suspendisse ultrices gravida.', 'endless-addons')
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name' => 'section_background',
				'label' => __( 'Background', 'plugin-domain' ),
				'types' => [ 'classic', 'gradient', 'video' ],
				'selector' => '{{WRAPPER}} .ea-video-area',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'video_content',
			[
				'label' => __( 'Video Content', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
			]
		);

		$this->add_control(
			'video_title',
			[
				'label' => __( 'Video Title', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXT,
				'input_type' => 'text',
				'placeholder' => __( 'Title', 'endless-addons' ),
				'default'  => __( 'Watch our video', 'endless-addons' )
			]
		);

		$this->add_control(
			'ea_title_tag',
			[
				'label' => __( 'Title Tag', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'h1' => __( 'h1', 'endless-addons' ),
					'h2' => __( 'h2', 'endless-addons' ),
					'h3' => __( 'h3', 'endless-addons' ),
					'h4' => __( 'h4', 'endless-addons' ),
					'h5' => __( 'h5', 'endless-addons' ),
					'h6' => __( 'h6', 'endless-addons' )
				],
				'default' => 'h3'
			]
		);

		$this->add_control(
			'video_desc',
			[
				'label' => __( 'Video Description', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::TEXTAREA,
				'placeholder' => __( 'Description', 'endless-addons' ),
				'default' => __( 'Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus. Donec rutrum congue leo eget malesuada. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vivamus magna justo, laci nia eget consectetur sed, convallis at tellus. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus.', 'endless-addons'),
				'condition' => [
                    'select_video_style' => array('style-02', 'style-03', 'style-04', 'style-06', 'style-07'),
                ]
			]
		);

		$this->add_control(
			'icon_type',
			[
				'label' => __( 'Icon Type', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SELECT,
				'input_type' => 'SELECT',
				'options' => [
					'general' => __( 'General', 'endless-addons' ),
					'library' => __( 'Library', 'endless-addons' ),
				],
				'default' => 'general'
			]
		);

		$this->add_control(
			'video_icon1', 
			[
				'label' => __( 'Video Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICON,
				'input_type' => 'icon',
				'default'  => 'bx bx-play',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'general'
                ]
			]
		);

		$this->add_control(
			'video_icon2', 
			[
				'label' => __( 'Video Icon', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::ICONS,
				'input_type' => 'icon',
				'show_label' => true,
				'options' => endless_addons_icons(),
				'condition' => [
                    'icon_type' => 'library'
                ]
			]
		);

		$this->add_control(
            'ea_video_source',
            [
                'label' => __('Source', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::SELECT,
                'default' => 'youtube',
                'options' => [
                    'youtube' => __('YouTube', 'endless-addons'),
                    'vimeo' => __('Vimeo', 'endless-addons'),
                    'self_hosted' => __('Self Hosted', 'endless-addons'),
                ],
            ]
        );

        $this->add_control(
            'video_link_youtube',
            [
                'label' => __('Link', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'placeholder' => __('Enter your URL (YouTube)', 'endless-addons'),
                'label_block' => true,
                'default' => 'http://www.youtube.com/watch?v=0O2aH4XLbto',
                'condition' => [
                    'ea_video_source' => 'youtube',
                ],
            ]
        );

        $this->add_control(
            'video_link_vimeo',
            [
                'label' => __('Link', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'placeholder' => __('Enter your URL (Vimeo)', 'endless-addons'),
                'label_block' => true,
                'default' => 'https://vimeo.com/462650807',
                'condition' => [
                    'ea_video_source' => 'vimeo',
                ],
            ]
        );

        $this->add_control(
            'video_link_external',
            [
                'label' => __('External URL', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_block' => false,
                'condition' => [
                    'ea_video_source' => 'self_hosted',
                ],
            ]
        );

        $this->add_control(
            'video_hosted_url',
            [
                'label' => __('Choose File', 'elementor'),
                'type' => \Elementor\Controls_Manager::MEDIA,
                'media_type' => 'video',
                'condition' => [
                    'ea_video_source' => 'self_hosted',
                    'video_link_external' => '',
                ],
            ]
        );

        $this->add_control(
            'video_external_url',
            [
                'label' => __('Link', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::TEXT,
                'placeholder' => __('Enter your URL', 'endless-addons'),
                'label_block' => true,
                'show_label' => false,
                'condition' => [
                    'ea_video_source' => 'self_hosted',
                    'video_link_external' => 'yes',
                ],
            ]
        );

        $this->add_control(
            'video_start_time',
            [
                'label' => __('Start Time', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'min' => 0,
                'max' => 10000,
                'step' => 1,
                'default' => '',
                'description' => __('Specify a start time (in seconds)', 'endless-addons'),
                'condition' => [
                    'ea_video_source' => 'self_hosted'
                ],
            ]
        );

        $this->add_control(
            'video_end_time',
            [
                'label' => __('End Time', 'endless-addons'),
                'type' => \Elementor\Controls_Manager::NUMBER,
                'min' => 0,
                'max' => 10000,
                'step' => 1,
                'default' => '',
                'description' => __('Specify an end time (in seconds)', 'endless-addons'),
                'condition' => [
                    'ea_video_source' => 'self_hosted'
                ],
            ]
        );

		$this->add_control(
			'video_bg_img',
			[
				'label' => __( 'Video Background Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'show_label' => true
			]
		);

		$this->add_control(
			'video_shape_img',
			[
				'label' => __( 'Video Shape Image', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::MEDIA,
				'show_label' => true,
				'condition' => [
                    'select_video_style' => 'style-07',
                ]
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style',
			[
				'label' => __( 'Section Style', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->add_control(
			'section_title_color',
			[
				'label' => __( 'Section Title Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-video-area .section-title h2' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'section_title_typography',
                'label' => __( 'Section Title Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-video-area .section-title h2'
            ]
        );

        $this->add_control(
			'section_desc_color',
			[
				'label' => __( 'Section Description Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-video-area .section-title p' => 'color: {{VALUE}}'
                ]
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'section_desc_typography',
                'label' => __( 'Section Description Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-video-area .section-title p'
            ]
        );

		$this->end_controls_section();

		$this->start_controls_section(
			'video_style',
			[
				'label' => __( 'Video Style', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->add_control(
			'video_bg',
			[
				'label' => __( 'Video Background Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-video-area .ea-video-content::before, .ea-video-area .ea-video-bg' => 'background: {{VALUE}}'
                ],
                'condition' => [
                    'select_video_style' => array('style-01', 'style-02', 'style-04', 'style-06', 'style-07'),
                ]
			]
		);

		$this->add_control(
			'video_title_color',
			[
				'label' => __( 'Video Title Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-video-content .ea-title, .ea-video-bg .ea-title' => 'color: {{VALUE}}'
                ]
			]
		);

		$this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'video_title_typography',
                'label' => __( 'Video Title Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-video-content .ea-title, .ea-video-bg .ea-title'
            ]
        );

        $this->add_control(
			'video_desc_color',
			[
				'label' => __( 'Video Description Color', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::COLOR,
				'selectors' => [
                    '{{WRAPPER}} .ea-video-bg p' => 'color: {{VALUE}}'
                ],
                'condition' => [
                    'select_video_style' => array('style-02', 'style-03', 'style-04', 'style-06', 'style-07'),
                ]
			]
		);

        $this->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name' => 'video_desc_typography',
                'label' => __( 'Video Description Typography', 'endless-addons' ),
                'scheme' => \Elementor\Core\Schemes\Typography::TYPOGRAPHY_1,
                'selector' => '{{WRAPPER}} .ea-video-bg p',
                'condition' => [
                    'select_video_style' => array('style-02', 'style-03', 'style-04', 'style-06', 'style-07'),
                ]
            ]
        );

		$this->end_controls_section();

		$this->start_controls_section(
			'parallax_style',
			[
				'label' => __( 'Background Parallax', 'endless-addons' ),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE,
				'condition' => [
                    'select_video_style' => array('style-01', 'style-03', 'style-05'),
               ]
			]
		);

		$this->add_control(
			'enable_parallax',
			[
				'label' => __( 'Enable Parallax', 'endless-addons' ),
				'type' => \Elementor\Controls_Manager::SWITCHER,
				'label_on' => __( 'Yes', 'endless-addons' ),
				'label_off' => __( 'No', 'endless-addons' ),
				'return_value' => 'yes',
				'default' => 'no',
			]
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'_section_overlay_style',
			[
				'label' => __('Background Overlay', 'endless-addons'),
				'tab' => \Elementor\Controls_Manager::TAB_STYLE
			]
		);

		$this->start_controls_tabs('_tabs_overlay_style');

		$this->start_controls_tab(
			'_tab_overlay_normal',
			[
				'label' => __('Normal', 'endless-addons'),
			]
		);

		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name'     => 'hover_overlay_normal',
				'label' => __('Background', 'endless-addons'),
				'show_label' => true,
				'types' => ['classic', 'gradient'],
				'exclude' => [
					'classic' => 'image'
				],
				'selector' => '{{WRAPPER}} .ea-video-area',
			]
		);

		$this->end_controls_tab();

		$this->start_controls_tab(
			'_tab_overlay_hover',
			[
				'label' => __('Hover', 'endless-addons'),
			]
		);


		$this->add_group_control(
			\Elementor\Group_Control_Background::get_type(),
			[
				'name'     => 'hover_overlay_hover',
				'label' => __('Background', 'endless-addons'),
				'show_label' => true,
				'types' => ['classic', 'gradient'],
				'exclude' => [
					'classic' => 'image'
				],
				'selector' => '{{WRAPPER}} .ea-video-area:hover',
			]
		);

		$this->end_controls_tab();

		$this->end_controls_tabs();

		$this->end_controls_section();

		require plugin_dir_path( dirname( __FILE__ ) ) . 'floating/ea-video-floating.php';

	}

	/**
	 * Render Video widget output on the frontend.
	 *
	 * Written in PHP and used to generate the final HTML.
	 *
	 * @since 1.0.5
	 * @access protected
	 */
	protected function render() {

		$settings = $this->get_settings_for_display();

		$startTime = $settings['video_start_time'];
		$endTime = $settings['video_end_time']; 

		if( $settings['ea_video_source'] == 'youtube' ) :
		    $ea_video_link = $settings['video_link_youtube'];
		elseif( $settings['ea_video_source'] == 'vimeo' ) :
		    $ea_video_link = $settings['video_link_vimeo'];
		elseif( $settings['ea_video_source'] == 'self_hosted' && $settings['video_link_external'] == '' ) :
			if( ! $endTime == '' ) : 
		        $ea_video_link = $settings['video_hosted_url']['url'] . '#t=' . esc_attr($startTime) . ',' . esc_attr($endTime);
		    else:
		    	$ea_video_link = $settings['video_hosted_url']['url'] . '#t=' . esc_attr($startTime);
		    endif;
		elseif( $settings['ea_video_source'] == 'self_hosted' && $settings['video_link_external'] == 'yes' ) :
		    if( ! $endTime == '' ) : 
		        $ea_video_link = $settings['video_external_url'] . '#t=' . esc_attr($startTime) . ',' . esc_attr($endTime);
		    else:
		    	$ea_video_link = $settings['video_external_url'] . '#t=' . esc_attr($startTime);
		    endif;
		endif;   

		if( $settings['show_video'] == 'show' ) :
            if( $settings['select_video_style'] == 'style-01' ) : ?>
				<!-- Start Video Design One Area -->
		        <section class="ea-video-area pb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['video_section_title']); ?></h2>
		                    <p><?php echo esc_html__($settings['video_section_desc']); ?></p>
		                </div>
		                <div class="ea-video-content style-one ea-elementor-floating" style="background-image:url(<?php echo esc_url( $settings['video_bg_img']['url'] ); ?>);">
		                    <a href="<?php echo esc_attr($ea_video_link); ?>" class="ea-video-btn-one popup-video">
		                    	<?php if( $settings['icon_type'] == 'general' ) : ?>
                            	    <i class="<?php echo wp_kses_post( $settings['video_icon1'] ); ?>"></i>
                            	<?php else: 
                            		endad_render_icon( $settings, 'icon', 'video_icon2' ); 
                            	endif; ?>
		                    </a>
		                    <<?php echo esc_attr($settings['ea_title_tag']); ?> class="ea-title"><?php echo esc_html($settings['video_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
		                </div>
		            </div>
		        </section>
		        <!-- End Video Design One Area -->
		        <?php if($settings['enable_parallax'] == 'yes' ){ ?>
			    	<style>
			    		.ea-video-content.style-one {
			    			background-attachment: fixed;
			    		}
			    	</style>
			    <?php } ?>
		    <?php elseif( $settings['select_video_style'] == 'style-02' ) : ?>
		    	<!-- Start Video Design Two Area -->
		        <section class="ea-video-area pb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['video_section_title']); ?></h2>
		                    <p><?php echo esc_html__($settings['video_section_desc']); ?></p>
		                </div>
		                <div class="ea-video-bg">
		                	<div class="row align-items-center">
		                		<div class="col-lg-7">
		                			<<?php echo esc_attr($settings['ea_title_tag']); ?> class="ea-title"><?php echo esc_html($settings['video_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
		                			<p><?php echo wp_kses_post($settings['video_desc']); ?></p>
		                		</div>
		                		<div class="col-lg-5">
		                			<div class="ea-video-content bg-2 ea-elementor-floating">
		                				<?php if( ! $settings['video_bg_img']['url'] == '' ) : ?>
		                                    <img src="<?php echo esc_url( $settings['video_bg_img']['url'] ); ?>" alt="image">
	                                    <?php endif; ?>
		                				<div class="video-btn-center">
		                					<a href="<?php echo esc_attr($ea_video_link); ?>" class="ea-video-btn-one popup-video">
		                						<?php if( $settings['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $settings['video_icon1'] ); ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $settings, 'icon', 'video_icon2' ); 
				                            	endif; ?>
		                					</a>
		                				</div>
		                			</div>
		                		</div>
				            </div>
			            </div>
		            </div>
		        </section>
		        <!-- End Video Design Two Area -->
		    <?php elseif( $settings['select_video_style'] == 'style-03' ) : ?>
		    	<!-- Start Video Design Three Area -->
		        <section class="ea-video-area">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['video_section_title']); ?></h2>
		                    <p><?php echo esc_html__($settings['video_section_desc']); ?></p>
		                </div>
		            </div>
		            <div class="ea-video-area-style-three ea-elementor-floating" style="background-image:url(<?php echo esc_url( $settings['video_bg_img']['url'] ); ?>);">
		            	<div class="container">
			                <div class="ea-video-bg">
			                	<div class="row align-items-center">
			                		<div class="col-lg-7">
			                			<<?php echo esc_attr($settings['ea_title_tag']); ?> class="ea-title"><?php echo esc_html($settings['video_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
			                			<p><?php echo wp_kses_post($settings['video_desc']); ?></p>
			                		</div>
			                		<div class="col-lg-5">
			                			<div class="ea-video-content bg-2">
			                				<div class="video-btn-center">
			                					<a href="<?php echo esc_attr($ea_video_link); ?>" class="ea-video-btn-one popup-video">
			                						<?php if( $settings['icon_type'] == 'general' ) : ?>
					                            	    <i class="<?php echo wp_kses_post( $settings['video_icon1'] ); ?>"></i>
					                            	<?php else: 
					                            		endad_render_icon( $settings, 'icon', 'video_icon2' ); 
					                            	endif; ?>
			                					</a>
			                				</div>
			                			</div>
			                		</div>
					            </div>
					        </div>
			            </div>
		            </div>
		        </section>
		        <!-- End Video Design Three Area -->
		        <?php if($settings['enable_parallax'] == 'yes' ){ ?>
			    	<style>
			    		.ea-video-area-style-three {
			    			background-attachment: fixed;
			    		}
			    	</style>
			    <?php } ?>
		    <?php elseif( $settings['select_video_style'] == 'style-04' ) : ?>
		    	<!-- Start Video Design Four Area -->
		        <section class="ea-video-area ea-video-style-four ptb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['video_section_title']); ?></h2>
		                    <p><?php echo esc_html__($settings['video_section_desc']); ?></p>
		                </div>
		                <div class="ea-video-bg">
		                	<div class="row align-items-center">
		                		<div class="col-lg-6">
		                			<div class="ea-video-content bg-4 ea-elementor-floating">
		                				<?php if( ! $settings['video_bg_img']['url'] == '' ) : ?>
		                                    <img src="<?php echo esc_url( $settings['video_bg_img']['url'] ); ?>" alt="image">
	                                    <?php endif; ?>
		                				<div class="video-btn-center">
		                					<a href="<?php echo esc_attr($ea_video_link); ?>" class="ea-video-play-btn popup-video">
		                						<?php if( $settings['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $settings['video_icon1'] ); ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $settings, 'icon', 'video_icon2' ); 
				                            	endif; ?>
		                					</a>
		                				</div>
		                			</div>
		                		</div>
		                		<div class="col-lg-6">
		                			<<?php echo esc_attr($settings['ea_title_tag']); ?> class="ea-title"><?php echo esc_html($settings['video_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
		                			<p><?php echo wp_kses_post($settings['video_desc']); ?></p>
		                		</div>
				            </div>
				        </div>
		            </div>
		        </section>
		        <!-- End Video Design Four Area -->
		    <?php elseif( $settings['select_video_style'] == 'style-05' ) : ?>
		    	<!-- Start Video Design Five Area -->
		        <section class="ea-video-area ea-video-area-style-five pb-100">
		            <div class="container">
		                <div class="section-title white-title">
		                    <h2><?php echo esc_html__($settings['video_section_title']); ?></h2>
		                    <p><?php echo esc_html__($settings['video_section_desc']); ?></p>
		                </div>
            			<div class="ea-video-content bg-5 ea-elementor-floating" style="background-image:url(<?php echo esc_url( $settings['video_bg_img']['url'] ); ?>);">
        					<a href="<?php echo esc_attr($ea_video_link); ?>" class="ea-video-btn-one popup-video">
        						<?php if( $settings['icon_type'] == 'general' ) : ?>
                            	    <i class="<?php echo wp_kses_post( $settings['video_icon1'] ); ?>"></i>
                            	<?php else: 
                            		endad_render_icon( $settings, 'icon', 'video_icon2' ); 
                            	endif; ?>
        					</a>
        					<<?php echo esc_attr($settings['ea_title_tag']); ?> class="ea-title"><?php echo esc_html($settings['video_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
            			</div>
		            </div>
		        </section>
		        <!-- End Video Design Five Area -->
		        <?php if($settings['enable_parallax'] == 'yes' ){ ?>
			    	<style>
			    		.ea-video-content.bg-5 {
			    			background-attachment: fixed;
			    		}
			    	</style>
			    <?php } ?>
		    <?php elseif( $settings['select_video_style'] == 'style-06' ) : ?>
		    	<!-- Start Video Design Six Area -->
		        <section class="ea-video-area ea-video-area-style-six pb-100">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['video_section_title']); ?></h2>
		                    <p><?php echo esc_html__($settings['video_section_desc']); ?></p>
		                </div>
            			<div class="ea-video-bg">
		                	<div class="row align-items-center">
		                		<div class="col-lg-7">
		                			<<?php echo esc_attr($settings['ea_title_tag']); ?> class="ea-title"><?php echo esc_html($settings['video_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
		                			<p><?php echo wp_kses_post($settings['video_desc']); ?></p>
		                		</div>
		                		<div class="col-lg-5">
		                			<div class="ea-video-content bg-7 ea-elementor-floating" style="background-image:url(<?php echo esc_url( $settings['video_bg_img']['url'] ); ?>);">
		                				<div class="video-btn-center">
		                					<a href="<?php echo esc_attr($ea_video_link); ?>" class="ea-video-btn-one popup-video">
		                						<?php if( $settings['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $settings['video_icon1'] ); ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $settings, 'icon', 'video_icon2' ); 
				                            	endif; ?>
		                					</a>
		                				</div>
		                			</div>
		                		</div>
				            </div>
				        </div>
		            </div>
		        </section>
		        <!-- End Video Design Six Area -->
		    <?php elseif( $settings['select_video_style'] == 'style-07' ) : ?>
		    	<!-- Start Video Design Seven Area -->
		        <section class="ea-video-area ea-video-area-style-seven bg-shape">
		            <div class="container">
		                <div class="section-title">
		                    <h2><?php echo esc_html__($settings['video_section_title']); ?></h2>
		                    <p><?php echo esc_html__($settings['video_section_desc']); ?></p>
		                </div>
            			<div class="ea-video-bg">
		                	<div class="row align-items-center">
		                		<div class="col-lg-5 pr-0">
		                			<div class="ea-video-content bg-9 ea-elementor-floating" style="background-image:url(<?php echo esc_url( $settings['video_bg_img']['url'] ); ?>);">
		                				<div class="video-btn-center">
		                					<a href="<?php echo esc_attr($ea_video_link); ?>" class="ea-video-btn-one popup-video">
		                						<?php if( $settings['icon_type'] == 'general' ) : ?>
				                            	    <i class="<?php echo wp_kses_post( $settings['video_icon1'] ); ?>"></i>
				                            	<?php else: 
				                            		endad_render_icon( $settings, 'icon', 'video_icon2' ); 
				                            	endif; ?>
		                					</a>
		                				</div>
		                			</div>
		                		</div>
		                		<div class="col-lg-7 pl-0">
		                			<div class="video-content-wrap" style="background-image:url(<?php echo esc_url( $settings['video_shape_img']['url'] ); ?>);">
			                			<<?php echo esc_attr($settings['ea_title_tag']); ?> class="ea-title"><?php echo esc_html($settings['video_title']); ?></<?php echo esc_attr($settings['ea_title_tag']); ?>>
			                			<p><?php echo wp_kses_post($settings['video_desc']); ?></p>
			                		</div>
		                		</div>
				            </div>
				        </div>
		            </div>
		        </section>
		        <!-- End Video Design Seven Area -->
		    <?php endif;

        endif;

    }

}
