Why isn't my image displaying when adding a condition in code?

I have used the code below to show an image when the video url text box is empty but the image doesn’t show up? Anyone able to advise on how I can solve this?

{% if section.settings.video_url2 %}
<video
style=“width: 100%; height: auto;”
autoplay=“autoplay”
loop=“loop”
muted=“”
webkit-playsinline=“”
playsinline=“”

{% elsif sections.settings.videourl2 != blank %} {{ section.settings.image2 | image_url: width: '360, 535, 750, 1070, 1500' | image_tag: loading: 'lazy', sizes: sizes, widths: widths }} {% endif %}

Hello @Orlando22 ,

Use this

{% if section.settings.video_url2 %}

{% else %}
{{
section.settings.image2
| image_url: width: '360, 535, 750, 1070, 1500'
| image_tag: loading: 'lazy', sizes: sizes, widths: widths
}}
{% endif %}

This didn’t quite work but it did if I changed to it so that if there is an image then the image will show, but if it’s blank then the video will show.

Weird that it didn’t work the other way round but this will do, thanks so much for your help