FrameworkStyle

media-seek-button

Accessible seek button for skipping forward or backward by a configurable 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">
    <media-container>
        <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>
    </media-container>
</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 Type
data-seeking
data-direction 'forward' | 'backward'
VideoJS