How to extract the content URL from a Video File object.
SOLVE
Hi @DOctober - as far as I can tell there's no way to extract the video file's URL from the Video field, probably because of the HubSpot Video functionalities.
However, when I'm doing something custom with videos, I usually use the File field instead (it has a "Video" option), which outputs the video URL you can use for your schema.
How to extract the content URL from a Video File object.
SOLVE
I was having this issue trying to set a background video in a custom Hero module on a dynamic page template.
In the database I set a video background column with the property of VIDEO.
This gives a file ID number but like above I could not get the File URL from this ID. After some investigating and paying attention to various IDs and File IDs I found that the database ID I was getting was +1 from the video file ID. So I thought this may be workable. My code below allowed me to access the File ID URL from the database ID. I have tested it on 3 different videos and so far it works. Now I just have to get the custom thumbnail for the poster!
{% if dynamic_page_hubdb_row && dynamic_page_hubdb_row.hero_background_choice['name'] == 'Video' %} {% set videoID = dynamic_page_hubdb_row.hero_background_video %} {% set videoID = videoID|int - 1 %} {% set file = file_by_id( videoID ) %} {% set backgroundOptions = '{"loop": {{ module.background.loop }}, "source":{"mp4":" {{ file.url }}" ...etc..hero video stuff...etc.. {% endif %}
Jun 2, 202311:11 AM - edited Jun 2, 202311:11 AM
Participant
How to extract the content URL from a Video File object.
SOLVE
For those that see this, it's possible that it would be accurate, but that would just be a coincidence. It looks like the video player gets allocated an auto-sequenced ID after the file. These IDs are global, so if another file is uploaded at the same time then I think you'd lose the association.
How to extract the content URL from a Video File object.
SOLVE
Hi @DOctober - as far as I can tell there's no way to extract the video file's URL from the Video field, probably because of the HubSpot Video functionalities.
However, when I'm doing something custom with videos, I usually use the File field instead (it has a "Video" option), which outputs the video URL you can use for your schema.