Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Poster attribute on Video Element #1582

Open
felipehertzer opened this issue Feb 14, 2025 · 0 comments
Open

Missing Poster attribute on Video Element #1582

felipehertzer opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@felipehertzer
Copy link
Contributor

Current Behavior:

The MediaPlayer component does not apply the poster attribute to the underlying <video> element. This prevents the poster image from being displayed when using MediaPlayer to play an audio file.

  • Adding the poster attribute to MediaPlayer does not result in the <video> element receiving it.
  • As a result, the expected poster image is not displayed.
  • If controls is set on MediaPlayer, the poster appears, but this replaces the Vidstack controls with the browser’s default controls.

Expected Behavior:

  • The poster attribute should be correctly applied to the <video> tag when set on MediaPlayer.
  • The poster image should be visible when playing an audio file.
  • Vidstack’s custom controls should remain functional.

Steps To Reproduce:

  1. Use MediaPlayer with the poster attribute.
  2. Play an audio file.
  3. Inspect the <video> element and observe that the poster attribute is missing.
<MediaPlayer
  ref={player}
  src={mp3File}
  viewType="video"
  poster={mediaThumbnail}
/>

Environment:

  • Framework: React
  • Meta Framework: Vite
  • Node: 22
  • Device: MacBook Pro M4
  • OS: macOS Sonoma
  • Browser: Chrome 133

Anything Else?

<video  aria-hidden="true" preload="metadata">
<source src="file.mp3" type="video/mp4" data-vds="">
</video>
<img class="vds-poster" style="pointer-events: none;" src="image.jpg">

Should be

<video  aria-hidden="true" preload="metadata" poster="image.jpg">
<source src="file.mp3" type="video/mp4" data-vds="">
</video>
<img class="vds-poster" style="pointer-events: none;" src="image.jpg">
@felipehertzer felipehertzer added the bug Something isn't working label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant