external_video_url
Returns the URL of a specified external video. An external video is a video hosted on a platform external to SHOPLINE.
This filter allows you to add URL parameters to control video playback behaviors. Parameter names and values must follow the specifications of the source video platform, such as YouTube's IFrame API.
media | external_video_url(attribute=any) returns a string.
Required params
media external_video: The media resource for the external video.
Optional params
-
autoplayboolean: Whether to automatically play the video.truemeans the video plays automatically, whilefalsemeans it does not. The default value isfalse. -
controlsboolean: Whether to display the video player controls.truemeans the controls are displayed, whilefalsemeans they are not. The default value istrue. -
loopboolean: Whether to loop the video.truemeans the video loops, whilefalsemeans it does not. The default value isfalse.
Example
Use this filter to parse the video URL and apply specific playback parameters, and then use external_video_tag to render a YouTube video player.
{{#for media in product.media}}
{{#switch media.media_type}}
{{#case "external_video" /}}
{{#if media.host == "youtube"}}
{{#external_video_tag media | external_video_url(autoplay=false, loop=true) /}}
{{/if}}
{{/switch}}
{{/for}}