How can I replace an auto-generated poster URL with a custom image?

Topic summary

A user is attempting to replace an auto-generated poster/preview image for a video section with a custom uploaded image. The video currently uses a Shopify-hosted video with an automatically generated poster URL.

Current Issue:

  • The video is rendered using video_tag filter in a Liquid template
  • User wants to dynamically assign a custom image URL to replace the default poster
  • When attempting to implement a solution, they encountered a Liquid syntax error: “Unexpected character” on line 17

Technical Context:

  • Working within Shopify’s theme schema for a video block
  • The video section includes settings for title, video source, and poster image
  • Error appears related to the video_tag filter parameters, specifically around the poster attribute

Status:
A community expert offered to provide updated code and requested clarification on whether further assistance is needed. The discussion remains ongoing as the implementation details are being worked out.

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

I have a video section and I want to have a custom (poster/preview image) for the video. Currently the video uses a auto-generated URL


I want to upload custom image and use that to replace dynamically the poster URL above. This is the current schema.

```css
"blocks": [
      {
        "type": "video",
        "name": "Video",
        "settings": [
          {
            "type": "text",
            "id": "title",
            "label": "Title",
            "default": "Lorem ipsum dolor sit amet. Lorem ipsum"
          }, {
            "type": "video",
            "id": "video",
            "label": "A Shopify-hosted video"
          }
        ]

How do I assign the image URL to replace the poster:“???”

Hi @Paulodezine welcome to the Shopify Community,

please refer to the updated code below.


Dont forget to hit like and if its helpfull make it accepted :slightly_smiling_face: 

Thanks

Hi again,

Sorry when I checked vidoes.liquid file, the html is rendered by this code:

video]:w-full [&>video]:aspect-[9/16] [&>video]:object-fill">
                    {{ block.settings.video | video_tag: autoplay: false, loop: true, muted: false, controls: true, image_size: "600x" }}
                  

ERROR:

Liquid syntax error (line 17): Unexpected character = in “{{ block.settings.video | video_tag: autoplay: false, loop: true, muted: false, controls: true, image_size: “600x”, poster=”{{ block.settings.poster | img_url:‘master’}}"

@Paulodezine

Dont worrry i guess this is somthing that can be done very closely. Do you want my help on this?

Thanks