In Shopify liquid, I am trying to render a video block from a section.
I have my own wrapped, so I simply want to get a raw URL; but nothing seems to work.
This won’t return a proper url:
<video class="video" loop muted autoplay playsinline>
<source src="{{ block.settings.video | file_url }}" type="video/mp4">
</video>
And this will create a whole video HTML element, that I don’t want:
{{ block.settings.video | media_tag }}
Here is the schema for this field:
{
"name": "Video",
"type": "video",
"settings": [
{
"type": "video",
"id": "video",
"label": "Video"
}
]
}
Does someone know how can I get an url only?
Thanks,
2
Answers
Okay, here you can see the
video
input type into Shopify documentation LinkYou can see it returns the video object or null if no video is selected.
In video object the following data is associated:
Here into video sources
You can see the URL params to return the URL, so you need to get this URL like, sources return array of URL type so access specific URL like this
Also you can create a section with video picker