Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-video-player>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

Accessible custom-chrome video player with safe-URL validation, keyboard shortcuts, timeline seek, volume, speed control, and fullscreen toggle.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-video-player> (@methane-ui/ui)
Ready · interact with <mth-video-player>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/video-player"></script>
<mth-video-player playsinline preload="metadata">Example</mth-video-player>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
srcsrcstring""Video media URL validated against safe protocols.
posterposterstring""Optional poster image URL validated against safe protocols.
labellabelstring""Accessible region label for the player.
autoplayautoplaybooleanfalseRequests automatic playback on load.
looploopbooleanfalseRestarts playback from the beginning when ended.
mutedmutedbooleanfalseStarts or keeps audio output muted.
playsinlineplaysinlinebooleantrueRequests inline playback on mobile browsers.
preloadpreload'metadata' | 'auto' | 'none'"metadata"Native media preload hint.
playbackRateplayback-ratenumber1Active playback speed multiplier.

Events

EventDetail TypeDescription
mth-playundefinedFired when video playback starts.
mth-pauseundefinedFired when video playback pauses.
mth-timeupdate{ currentTime: number; duration: number }Fired when playback time advances or seeks.
mth-endedundefinedFired when video playback reaches the end.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
Space / kbothplayer container focusedtoggles play and pause
mbothplayer container focusedtoggles muted state
ArrowLeft / ArrowRightbothtimeline slider focusedseeks backward or forward

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 3 APG keyboard transitions across LTR/RTL.mth-video-player.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(playing), :state(paused), :state(muted).Conformance suite
i18nRoutes 10 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test