<?php 
    $img_size = !empty($settings['img_size']) ? $settings['img_size'] : 'full';
    $thumbnail_url = null;
    if(!empty($settings['image'])) {
        $image  = pxl_get_image_by_size( array(
            'attach_id'  => $settings['image']['id'],
            'thumb_size' => $img_size,
            'class' => 'no-lazyload'
        ) );
        $thumbnail_url    = $image['url'];
    }
    $overlay = !empty($settings['overlay']) || false;
?>

<div class="pxl-play-video pxl-play-video1">
    <div class="pxl-item--container">
        <div class="pxl-item--inner">
            <?php if(!is_null($thumbnail_url)) : ?>
                <div class="pxl-item--bg" style = "background-image: url('<?php echo esc_attr($thumbnail_url); ?>')" data-url="<?php echo esc_attr($thumbnail_url); ?>"></div>
                <?php if($overlay) : ?>
                    <div class="pxl-item--overlay"></div>
                <?php endif; ?>
                <a class="btn pxl-item--btn pxl-btn-play pxl-action-popup pxl-btn-play1"  
                href="<?php echo esc_url($settings['video_link']); ?>">
                    <?php if (!empty($settings['pxl_icon']['value'])) : ?>
                        <?php \Elementor\Icons_Manager::render_icon( $settings['pxl_icon'], [ 'aria-hidden' => 'true', 'class' => '' ], 'i' ); ?>
                    <?php else : ?>
                        <svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
                            <path d="M15 6.76795C16.3333 7.53775 16.3333 9.46225 15 10.2321L3.75 16.7272C2.41667 17.497 0.749999 16.5348 0.749999 14.9952L0.75 2.00481C0.75 0.46521 2.41667 -0.497043 3.75 0.272758L15 6.76795Z" fill="white"/>
                        </svg>
                    <?php endif; ?>
                </a>
            <?php endif; ?>
        </div>
    </div>
</div>