Skip to content
FrameworkStyle

media-seek-button

Accessible seek button for skipping forward or backward by a configurable number of seconds

Import

import '@videojs/html/ui/seek-button';

Anatomy

<media-seek-button></media-seek-button>

Behavior

Seeks media by a configurable number of seconds (default 30). Positive values seek forward, negative values seek backward. The seek is clamped to media bounds (0 to duration).

Accessibility

Renders a <button> with an automatic aria-label describing the action, e.g. “Seek forward 30 seconds” or “Seek backward 10 seconds”. Override with the label prop. Keyboard activation: Enter / Space.

Examples

Basic Usage

⏪ 5s 10s ⏩
<video-player class="video-player">
  <media-container>
    <video src="https://stream.mux.com/BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM/highest.mp4" autoplay muted playsinline loop></video>
    <div class="buttons">
      <media-seek-button seconds="-5" class="media-seek-button">
        <span class="backward">&#9194; 5s</span>
      </media-seek-button>
      <media-seek-button seconds="10" class="media-seek-button">
        <span class="forward">10s &#9193;</span>
      </media-seek-button>
    </div>
  </media-container>
</video-player>

API Reference

Props

PropTypeDefaultDetails
disabledbooleanfalse
labelobject''
secondsnumber30

State

State is reflected as data attributes for CSS styling.

PropertyTypeDetails
label{ key: string; text: string } | string
seekingboolean
direction'forward' | 'backward'

Data attributes

AttributeTypeDetails
data-seeking
data-direction'forward' | 'backward'