Im using the Refresh theme. I want my autoplay video to show on the homepage only

The code i used for the custom liquid section is below. I only want the autoplay video to appear on my homepage but when i try to hide it from a product page or a collection it hides it from every page. Please advise:

{{ section.settings.heading }}

{% if section.settings.video_url.type == 'youtube' %}
{% elsif section.settings.video_url.type == 'vimeo' %}
{% elsif section.settings.self_hosted_video %}
{{ section.settings.self_hosted_video | video_tag: controls: section.settings.controller, autoplay: section.settings.autoplay, loop: true, width: '100%' }}
{% endif %}
{% if section.settings.fullwidth %} /* Your full-height styles go here */ .video-container { position: relative; width: 100%; padding-bottom: 56.25%; /* Adjust this value as needed for the aspect ratio */ height: 0; overflow: hidden; } .video-container iframe, .video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } {% endif %} {% schema %} { "name": "Video WebSensePro", "settings": [ { "type": "text", "id": "heading", "label": "Video section heading", "default": "Video Autoplay" }, { "type": "checkbox", "id": "fullwidth", "label": "Make Full Width" }, { "type": "checkbox", "id": "autoplay", "label": "Autoplay video", "default": false }, { "type": "checkbox", "id": "controller", "label": "Enable Controls", "default": false }, { "type": "video", "id": "self_hosted_video", "label":"Select Video" } ], "presets": [ { "name": "Video WebSensePro" } ] } {% endschema %}