---
title: "external_video_tag"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/sline/tag/external-video-tag'
  md: 'https://developer.shopline.com/docs/sline/tag/external-video-tag.md'
---

# external_video_tag


    Generates a player for a specified external video in an `<iframe>` tag. An external video is a video hosted on a platform external to SHOPLINE.

    Only YouTube video URLs are supported.



```sline
{{#external_video_tag videoUrl attribute=any /}}
```





    
        ## Required params

        
             `videoUrl` `string`\: The URL of the external video.
        
    



    
## Optional params

        
             `attribute` `any`\: The `attribute=any` in the syntax represents a placeholder. You can pass any native HTML attributes (such as `class="my-video"`, `id="player"`, or `style="..."`), which are applied directly to the generated `<iframe>` tag.
        
    



    
## Examples

        
            ### Rendering a video player

            Use this tag together with the [external_video_url](https://developer.shopline.com/docs/sline/filter/external-video-url.md) filter to render a YouTube video player.

            
```sline
{{#external_video_tag media | external_video_url() /}}
```
            

            
<SlineExample path={'/products/earring-ab001'} objects={ 
    ["product"] 
}>
```sline
{{#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}}
```
</SlineExample>
            
        
            ### Adding HTML attributes

            Pass in standard [HTML iframe attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#attributes), such as `class` and `frameborder`.

            
```sline
{{#external_video_tag media | external_video_url() attribute=any /}}
```
            

            
<SlineExample path={'/products/earring-ab001'} objects={ 
    ["product"] 
}>
```sline
{{#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}}
```
</SlineExample>
            
        
    
