I am trying to make a template with some dnd areas and columns. In one of those columns I want to embed a video player which I want a default video and the chance to change it when the user selects this template.
The embed_field isn’t a text field, it supports oembed or html types.
It’s tricky to find exactly how to use this in the documentation although this page on oembed and familiarity with the embed field helps.
I forget exactly how I figured it out in past projects (I likely used ?developerMode=true in a page’s content editor and copied HTML from the section), but I’ve used the code below for the video module and it should work:
{% dnd_module path="@hubspot/video"
video_type="embed",
embed_field={
"source_type": "oembed",
"oembed_url": "https://www.youtube.com/watch?v=YisYnpF57DE",
"oembed_response": {
"provider_url": "https://www.youtube.com/",
"width": "560",
"height": "315",
"html": "<iframe width='560' height='315' src='https://www.youtube.com/embed/YisYnpF57DE?si=dCG6bwkMk-ZyVXDG' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' allowfullscreen></iframe>",
"thumbnail_width": "560",
"version": "1.0",
"title": "Disfruta de los beneficios que tus paneles pueden brindar a tu familia.",
"provider_name": "YouTube",
"type": "video",
"thumbnail_height": "315",
"author_url": "https://www.youtube.com/@energonsolarmx",
"thumbnail_url": "",
"author_name": "ENERGON SOLAR"
},
"width": 560,
"height": 315,
"size_type": "auto_full_width",
"max_width": 560,
"max_height": 315
}
%}
{% end_dnd_module %}
You can probably strip away a lot of that information too.