External Video Tag
You get an <iframe> that embeds a YouTube or Vimeo video. Use it on a video_url setting, or after external_video_url to add parameters to the URL.
liquid
{{ video | external_video_url: parameter: value | external_video_tag: attribute: value }}Every option is added as an attribute of the tag, for example class or loading. title is added after src. All values are escaped.
When the setting is empty or the URL is not a YouTube or Vimeo URL, you get an empty string.
Example
liquid
{{ section.settings.video | external_video_url: autoplay: true | external_video_tag: class: 'hero-video', title: 'Our story' }}Output
html
<iframe frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="allowfullscreen" class="hero-video" src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&controls=1&enablejsapi=1&modestbranding=1&origin=https%3A%2F%2Facme.youcan.store&playsinline=1&rel=0" title="Our story"></iframe>