FrameworkStyle

media-seek-button

A button component for seeking media playback forward or backward by a specified number of seconds

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="html-seek-button-basic">
    <video
        src="https://stream.mux.com/lhnU49l1VGi3zrTAZhDm9LUUxSjpaPW9BL4jY25Kwo4/highest.mp4"
        autoplay
        muted
        playsinline
        loop
    ></video>
    <div class="html-seek-button-basic__buttons">
        <media-seek-button seconds="-5" class="html-seek-button-basic__button">
            <span class="show-when-backward">&#9194; 5s</span>
        </media-seek-button>
        <media-seek-button seconds="10" class="html-seek-button-basic__button">
            <span class="show-when-forward">10s &#9193;</span>
        </media-seek-button>
    </div>
</video-player>

API Reference

Props

Prop Type Default
disabled boolean false
label string | function ''
seconds number 30

State

State is reflected as data attributes for CSS styling.

Property Type
seeking boolean
direction 'forward' | 'backward'

Data attributes

Attribute Description
data-seeking Present when a seek is in progress.
data-direction Indicates the seek direction: "forward" or "backward".
VideoJS