How can I display autoplay video only on the home page?

Hi, hoping someone can please help me. I have added an autoplay video to my website, but I only want it to be displayed on the home page. How do I remove it or hide it from all other pages. Eg; remove from product page, check out page etc. I assume I need to add a code for this? I have attached the link to my profile for reference.

https://neurodepthnd.com

Thank you.

@NeuroDepth you can add below code around where you have added the code of video

{% if template == "index" or template == "page" %}
  // Add you video code here. so it will be appear in home page only
{% endif %}

Thanks for your help Ujjaval, the video has stopped playing on the other pages, but it has left a big white gap at the top of the page. How can I fix this?

Thank you

@NeuroDepth Had you added that video section into the all pages ? by customization add section feature ? If not then i have to looking into it to resolve the gapping issue. I need store access.

Resolved now, it is now working. I put part of the code in the wrong spot. Thanks so much for your help.

Good morning, auto play is working on iPhone, but not on laptop. Do you know how I can fix this?Below is the code I am using. Thank you.

{% if template == “index” or template == “page” %}

{% endif %}>

Hello Ujjaval, Good morning, i need your help about this :

video { width: 100%; height: auto; display: block; margin: 0 auto; }

I Need to make AUTOPLAY VIDEO AND SOUNDS TOO ONLY IN HOME PAGE? So Can you Help Me ??, So this is my luiqid code: can you give me correct code:
video {
width: 100%;
height: auto;
display: block;
margin: 0 auto;
}

Thanks SO much !
Have a good day , reply to mail adresse: elfalloussihamza@gmail.com Thanks a lot bro