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

<mth-audio-recorder>

@methane-ui/rtc~6.8 KB brotli shell + lazy engine~1.4 KB shell · lazy engine chunk

Accessible MediaRecorder audio capture control with pause/resume, live input level meter, and duration limit.

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-audio-recorder> (@methane-ui/rtc)
Ready · interact with <mth-audio-recorder>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/rtc/audio-recorder"></script>
<mth-audio-recorder mime-type="audio/webm" max-duration="0"></mth-audio-recorder>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
mimeTypemime-typestring"audio/webm"Preferred audio recording MIME type.
maxDurationmax-durationnumber0Maximum recording duration in seconds (0 for unlimited).
disableddisabledbooleanfalseDisables recorder controls.
labellabelstring""Accessible region label.

Events

EventDetail TypeDescription
mth-state-change{ state: unknown }Fired when recorder state transitions.
mth-record-complete{ blob: Blob | null; url: string; durationMs: number; mimeType: string }Fired when recording stops with blob/URL/duration payload.
mth-level{ level: number }Fired when input level updates.
mth-error{ message: string }Fired on microphone or recorder errors.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
EnterbothFocus is on Record, Pause, Resume, or Stop buttonTransitions recorder state and emits mth-state-change

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 1 APG keyboard transitions across LTR/RTL.mth-audio-recorder.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(recording), :state(paused), :state(stopped), :state(unsupported).Conformance suite
i18nRoutes 16 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test