fix: attaching media like elements and upgrade#889
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📦 Bundle Size Report🎨 @videojs/html(no changes) Presets (7)
Media (4)
Players (3)
Skins (15)
UI Components (21)
Sizes are marginal over the root entry point. ⚛️ @videojs/react(no changes) Presets (7)
Media (3)
Skins (14)
UI Components (17)
Sizes are marginal over the root entry point. 🧩 @videojs/core(no changes) Entries (5)
🏷️ @videojs/element(no changes) Entries (2)
📦 @videojs/store(no changes) Entries (3)
🔧 @videojs/utils(no changes) Entries (10)
📦 @videojs/spf(no changes) Entries (3)
ℹ️ How to interpretAll sizes are standalone totals (minified + brotli).
Run |
There was a problem hiding this comment.
Pull request overview
Fixes media attachment for custom media elements in the HTML player container and ensures custom elements are upgraded before being attached to the player store (avoiding store-side type errors when accessing media APIs).
Changes:
- Update container media discovery to recognize custom media elements (not just
HTMLMediaElement) and upgrade them before attaching to the store. - Remove the
data-media-elementattribute marker fromCustomMediaMixinand switch container attachment logic away from that attribute. - Adjust the root
dev:sandboxscript to useturbo watch.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/html/src/store/container-mixin.ts | Detects/attaches custom media elements and upgrades them before store attachment; updates mutation observation logic. |
| packages/core/src/dom/media/custom-media-element/index.ts | Removes the data-media-element attribute from custom media element connectedCallback. |
| package.json | Updates dev:sandbox to use turbo watch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This fixes an issue where we didn't attach custom media elements to the store because they are not instances of HTMLMediaElement and fixes another issue where the custom media element was not upgraded and resulted in type errors in the store. Things like
.bufferedand.textTrackswere accessed there. We should be gating those as I'm typing this out, aka the HTMLMediaElement type is too forgiving. This should be moved to the more narrow MediaApi type. For another PR.