Video Poster PNG URL in Themes/Plugins

Hello! I’m tweaking this OpenGraph plugin by ThatGuyGriff to be friendly with Mastodon and the Ivory client (see DrDrang’s post).

Is there a way to have the Hugo template Params function to grab a video’s poster.png URL? I posted my first video and the Poster is poster.png but a second video I posted has a different filename (as you’d hope!).

I’d love to have OG show the video’s poster PNG if the client doesn’t care about the video. Otherwise there’s nothing to entice somebody to click into my permalink.

I don’t think there’s a way to get the poster frame right now. For photos and audio, we have a separate param like “photos_with_metadata” that has more information. We should add a “videos_with_metadata” too that includes the size and poster URL.

1 Like

Copy! I’m just happy I didn’t miss something when I hunted around for a solution today. It was my first foray into Hugo templates so I wasn’t exactly at my best. Thank you for the prompt reply.