{%- liquid
	assign shopify_cdn_url = settings.AVOShopifyCdnUrl | strip
	assign avo_cdn_url = settings.AVON7CdnUrl | strip
	
	assign sources_markup = ''
	if src.sources != blank
		for source in src.sources
			if source.mime_type == 'video/mp4'
				assign final_url = source.url | replace: shopify_cdn_url, avo_cdn_url | strip
				assign sources_markup = sources_markup | append: '<source src="' | append: final_url | append: '" type="video/mp4">'
			endif
		endfor
	endif
-%}

<video
	{% if playsinline %}playsinline{% endif %}
	{% if autoplay %}autoplay{% endif %}
	{% if loop %}loop{% endif %}
	{% if muted %}muted{% endif %}
	{% if controls %}controls{% endif %}
	{% if preload %}preload="{{ preload }}"{% endif %}
	{% if class %}class="{{ class }}"{% endif %}
	{% if testId %}data-testid="{{ testId }}"{% endif %}
	{% if poster != blank %}poster="{{ poster }}"{% endif %}
>
	{{ sources_markup }}
</video>