hwc-media-content
Installation
SKILL.md
Media & Rich Content
Implement media-centric Hotwire features with Stimulus and Turbo Frames.
Core Workflow
- Identify media mode: upload/preview, playback controls, progress persistence, or embedded library integration.
- Keep media state in Stimulus values; bridge third-party APIs through value callbacks and targets.
- Use browser-native APIs first (
URL.createObjectURL, Picture-in-Picture, IntersectionObserver, MediaSession). - Clean up all allocated resources in
disconnect()(observers, blob URLs, player instances, timers). - Persist only intentional client state (for example playback progress) and reconcile on load.
Guardrails
- Revoke blob URLs after image/file preview rendering.
- Prefer feature detection for browser APIs (PiP/Web Share/MediaSession).
- Avoid mixing transport concerns; media rendering belongs here, stream orchestration belongs in real-time skill.
- Keep frame updates incremental for time-based UI (lyrics, carousels, progress widgets).
Related skills