{% macro videoComponent(data) %} {% set args = { "source" : "local", "video" : "", "youtube" : "", "hubpsot" : {}, "image" : "", "class" : '' } %} {% do args.update(data) %}
{% if args.source != 'hubspot' %} {% else %} {% if args.hubspot.player_id %} {% video_player "embed_player" overrideable=False, type='{{ args.hubspot.player_type || "hsvideo2" }}', embed_button=True, width='{{ args.hubspot.size_type == "auto_full_width" ? "Auto" : args.hubspot.width }}', height='{{ args.hubspot.size_type == "auto_full_width" ? "Auto" : args.hubspot.height }}', player_id='{{ args.hubspot.player_id }}', conversion_asset=(args.hubspot.conversion_asset || {}) %} {% endif %} {% endif %}
{% endmacro %} {% macro videosComponent(data = {}) -%} {% set args = { "videos" : [], "layout" : {}, "class" : "" } %} {% do args.update(data) %} {% set videos = args.videos|rejectattr('visible',false) %} {% set useSlider = !!(videos|length > 1) %} {% if !!videos|length %} {% if useSlider %} {% else %} {{ videoComponent(videos|first) }} {% endif %} {% endif %} {% endmacro %}