external_video_tag
Generates a player for the specified external video in an <iframe> tag.
Currently only YouTube video links are supported.
{{#external_video_tag videoUrl attribute=any /}}
Params
-
videoUrlstring: External video URL
Example
Basic example
The generation of the video player needs to be used in conjunction with external_video_url.
{{#external_video_tag media | external_video_url() /}}
{{#for media in product.media}}
{{#switch media.media_type}}
{{#case "external_video" /}}
{{#if media.host == "youtube"}}
{{#external_video_tag media | external_video_url(autoplay=true, loop=false) /}}
{{/if}}
{{/switch}}
{{/for}}
Adding HTML attributes
You can add standard-compliant HTML iframe attributes to the <iframe> tag, such as: class, frameborder, etc.
{{#external_video_tag media | external_video_url() attribute=any /}}
{{#for media in product.media}}
{{#switch media.media_type}}
{{#case "external_video" /}}
{{#if media.host == "youtube"}}
{{#external_video_tag media | external_video_url(autoplay=true, loop=false) class="video-media-youtube" frameborder="0" /}}
{{/if}}
{{/switch}}
{{/for}}
Was this article helpful to you?