autopreview

npm: @playerstack/plugin-autopreview

Plays muted when the player scrolls into view, pauses when it scrolls out. Great for blog posts and landing pages where you want video to feel alive without forcing the user to click.

Quickstart

<player-stack
  src="https://example.com/preview.mp4"
  data-config='{"preview":{"enabled":true,"threshold":0.6}}'
>
</player-stack>

Config

config.preview:

FieldTypeDefaultDescription
enabledbooleanfalsePlugin is a no-op unless true
thresholdnumber [0..1]0.5How much of the player must be in view before play triggers
loopUntilInteractionboolean(reserved)Reserved; current build always loops while in view

Accessibility

If the user has prefers-reduced-motion: reduce, the plugin does nothing — no IntersectionObserver is created at all. This respects users who get nauseated by motion.

Events

None.

Tips