Handle videos

For modules

You need to add .player to show the video. It will write the whole iframe

Example inside a loop:

#$loop|{room}|{a}| $#
    {a.name}

    If you want to test if you have videos:
    {if=" '{a.has_video}' == '1' "}I have videos!{/if}

    #$loop|{a.videos}|{video}| $#
        {video.player}
    #$/loop|{a.videos}|{video}| $#

    To show only the first video {a.first_video.player}
#$/loop|{room}|{a}| $#

Check if video is TVS or not from template code

To check if a video is TVS, we can use:

#$loop|{room}|{a}| $#
    {a.first_video.is_tvs}
#$/loop|{room}|{a}| $#

For CMS

Do a variable of type "video". It will write the whole iframe.

#$variable|video$# <!-- will write the iframe, use variable of type "Video" -->

Lazyloading

To have the video lazy loaded, this is possible by adding the .lazy modifier :

#$variable|video.lazy$#

This will write the iframe the same way, except the src="URL" will be replaced by data-src="URL". Then you can use the JS of your choice to lazyload.

Check if video is TVS or not from template code

To check if a video is TVS, we can use:

#$variable|video.is_tvs$#

Last updated