<?php if(!empty($settings['link']['url']) ){ ?>
<a href="<?= $settings['link']['url'] ?>">
<?php } ?>
<div class="webien-video-wrapper <?= $settings['controls'] === 'yes' ? 'has-controls':'' ?> <?= $settings['pause_leave'] === 'yes' ? 'pause-leave':'' ?> <?= $settings['reset_leave'] === 'yes' ? 'reset-leave':'' ?>"
     data-trigger="<?= $settings['trigger'] ?>"
     data-offset="<?= isset($settings['scroll_offset']['size']) ? $settings['scroll_offset']['size'] : '' ?>"
    <?= $settings['controls'] !== 'yes' ? 'style="background-image:url(' . $img . ');aspect-ratio:' . $aspect_ratio . '"':''; ?>
>

    <video
        controlsList="nodownload noplaybackrate"
        <?= $settings['controls'] === 'yes' && $img ? ' poster="'.$img.'"':'' ?>
        <?= $settings['controls'] === 'yes' ? ' controls':' playsinline muted' ?>
        <?= $settings['loop'] === 'yes' ? ' loop':'' ?>
        <source src="<?= $video ?>">
    </video>
</div>
<?php if(isset($settings['link']['url']) ){ ?>
</a>
<?php } ?>