Skip to content

fix #1582: Missing Poster attribute on Video Element#1684

Open
rjmoggach wants to merge 1 commit into
vidstack:mainfrom
rjmoggach:main
Open

fix #1582: Missing Poster attribute on Video Element#1684
rjmoggach wants to merge 1 commit into
vidstack:mainfrom
rjmoggach:main

Conversation

@rjmoggach

Copy link
Copy Markdown

Description:

Fix poster attribute only being set when nativeControls is enabled.
The poster was incorrectly conditional on nativeControls in both the
core provider element and React provider, causing poster images to
not display when using custom video controls.

Changes:

  • Remove nativeControls condition from poster attribute in provider-element.ts
  • Remove nativeControls condition from poster attribute in React provider.tsx

Fixes poster display for video players using custom controls instead
of native browser controls.

Summary of Changes Made:

Fixed Files:

  1. /packages/vidstack/src/elements/define/provider-element.ts - Line 121 (but this wasn't the actual issue for React apps)
  2. /packages/react/src/components/provider.tsx - Line 171 (this was the real fix for react)

Ready?

Tried it with buck bunny and seems to work.

  Fix poster attribute only being set when nativeControls is enabled.
  The poster was incorrectly conditional on nativeControls in both the
  core provider element and React provider, causing poster images to
  not display when using custom video controls.

  Changes:
  - Remove nativeControls condition from poster attribute in provider-element.ts
  - Remove nativeControls condition from poster attribute in React provider.tsx

  Fixes poster display for video players using custom controls instead
  of native browser controls.

  Summary of Changes Made:

  Fixed Files:
  1. /packages/vidstack/src/elements/define/provider-element.ts - Line 121 (but this wasn't the actual issue for
  React apps)
  2. /packages/react/src/components/provider.tsx - Line 171 (this was the real fix)
@felipehertzer

felipehertzer commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Hey @mihar-22 could you please review this? Thank you.

@mihar-22

Copy link
Copy Markdown
Member

We have the <Poster> component if you're not using native playback, is there any reason that isn't working for you?

@felipehertzer

Copy link
Copy Markdown
Contributor

We have the <Poster> component if you're not using native playback, is there any reason that isn't working for you?

Before play:
image

After play:
image

We are using already, but in our audio-only case it only helps before playback starts. Once the audio is playing, the poster layer disappears, so the player becomes visually blank.
When the same image is passed through as the native poster attribute on the underlying

Right now I'm using a workaround with upper-case Poster, but I would like to remove the ts expect error.

<MediaProvider
      mediaProps={{
                    // @ts-expect-error - vidstack MediaProvider does not type the Poster prop in mediaProps
                    Poster: thumbnail,
            }
      }
  >
      <Poster className="vds-poster" src={thumbnail} />
      <Track
          src={caption}
          kind="subtitles"
          label={t('stream.player.subtitleEnglish')}
          lang="en-US"
          default
      />
  </MediaProvider>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants