Skip to content

docs: architecture docs v2#55

Merged
cjpillsbury merged 4 commits intomainfrom
docs/architecture-docs-v2
Oct 13, 2025
Merged

docs: architecture docs v2#55
cjpillsbury merged 4 commits intomainfrom
docs/architecture-docs-v2

Conversation

@cjpillsbury
Copy link
Copy Markdown
Collaborator

No description provided.

cjpillsbury and others added 2 commits October 13, 2025 07:17
Replace promotional language with neutral, factual descriptions:

**Section introductions (5 changes):**
- "draws significant inspiration... pioneered" → "uses patterns from"
- "heavily rooted... pioneering" → "uses patterns from"
- "heavily inspired by" → "follows patterns from"
- "draws its most significant inspiration" → "follows/uses"

**Subsection headers (6 changes):**
- "Innovation" → "Pattern" (Media Elements, Media Chrome)
- "Innovation" → "Approach" (VJS-10, VidStack)
- "Contribution" → "Pattern" (Media Chrome)
- "Key Innovation" → "Key Difference"

**Other changes:**
- "Pioneered" → "Introduced" (line 412)
- "significant architectural evolution" → "is a media player component library"

Result: Technical documentation with neutral, factual tone throughout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Correct inaccurate claims about media-elements extending HTMLVideoElement/
HTMLAudioElement. The actual implementation extends HTMLElement and wraps
native media elements in shadow DOM due to Safari's Web Components limitation.

**Corrections made:**

1. **Core Architecture Pattern** (lines 38-48):
   - Changed from `extends HTMLVideoElement` to `extends HTMLElement`
   - Added comment explaining Safari limitation
   - Clarified `nativeEl` is wrapped in shadow DOM

2. **Key Architectural Assumptions** (lines 65-71):
   - Changed "Media state owner must be an HTMLElement" to
     "Must extend HTMLElement (Safari limitation)"
   - Added "Wraps native <video> or <audio> element in shadow DOM"
   - Added "Proxies HTMLMediaElement properties/methods to wrapped native element"

3. **Interface Abstraction** (lines 214-219):
   - Changed from "Must extend HTMLVideoElement or HTMLAudioElement"
   - Added Safari limitation explanation
   - Added shadow DOM wrapping detail

4. **Contract Comparison Table** (lines 229-235):
   - Base Class: "HTMLVideoElement required" → "HTMLElement with wrapped native video"
   - HTMLMediaElement Contract: "Full native implementation" → "Proxied to wrapped native element"
   - Extension Method: "Class inheritance" → "Class inheritance from HTMLElement"

**Why this matters**: Safari doesn't support extending built-in elements in Web
Components, so media-elements uses a wrapper pattern instead. The previous
documentation incorrectly suggested direct inheritance from HTMLVideoElement.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Oct 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
vjs-10-demo-html Ready Ready Preview Comment Oct 13, 2025 3:47pm
vjs-10-demo-react Ready Ready Preview Comment Oct 13, 2025 3:47pm
vjs-10-website Ready Ready Preview Comment Oct 13, 2025 3:47pm

…tion

Restructure documentation to clearly separate two related but distinct concepts:
1. MediaStateOwner - The interface custom elements implement (Media Elements)
2. State Mediators - The transformation layer between store and media element (Media Chrome)

**Media Elements Section Changes:**

Subsection 5 renamed: "MediaStateOwner Contract and State Management"
- Added opening explanation of two-concept relationship
- Clarified MediaStateOwner as HTMLMediaElement-like interface
- Updated Media Elements Pattern: custom elements IMPLEMENT MediaStateOwner
- Updated VJS-10 Pattern: state mediators READ/WRITE MediaStateOwner interface
- Added key characteristics for both patterns

**Media Chrome Section Changes:**

New subsection 4: "State Mediator Architecture and MediaStateOwner"
- Added architectural layer diagram showing relationship:
  UI → Store → State Mediators → MediaStateOwner
- Explained what state mediators encapsulate (get/set, events, side effects, validation)
- Showed how state mediators interact with MediaStateOwner interface
- Called out DOM-dependent complexities (fullscreen, PiP, remote playback)
- Documented VJS-10's pragmatic approach: optional `element` property for DOM access
- Explained platform-specific handling (HTML, React, React Native)

Renumbered subsequent Media Chrome subsections (5-7).

**Why This Matters:**

Previously, the section conflated custom elements AS state mediators with the
actual state mediator pattern from Media Chrome. Now it's clear that:
- Custom elements implement the MediaStateOwner CONTRACT
- State mediators are a separate LAYER that works with that contract

This clarifies why relaxing HTMLElement requirements matters across the entire
architecture, and acknowledges practical limitations (some APIs need DOM access).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel vercel bot temporarily deployed to Preview – vjs-10-demo-react October 13, 2025 14:44 Inactive
@vercel vercel bot temporarily deployed to Preview – vjs-10-website October 13, 2025 14:44 Inactive
@vercel vercel bot temporarily deployed to Preview – vjs-10-demo-html October 13, 2025 14:44 Inactive
…undancy

- Tighten section 1 (Extended HTMLMediaElement Contract) with reference to Media Elements
- Merge sections 2 + 4 into comprehensive State Mediator Pattern section
- Remove section 3 and fold examples into merged state mediator section
- Rename section 4 to "Event-Driven State Updates and Action Dispatch" with terminology note
  explaining media events vs action dispatches (XState vs Redux semantics)
- Rename section 5 to "Web Component Foundation (vs. Common Core)" to emphasize
  architectural contrast with VidStack
- Remove incorrect MEDIA_CHROME_MIGRATION.md reference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel vercel bot temporarily deployed to Preview – vjs-10-website October 13, 2025 15:46 Inactive
@vercel vercel bot temporarily deployed to Preview – vjs-10-demo-react October 13, 2025 15:46 Inactive
@vercel vercel bot temporarily deployed to Preview – vjs-10-demo-html October 13, 2025 15:47 Inactive
@cjpillsbury cjpillsbury marked this pull request as ready for review October 13, 2025 16:09
@cjpillsbury cjpillsbury merged commit 7847850 into main Oct 13, 2025
4 checks passed
@mihar-22 mihar-22 deleted the docs/architecture-docs-v2 branch November 24, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant