用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mikailustuner/OmniRule --skill video-audio-patterns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | video-audio-patterns |
| description | Media handling, streaming protocols, transcoding, formats, and WebRTC patterns for web applications. |
| triggers | {"keywords":["video","audio","media","WebRTC","HLS","DASH","streaming","transcoding","MediaRecorder"]} |
| auto_load_when | Implementing video or audio features |
| agent | frontend-ops |
| tools | ["Read","Write","Bash"] |
Which protocol to use?
├── Progressive Download (MP4/HLS)
│ └── Good for: VOD, short clips, simple setup
│ └── Bad for: Live, low latency needs
│
├── HLS (HTTP Live Streaming)
│ └── Good for: Adaptive bitrate, VOD, live
│ └── Bad for: <3s latency required
│
├── DASH (Dynamic Adaptive Streaming)
│ └── Good for: Multi-codec support, complex DRMs
│ └── Bad for: Simpler HLS suffices
│
└── WebRTC
└── Good for: <500ms latency, real-time互动
└── Bad for: Simple VOD, CDN caching needed
Video codecs:
├── H.264: Max compatibility, larger files
├── H.265/HEVC: Better compression, licensing
├── VP8/VP9: royalty-free, varying browser support
└── AV1: Best compression, limited support
Audio codecs:
├── AAC: Good compatibility, reasonable quality
├── Opus: Best quality/size, wide support
└── MP3: Legacy support only
Container formats:
├── MP4: Web + mobile, H.264/AAC
├── WebM: VP8/VP9 + Vorbis/Opus
└── MKV: Archive quality, not web-native
Transcode when:
├── Input format not supported by target browsers
├── File size too large for bandwidth
├── Need different resolution/quality tiers
├── DRM conversion required
└── Codec not hardware-accelerated
Don't transcode when:
├── Original already optimized
├── Just-in-time transcoding adds latency
├── Storage costs outweigh streaming benefits
└── One format covers 95%+ of users
Need WebRTC when:
├── Real-time video/audio (calls, streams)
├── Sub-500ms latency required
├── Peer-to-peer communication needed
├── Low bandwidth adaptation critical
└── Server costs must stay low
Use media servers (SFU/MCU) when:
├── Many-to-many participants (>4)
├── Recording/archive required
├── Complex routing needed
└── Cross-region scaling
Player choice:
├── Native <video>: Simple, no features, good perf
├── Video.js: Features, plugins, HLS/DASH
├── Plyr: Lightweight, accessible, good UX
├── Shaka Player: DASH, offline, complex
└── Bitmovin/mux: Enterprise, analytics
Video accessibility:
├── Captions: WebVTT for web, sidecar or embedded
├── Audio descriptions: Separate track
├── Sign language: Separate video track
└── Keyboard controls: Always enabled
Audio accessibility:
├── Transcripts: Full text alternative
├── Visual indicators: Visual cues for audio events
└── Volume control: Per-track if mixed
Where to store:
├── Origin: Master files, archives
├── CDN: Transcoded versions, closest edge
└── Object storage: S3/GCS for scalability
CDN considerations:
├── Signed URLs for private content
├── Token authentication for live
└── Geo-blocking when needed
❌ Autoplay video with sound by default
✅ Autoplay muted only; require user gesture for audio
❌ No preload strategy — loading everything upfront
✅ preload="metadata" for above-fold, preload="none" for offscreen
❌ Single video format (only .mp4)
✅ Serve WebM + MP4 with <source> fallbacks
❌ Blocking main thread with video decode work
✅ Use dedicated codec, offload to GPU
❌ No poster image — blank area before playback
✅ Always set poster attribute for perceived performance
| Scenario | Attribute / API | Note |
|---|---|---|
| Background video | autoplay muted loop | No sound |
| Lazy load video | IntersectionObserver + src swap | Save bandwidth |
| Custom controls | HTMLMediaElement API | play(), pause(), currentTime |
| Adaptive bitrate | HLS.js / dash.js | For long videos |
| Captions | Accessibility requirement | |
| Format priority | WebM → MP4 → fallback | Bandwidth savings |