Skip to content
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="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

Prop Type Default Details
disabled boolean false
label 'play' | 'pause' | 'replay' | 'mute' | 'unmute' | 'seekForward' | 'seekBackward' | 'enterFullscreen' | 'exitFullscreen' | 'enableCaptions' | 'disableCaptions' | 'enterPictureInPicture' | 'exitPictureInPicture' | 'playingLive' | 'seekToLiveEdge' | 'liveBadge' | 'startCasting' | 'stopCasting' | 'connectingCast' | 'seek' | 'volume' | 'timeCurrent' | 'timeDuration' | 'timeRemaining' | 'timeRemainingPhrase' | 'playbackRateAria' | 'timeSliderValueTextRange' | 'volumeSliderValueTextMuted' | 'indicatorMuted' | 'indicatorVolume' | 'indicatorVolumeWithValue' | 'indicatorCaptionsOn' | 'indicatorCaptionsOff' | 'indicatorPaused' | 'indicatorPlaying' | 'indicatorFullscreen' | 'indicatorExitFullscreen' | 'indicatorPictureInPicture' | 'indicatorExitPictureInPicture' | 'mediaErrorAborted' | 'mediaErrorNetwork' | 'mediaErrorDecode' | 'mediaErrorSrcNotSupported' | 'mediaErrorEncrypted' | 'mediaErrorCustom' | 'errorDialogTitle' | 'errorDialogDismiss' | 'mediaErrorFallback' | string & object | function ''
seconds number 30

State

State is reflected as data attributes for CSS styling.

Property Type Details
seeking boolean
direction 'forward' | 'backward'
label 'play' | 'pause' | 'replay' | 'mute' ...

Data attributes

Attribute Type Details
data-seeking
data-direction 'forward' | 'backward'