Skip to content
This repository was archived by the owner on Oct 21, 2026. It is now read-only.

feat(media): add resolveAdapterType and resolveMimeType - #3024

Merged
mihar-22 merged 21 commits into
mainfrom
t3code/media-source-detection
Sep 30, 2026
Merged

mihar-22 merged 21 commits into
mainfrom
t3code/media-source-detection

Conversation

@mihar-22

@mihar-22 mihar-22 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Refs videojs/video.js#9290

Summary

Adds resolveAdapterType(src, type?) and resolveMimeType(src) to @videojs/media, and re-exports both from @videojs/react and @videojs/html. resolveAdapterType tells an app which media component plays a URL, so the app can render YouTubeVideo, HlsJsVideo, Video, and so on without writing its own URL matching. The app passes the same src it already has to that component. It's the near-term answer to videojs/video.js#9290's "which media do I use for this URL?". The auto-loading media component in that issue can build on it later.

The installation flow (site picker, Markdown twins, and @videojs/cli) now resolves media with it too, so the docs and the runtime share one set of rules.

Vidstack chose providers from src automatically, so this also closes the biggest ergonomic gap in the Vidstack migration (#3021).

import { resolveMimeType, resolveAdapterType } from '@videojs/react'; // or '@videojs/html'

resolveAdapterType('https://youtu.be/_cMxraX_5RE'); // 'youtube'
resolveAdapterType('youtube/_cMxraX_5RE'); // 'youtube', and <YouTubeVideo src="youtube/_cMxraX_5RE" /> plays it
resolveAdapterType('/live/stream.m3u8'); // 'hls'
resolveAdapterType('https://example.com/manifest', 'application/dash+xml'); // 'dash'
resolveAdapterType('_cMxraX_5RE'); // null: bare ids are ambiguous across services

resolveMimeType('/live/stream.m3u8?token=abc'); // 'application/x-mpegurl'

Changes

  • resolveAdapterType returns only the adapter type. It's an AdapterType string such as 'youtube' or 'hls', or null. It doesn't rewrite the source or return a service's video or channel id, so apps never have to pass a transformed src. Adapters read ids with their own parsers.
  • Resolution by host: YouTube, Vimeo, Wistia, Mux (stream.mux.com, with or without .m3u8), Cloudflare Stream, Spotify, TikTok, and Twitch URLs, plus spotify: URIs. A service URL only matches when its parser finds a video, and a service URL nested in a query parameter isn't mistaken for the service.
  • Resolution by type: HLS and DASH manifests and video and audio files. A MIME type, when passed, takes precedence over the file extension, which covers extensionless manifests and blob: URLs. Its parameters (; codecs=…) are ignored.
  • resolveMimeType returns the MIME type a file extension implies, ignoring the query string and hash. resolveAdapterType uses it for the extension fallback.
  • Bare ids return null. An 11-character YouTube id and a 10-character Wistia id look alike.
  • The YouTube and Vimeo parsers accept youtube/<id> and vimeo/<id> shorthands. Vidstack accepted both as src. resolveAdapterType recognizes them through the same parsers, so the media plays whatever resolves. YouTube shorthands play from youtube-nocookie.com, the host Vidstack played them from.
  • player.mux.com page URLs aren't matched. Mux media plays stream URLs, and nothing rewrites the source.
  • Installation uses it, and says resolve instead of detect. resolveRendererCandidates (was detectRendererCandidates) maps the adapter type to renderers, then adds the generic stream renderers the file name resolves to, so --media hls still fits a Mux .m3u8. resolveRenderer (was detectRenderer) returns just the renderer; callers read the label with getInstallationRenderer. The module is resolve-renderer.ts, and its host and extension tables are gone. Resolution gets stricter in two places: service pages without a video (youtube.com/) and mux.com pages (they 404 as streams) no longer match a service. @videojs/installation bundles the resolver and parsers it uses from @videojs/media (a devDependency), so its main entry still imports no packages. The CLI gets them through installation's output and still needs only Node built-ins (144.8 KB → 155.8 KB).
  • Exported from @videojs/react and @videojs/html, together with the AdapterType type. Apps depend on those packages rather than @videojs/media, and pnpm won't let an app import a package it doesn't depend on directly.
  • Reference pages at API → Utils → resolveAdapterType and resolveMimeType. The resolveAdapterType page maps each adapter type to its media component for React and HTML, and covers MIME types, bare ids, and the shorthands. The API docs builder now scans packages/media/src/core/source/adapter-type.ts as a framework-neutral entry point, the same way it scans orientation-lock.ts. It has to, because framework scans skip exports owned by other packages.
  • The embed parsers move into @videojs/media (the first commit, a pure refactor): parseYouTubeSource, parseVimeoSource, parseWistiaMediaId, parseCloudflareSource, parseSpotifySource, parseTikTokSource, parseTwitchSource, and their id helpers and types. Every adapter already depends on @videojs/media, so nothing depends the wrong way. Each adapter imports the parsers back and re-exports them under the same names, so its public API doesn't change. The parser tests move with them.
Implementation details
  • Naming. An earlier revision exported detectSource, which returned { kind, src, id, type }. Review settled on a function per answer: resolveAdapterType (briefly resolveMediaType, then resolveSourceKind) for the adapter type, resolveMimeType for the MIME type, and the parse*Source parsers for service ids. detectMediaSource was ruled out earlier because MediaSource is the Media Source Extensions API.
  • hls covers every HLS adapter and dash every DASH adapter. Choosing between hls.js, SPF, and native HLS stays with the app, and later with Feature: Provide a URL-Based Video Source Detection Facade video.js#9290.
  • Installation has no Wistia renderer yet, so Wistia URLs resolve to wistia but list no installation candidates, as before. vm.tiktok.com short links, Twitch clips, and custom Mux stream domains still fall through, the last to plain hls.
  • The matching order is internal: shorthands, then hosts, then MIME type, then extension. It isn't exported as a registry, so Feature: Provide a URL-Based Video Source Detection Facade video.js#9290 can still choose its own extension point.
  • Installation bundles @videojs/media because the Netlify edge function that renders installation Markdown twins loads @videojs/installation's dist through an import map. Netlify's edge bundler resolves npm specifiers only from the root node_modules, where pnpm doesn't link workspace packages, so an external @videojs/media import failed the deploy.

Preview

For review

  • Shorthand host. Is playing youtube/<id> from the nocookie host the behavior we want? A bare id still plays from youtube.com.

Testing

  • pnpm -F @videojs/media test src/core/source: 136 tests. adapter-type.test.ts covers every adapter type, the shorthands, extensionless Mux streams and static renditions, MIME precedence, parameters, and fallback, resolveMimeType, and the null cases, including bare ids, malformed shorthands, player.mux.com pages, short links, clips, and nested URLs. The YouTube and Vimeo parser tests cover the shorthands.
  • Tests audited with the maintain-tests skill from test(packages): audit every test with the maintain-tests skill #3080: cases that replayed a stronger owner were removed, each removal was checked against a named keeper by an independent reviewer, and the MIME-parameter and whitespace tests were each seen failing under a source mutation.
  • pnpm -F @videojs/youtube-video test and pnpm -F @videojs/vimeo-video test pass, including new embed URL tests for the shorthands.
  • pnpm -F @videojs/installation test: 293 tests. Renderer resolution tests keep one case per adapter type for the mapping, use-case selection and null cases as tables, and resolveRendererCandidates coverage for Mux and Cloudflare manifests, embeds, and Wistia. Host and extension recognition is proven once, in media. pnpm -F @videojs/cli test and the skins installation registry test pass. The built CLI resolves YouTube, extensionless Mux, and .m3u8 URLs, and still rejects --media youtube for a Mux URL.
  • @netlify/edge-bundler bundles all three edge functions locally with the site's import map; before the bundling fix it failed on @videojs/media exactly as the deploy preview did.
  • pnpm -F site test scripts/api-docs-builder src/utils integrations (681 tests) passes.
  • The site's installation picker still shows the match, the "Select YouTube" suggestion after a manual pick, and the no-match message.
  • pnpm typecheck, pnpm lint, pnpm check:workspace, pnpm -F site astro check, and pnpm build:site pass. Both framework versions of both reference pages render.

🤖 Generated with Claude Code


Note

Medium Risk
Touches shared source parsing and installation auto-selection; behavior is stricter in edge cases (bare ids, service homepages), so regressions would affect picker defaults and any app switching on resolveAdapterType.

Overview
Adds resolveAdapterType and resolveMimeType to @videojs/media (re-exported from @videojs/react and @videojs/html) so apps can pick the right media component from a URL without duplicating host/extension rules. Resolution uses shared embed parsers, optional MIME type, and returns null for ambiguous bare ids; YouTube and Vimeo gain youtube/<id> and vimeo/<id> shorthands (nocookie embed for YouTube).

Embed parsing moves from individual adapters into @videojs/media/core/source; adapters import and re-export the same parse*Source APIs so public surfaces stay stable, with parser tests relocated to media.

Installation drops hostname/extension tables in favor of resolve-renderer.ts (resolveRenderer / resolveRendererCandidates built on resolveAdapterType), updates the site picker and selection validation, bundles @videojs/media for Netlify edge, and adds reference docs for the new utils.

Reviewed by Cursor Bugbot for commit c6634c7. Bugbot is set up for automated code reviews on this repo. Configure here.

The YouTube, Vimeo, Wistia, Cloudflare, Spotify, TikTok, and Twitch URL
parsers were pure string functions, but each lived beside its adapter class,
so nothing outside the adapter could use them without importing the whole
embed. They now live in @videojs/media, which every adapter already depends
on, and each adapter imports them and re-exports them under the same names.

The parser tests move with them.
Picks the kind of media that plays a source URL, so apps can choose between
media components the way Vidstack's provider did:

- YouTube, Vimeo, Wistia, Mux, Cloudflare Stream, Spotify, TikTok, and
  Twitch, matched by host;
- HLS and DASH manifests and video and audio files, matched by MIME type
  when one is passed, then by file extension.

Bare ids return null, because an 11-character YouTube id and a 10-character
Wistia id look alike. Vidstack's youtube/<id> and vimeo/<id> shorthands expand
to URLs the matching media accepts. YouTube expands to the nocookie host,
which is the host Vidstack played them from.

Refs #2160
@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
v10-sandbox Ready Ready Preview Sep 30, 2026 11:09pm UTC

Request Review

@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit c6634c7
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/6abd965086103b0009364f42
😎 Deploy Preview https://deploy-preview-3024--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vjs-registry ready!

Name Link
🔨 Latest commit c6634c7
🔍 Latest deploy log https://app.netlify.com/projects/vjs-registry/deploys/6abd9650313bcf0008ad9baf
😎 Deploy Preview https://deploy-preview-3024--vjs-registry.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
@videojs/cdn

pnpm add https://pkg.pr.new/@videojs/cdn@3024

@videojs/cli

pnpm add https://pkg.pr.new/@videojs/cli@3024

@videojs/core

pnpm add https://pkg.pr.new/@videojs/core@3024

@videojs/element

pnpm add https://pkg.pr.new/@videojs/element@3024

@videojs/html

pnpm add https://pkg.pr.new/@videojs/html@3024

@videojs/media

pnpm add https://pkg.pr.new/@videojs/media@3024

@videojs/react

pnpm add https://pkg.pr.new/@videojs/react@3024

@videojs/spf

pnpm add https://pkg.pr.new/@videojs/spf@3024

@videojs/store

pnpm add https://pkg.pr.new/@videojs/store@3024

@videojs/utils

pnpm add https://pkg.pr.new/@videojs/utils@3024

@videojs/cloudflare-video

pnpm add https://pkg.pr.new/@videojs/cloudflare-video@3024

@videojs/dash-video

pnpm add https://pkg.pr.new/@videojs/dash-video@3024

@videojs/hlsjs-video

pnpm add https://pkg.pr.new/@videojs/hlsjs-video@3024

@videojs/mux-audio

pnpm add https://pkg.pr.new/@videojs/mux-audio@3024

@videojs/mux-video

pnpm add https://pkg.pr.new/@videojs/mux-video@3024

@videojs/native-hls-video

pnpm add https://pkg.pr.new/@videojs/native-hls-video@3024

@videojs/shaka-video

pnpm add https://pkg.pr.new/@videojs/shaka-video@3024

@videojs/spotify-audio

pnpm add https://pkg.pr.new/@videojs/spotify-audio@3024

@videojs/tiktok-video

pnpm add https://pkg.pr.new/@videojs/tiktok-video@3024

@videojs/twitch-video

pnpm add https://pkg.pr.new/@videojs/twitch-video@3024

@videojs/vimeo-video

pnpm add https://pkg.pr.new/@videojs/vimeo-video@3024

@videojs/wistia-video

pnpm add https://pkg.pr.new/@videojs/wistia-video@3024

@videojs/youtube-video

pnpm add https://pkg.pr.new/@videojs/youtube-video@3024

@videojs/google-cast

pnpm add https://pkg.pr.new/@videojs/google-cast@3024

@videojs/mux-data

pnpm add https://pkg.pr.new/@videojs/mux-data@3024

commit: c6634c7

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

🎨 @videojs/html — 45 small size changes
Path Base initial PR initial Initial diff Lazy diff
/video/minimal-skin 63.25 kB 63.15 kB -100 B (-0.2%) 0 B
/video/player 9.99 kB 9.98 kB -3 B (-0.0%) 0 B
/video/skin 62.76 kB 62.66 kB -101 B (-0.2%) 0 B
/audio/player 6.21 kB 6.21 kB +1 B (+0.0%) 0 B
/background/skin 10.13 kB 10.14 kB +10 B (+0.1%) 0 B
/live-video/minimal-skin 50.67 kB 50.67 kB -3 B (-0.0%) 0 B
/live-video/player 9.35 kB 9.35 kB -3 B (-0.0%) 0 B
/live-video/skin 50.57 kB 50.59 kB +20 B (+0.0%) 0 B
/live-audio/minimal-skin 36.18 kB 36.19 kB +13 B (+0.0%) 0 B
/live-audio/player 6.22 kB 6.22 kB -1 B (-0.0%) 0 B
/live-audio/skin 36.11 kB 36.12 kB +8 B (+0.0%) 0 B
/ui/airplay-button 11.53 kB 11.53 kB +1 B (+0.0%) 0 B
/ui/audio-track-radio-group 11.64 kB 11.64 kB +3 B (+0.0%) 0 B
/ui/buffering-indicator 8.87 kB 8.87 kB +5 B (+0.1%) 0 B
/ui/captions-button 11.78 kB 11.78 kB +5 B (+0.0%) 0 B
/ui/captions-radio-group 11.71 kB 11.71 kB -1 B (-0.0%) 0 B
/ui/container 9.73 kB 9.74 kB +2 B (+0.0%) 0 B
/ui/controls 9.04 kB 9.03 kB -4 B (-0.0%) 0 B
/ui/error-dialog 12.66 kB 12.65 kB -10 B (-0.1%) 0 B
/ui/fullscreen-button 11.52 kB 11.52 kB +1 B (+0.0%) 0 B
/ui/gesture 9.82 kB 9.82 kB +1 B (+0.0%) 0 B
/ui/hotkey 10.31 kB 10.31 kB -1 B (-0.0%) 0 B
/ui/live-button 10.06 kB 10.08 kB +20 B (+0.2%) 0 B
/ui/menu 19.07 kB 19.07 kB +5 B (+0.0%) 0 B
/ui/mute-button 11.53 kB 11.53 kB +1 B (+0.0%) 0 B
/ui/pip-button 11.48 kB 11.49 kB +6 B (+0.1%) 0 B
/ui/playback-rate-radio-group 11.63 kB 11.64 kB +5 B (+0.0%) 0 B
/ui/poster 9.16 kB 9.17 kB +4 B (+0.0%) 0 B
/ui/quality-radio-group 12.22 kB 12.23 kB +4 B (+0.0%) 0 B
/ui/seek-button 11.52 kB 11.52 kB +3 B (+0.0%) 0 B
/ui/seek-indicator 12.97 kB 12.98 kB +5 B (+0.0%) 0 B
/ui/slider 11.89 kB 11.91 kB +22 B (+0.2%) 0 B
/ui/status-announcer 10.88 kB 10.88 kB -3 B (-0.0%) 0 B
/ui/time 11.32 kB 11.34 kB +15 B (+0.1%) 0 B
/ui/time-slider 13.40 kB 13.40 kB -2 B (-0.0%) 0 B
/ui/time-slider-chapter-title 9.07 kB 9.07 kB -3 B (-0.0%) 0 B
/ui/time-slider-chapters 9.90 kB 9.91 kB +11 B (+0.1%) 0 B
/ui/title 8.46 kB 8.46 kB -4 B (-0.0%) 0 B
/ui/volume-popover 15.18 kB 15.17 kB -9 B (-0.1%) 0 B
/ui/volume-slider 12.57 kB 12.57 kB -4 B (-0.0%) 0 B
/media/mux-video 3.03 kB 3.01 kB -13 B (-0.4%) —
/media/native-hls-video 7.57 kB 7.57 kB -2 B (-0.0%) —
/video (default) 64.26 kB 64.20 kB -57 B (-0.1%) 0 B
/video (minimal) 64.63 kB 64.71 kB +81 B (+0.1%) 0 B
/audio (minimal) 48.32 kB 48.26 kB -63 B (-0.1%) 0 B
Presets (7)
Entry Initial Lazy
/video (default) 64.20 kB 56.03 kB
/video (default + hls) 65.93 kB 56.03 kB
/video (minimal) 64.71 kB 56.03 kB
/video (minimal + hls) 66.39 kB 56.03 kB
/audio (default) 48.01 kB 56.03 kB
/audio (minimal) 48.26 kB 56.03 kB
/background 11.88 kB 56.03 kB
Media (18)
Entry Initial
/media/mux-video 3.01 kB
/media/mux-audio 2.68 kB
/media/background-video 1.16 kB
/media/cloudflare-video 2.90 kB
/media/dash-video 2.63 kB
/media/hls-audio 23.47 kB
/media/hls-background-video 17.43 kB
/media/hls-video 33.61 kB
/media/hlsjs-video 2.63 kB
/media/mux-background-video 17.42 kB
/media/native-hls-video 7.57 kB
/media/shaka-video 2.62 kB
/media/spotify-audio 3.02 kB
/media/tiktok-video 3.12 kB
/media/twitch-video 2.93 kB
/media/vimeo-video 2.90 kB
/media/wistia-video 607 B
/media/youtube-video 2.90 kB
Players (5)
Entry Initial Lazy
/video/player 9.98 kB 56.03 kB
/audio/player 6.21 kB 56.03 kB
/background/player 4.46 kB 56.03 kB
/live-video/player 9.35 kB 56.03 kB
/live-audio/player 6.22 kB 56.03 kB
Skins (29)
Entry Type Initial Lazy
/video/minimal-skin.css css 8.29 kB —
/video/skin.css css 8.00 kB —
/video/minimal-skin js 63.15 kB 56.03 kB
/video/minimal-skin2 js 8.27 kB —
/video/skin js 62.66 kB 56.03 kB
/video/skin2 js 7.99 kB —
/audio/minimal-skin.css css 6.07 kB —
/audio/skin.css css 5.80 kB —
/audio/minimal-skin js 46.87 kB 56.03 kB
/audio/minimal-skin2 js 6.05 kB —
/audio/skin js 46.57 kB 56.03 kB
/audio/skin2 js 5.78 kB —
/background/skin.css css 141 B —
/background/skin js 10.14 kB 56.03 kB
/background/skin2 js 159 B —
/live-video/minimal-skin.css css 6.77 kB —
/live-video/skin.css css 6.69 kB —
/live-video/minimal-skin js 50.67 kB 56.03 kB
/live-video/minimal-skin2 js 6.77 kB —
/live-video/skin js 50.59 kB 56.03 kB
/live-video/skin2 js 6.67 kB —
/live-audio/minimal-skin.css css 4.77 kB —
/live-audio/skin.css css 4.67 kB —
/live-audio/minimal-skin js 36.19 kB 56.03 kB
/live-audio/minimal-skin2 js 4.77 kB —
/live-audio/skin js 36.12 kB 56.03 kB
/live-audio/skin2 js 4.66 kB —
/global.css css 239 B —
/shadow.css css 78 B —
UI Components (62)
Entry Initial Lazy
/ui/airplay-button 11.53 kB 56.03 kB
/ui/alert-dialog 8.98 kB 56.03 kB
/ui/audio-track-radio-group 11.64 kB 56.03 kB
/ui/buffering-indicator 8.87 kB 56.03 kB
/ui/captions-button 11.78 kB 56.03 kB
/ui/captions-radio-group 11.71 kB 56.03 kB
/ui/cast-button 11.52 kB 56.03 kB
/ui/container 9.74 kB 56.03 kB
/ui/controls 9.03 kB 56.03 kB
/ui/controls-backdrop 1.69 kB 56.03 kB
/ui/controls-content 1.67 kB 56.03 kB
/ui/dialog 8.92 kB 56.03 kB
/ui/dialog-backdrop 1.70 kB 56.03 kB
/ui/dialog-close 2.06 kB 56.03 kB
/ui/dialog-description 1.69 kB 56.03 kB
/ui/dialog-popup 1.90 kB 56.03 kB
/ui/dialog-title 1.70 kB 56.03 kB
/ui/error-dialog 12.65 kB 56.03 kB
/ui/fullscreen-button 11.52 kB 56.03 kB
/ui/gesture 9.82 kB 56.03 kB
/ui/hotkey 10.31 kB 56.03 kB
/ui/live-button 10.08 kB 56.03 kB
/ui/menu 19.07 kB 56.03 kB
/ui/menu-checkbox-item 1.97 kB 56.03 kB
/ui/menu-content 7.65 kB 56.03 kB
/ui/menu-group 2.09 kB 56.03 kB
/ui/menu-group-label 1.64 kB —
/ui/menu-item 2.30 kB 56.03 kB
/ui/menu-item-indicator 1.38 kB 56.03 kB
/ui/menu-radio-group 3.01 kB 56.03 kB
/ui/menu-radio-item 2.13 kB 56.03 kB
/ui/menu-separator 1.30 kB 56.03 kB
/ui/mute-button 11.53 kB 56.03 kB
/ui/pip-button 11.49 kB 56.03 kB
/ui/play-button 11.49 kB 56.03 kB
/ui/playback-rate-button 11.59 kB 56.03 kB
/ui/playback-rate-radio-group 11.64 kB 56.03 kB
/ui/popover 8.76 kB 56.03 kB
/ui/poster 9.17 kB 56.03 kB
/ui/quality-radio-group 12.23 kB 56.03 kB
/ui/seek-button 11.52 kB 56.03 kB
/ui/seek-indicator 12.98 kB 56.03 kB
/ui/seek-indicator-value 1.10 kB —
/ui/slider 11.91 kB 56.03 kB
/ui/slider-preview 2.01 kB 56.03 kB
/ui/status-announcer 10.88 kB 56.03 kB
/ui/status-indicator 13.28 kB 56.03 kB
/ui/status-indicator-value 1.10 kB —
/ui/thumbnail 10.59 kB 56.03 kB
/ui/time 11.34 kB 56.03 kB
/ui/time-slider 13.40 kB 56.03 kB
/ui/time-slider-chapter-title 9.07 kB 56.03 kB
/ui/time-slider-chapters 9.91 kB 56.03 kB
/ui/title 8.46 kB 56.03 kB
/ui/tooltip 10.13 kB 56.03 kB
/ui/tooltip-label 1.21 kB —
/ui/tooltip-shortcut 1.18 kB —
/ui/volume-indicator 13.27 kB 56.03 kB
/ui/volume-indicator-fill 1.11 kB —
/ui/volume-indicator-value 1.10 kB —
/ui/volume-popover 15.17 kB 56.03 kB
/ui/volume-slider 12.57 kB 56.03 kB
⚛️ @videojs/react — 50 small size changes
Path Base initial PR initial Initial diff Lazy diff
/media/mux-video/hls-js 1.45 kB 1.45 kB +1 B (+0.1%) —
/media/mux-video/spf 1.46 kB 1.46 kB -1 B (-0.1%) —
/media/hls-video 32.41 kB 32.40 kB -4 B (-0.0%) —
/media/mux-video 1.44 kB 1.45 kB +8 B (+0.5%) —
/media/native-hls-video 6.21 kB 6.21 kB +2 B (+0.0%) —
/video/minimal-skin 58.73 kB 58.65 kB -82 B (-0.1%) 0 B
/video/player 8.25 kB 8.24 kB -7 B (-0.1%) 0 B
/video/skin 58.61 kB 58.60 kB -11 B (-0.0%) 0 B
/audio/skin 45.41 kB 45.38 kB -25 B (-0.1%) 0 B
/live-video/player 7.62 kB 7.62 kB -3 B (-0.0%) 0 B
/live-video/skin 48.45 kB 48.50 kB +48 B (+0.1%) 0 B
/live-audio/minimal-skin 33.73 kB 33.67 kB -64 B (-0.2%) 0 B
/live-audio/player 4.45 kB 4.44 kB -3 B (-0.1%) 0 B
/live-audio/skin 33.75 kB 33.71 kB -45 B (-0.1%) 0 B
/ui/airplay-button 11.24 kB 11.24 kB +3 B (+0.0%) 0 B
/ui/audio-track 8.39 kB 8.39 kB -2 B (-0.0%) 0 B
/ui/audio-track-radio-group 10.83 kB 10.82 kB -3 B (-0.0%) 0 B
/ui/buffering-indicator 8.43 kB 8.43 kB -5 B (-0.1%) 0 B
/ui/captions-button 11.23 kB 11.24 kB +8 B (+0.1%) 0 B
/ui/captions-radio-group 10.93 kB 10.95 kB +11 B (+0.1%) 0 B
/ui/controls 8.32 kB 8.32 kB +3 B (+0.0%) 0 B
/ui/error-dialog 12.64 kB 12.64 kB -3 B (-0.0%) 0 B
/ui/gesture 8.46 kB 8.45 kB -1 B (-0.0%) 0 B
/ui/hotkey 8.94 kB 8.94 kB -4 B (-0.0%) 0 B
/ui/live-button 9.55 kB 9.55 kB +5 B (+0.1%) 0 B
/ui/menu 21.90 kB 21.88 kB -18 B (-0.1%) 0 B
/ui/mute-button 11.25 kB 11.24 kB -12 B (-0.1%) 0 B
/ui/pip-button 11.20 kB 11.21 kB +4 B (+0.0%) 0 B
/ui/play-button 11.17 kB 11.17 kB -1 B (-0.0%) 0 B
/ui/playback-rate 8.43 kB 8.42 kB -6 B (-0.1%) 0 B
/ui/playback-rate-button 11.21 kB 11.17 kB -44 B (-0.4%) 0 B
/ui/playback-rate-radio-group 10.85 kB 10.85 kB +7 B (+0.1%) 0 B
/ui/poster 8.64 kB 8.63 kB -4 B (-0.0%) 0 B
/ui/quality 8.87 kB 8.87 kB +8 B (+0.1%) 0 B
/ui/quality-radio-group 11.29 kB 11.29 kB -4 B (-0.0%) 0 B
/ui/seek-button 11.20 kB 11.20 kB -3 B (-0.0%) 0 B
/ui/seek-indicator 12.95 kB 12.96 kB +15 B (+0.1%) 0 B
/ui/slider 14.33 kB 14.42 kB +86 B (+0.6%) 0 B
/ui/status-announcer 10.82 kB 10.82 kB -9 B (-0.1%) 0 B
/ui/status-indicator 13.34 kB 13.35 kB +2 B (+0.0%) 0 B
/ui/time 10.63 kB 10.63 kB +5 B (+0.0%) 0 B
/ui/time-slider 16.16 kB 16.16 kB -1 B (-0.0%) 0 B
/ui/title 7.91 kB 7.91 kB -1 B (-0.0%) 0 B
/ui/volume-indicator 13.42 kB 13.42 kB +10 B (+0.1%) 0 B
/ui/volume-popover 15.56 kB 15.56 kB +1 B (+0.0%) 0 B
/ui/volume-slider 13.00 kB 12.97 kB -29 B (-0.2%) 0 B
/video (minimal) 58.82 kB 58.78 kB -36 B (-0.1%) 0 B
/video (minimal + hls) 59.30 kB 59.41 kB +115 B (+0.2%) 0 B
/audio (default) 45.49 kB 45.53 kB +44 B (+0.1%) 0 B
/audio (minimal) 45.50 kB 45.52 kB +24 B (+0.1%) 0 B
Presets (7)
Entry Initial Lazy
/video (default) 58.71 kB 56.03 kB
/video (default + hls) 59.24 kB 56.03 kB
/video (minimal) 58.78 kB 56.03 kB
/video (minimal + hls) 59.41 kB 56.03 kB
/audio (default) 45.53 kB 56.03 kB
/audio (minimal) 45.52 kB 56.03 kB
/background 908 B 56.03 kB
Media (22)
Entry Initial
/media/mux-video/hls-js 1.45 kB
/media/mux-video/spf 1.46 kB
/media/mux-audio/hls-js 1.12 kB
/media/mux-audio/spf 1.13 kB
/media/background-video 513 B
/media/cloudflare-video 1.81 kB
/media/dash-video 1.11 kB
/media/hls-audio 22.18 kB
/media/hls-background-video 17.48 kB
/media/hls-video 32.40 kB
/media/hlsjs-video 1.12 kB
/media/mux-audio 1.12 kB
/media/mux-background-video 17.50 kB
/media/mux-video 1.45 kB
/media/native-hls-video 6.21 kB
/media/shaka-video 1.11 kB
/media/spotify-audio 1.89 kB
/media/tiktok-video 1.81 kB
/media/twitch-video 1.84 kB
/media/vimeo-video 1.79 kB
/media/wistia-video 1.41 kB
/media/youtube-video 1.79 kB
Extensions (2)
Entry Initial
/extensions/google-cast 1.77 kB
/extensions/mux-data 1.80 kB
Players (5)
Entry Initial Lazy
/video/player 8.24 kB 56.03 kB
/audio/player 4.43 kB 56.03 kB
/background/player 2.64 kB 56.03 kB
/live-video/player 7.62 kB 56.03 kB
/live-audio/player 4.44 kB 56.03 kB
Skins (18)
Entry Type Initial Lazy
/video/minimal-skin.css css 8.12 kB —
/video/skin.css css 7.81 kB —
/video/minimal-skin js 58.65 kB 56.03 kB
/video/skin js 58.60 kB 56.03 kB
/audio/minimal-skin.css css 5.88 kB —
/audio/skin.css css 5.60 kB —
/audio/minimal-skin js 45.47 kB 56.03 kB
/audio/skin js 45.38 kB 56.03 kB
/background/skin.css css 97 B —
/background/skin js 518 B —
/live-video/minimal-skin.css css 6.60 kB —
/live-video/skin.css css 6.51 kB —
/live-video/minimal-skin js 48.43 kB 56.03 kB
/live-video/skin js 48.50 kB 56.03 kB
/live-audio/minimal-skin.css css 4.58 kB —
/live-audio/skin.css css 4.47 kB —
/live-audio/minimal-skin js 33.67 kB 56.03 kB
/live-audio/skin js 33.71 kB 56.03 kB
UI Components (39)
Entry Initial Lazy
/ui/airplay-button 11.24 kB 56.03 kB
/ui/alert-dialog 5.20 kB 56.03 kB
/ui/audio-track 8.39 kB 56.03 kB
/ui/audio-track-radio-group 10.82 kB 56.03 kB
/ui/buffering-indicator 8.43 kB 56.03 kB
/ui/captions-button 11.24 kB 56.03 kB
/ui/captions-radio-group 10.95 kB 56.03 kB
/ui/cast-button 11.22 kB 56.03 kB
/ui/controls 8.32 kB 56.03 kB
/ui/dialog 5.18 kB 56.03 kB
/ui/error-dialog 12.64 kB 56.03 kB
/ui/fullscreen-button 11.21 kB 56.03 kB
/ui/gesture 8.45 kB 56.03 kB
/ui/hotkey 8.94 kB 56.03 kB
/ui/live-button 9.55 kB 56.03 kB
/ui/menu 21.88 kB 56.03 kB
/ui/mute-button 11.24 kB 56.03 kB
/ui/pip-button 11.21 kB 56.03 kB
/ui/play-button 11.17 kB 56.03 kB
/ui/playback-rate 8.42 kB 56.03 kB
/ui/playback-rate-button 11.17 kB 56.03 kB
/ui/playback-rate-radio-group 10.85 kB 56.03 kB
/ui/popover 9.12 kB 56.03 kB
/ui/poster 8.63 kB 56.03 kB
/ui/quality 8.87 kB 56.03 kB
/ui/quality-radio-group 11.29 kB 56.03 kB
/ui/seek-button 11.20 kB 56.03 kB
/ui/seek-indicator 12.96 kB 56.03 kB
/ui/slider 14.42 kB 56.03 kB
/ui/status-announcer 10.82 kB 56.03 kB
/ui/status-indicator 13.35 kB 56.03 kB
/ui/thumbnail 9.78 kB 56.03 kB
/ui/time 10.63 kB 56.03 kB
/ui/time-slider 16.16 kB 56.03 kB
/ui/title 7.91 kB 56.03 kB
/ui/tooltip 9.98 kB 56.03 kB
/ui/volume-indicator 13.42 kB 56.03 kB
/ui/volume-popover 15.56 kB 56.03 kB
/ui/volume-slider 12.97 kB 56.03 kB
🧩 @videojs/core — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 13.47 kB 13.48 kB +12 B (+0.1%) —
Entries (76)
Entry Initial Lazy
. 13.48 kB —
/dom 23.28 kB 56.03 kB
/vjsc 1.90 kB —
/i18n 3.21 kB 56.03 kB
/i18n/locales/all 33.91 kB —
/i18n/locales/ar 1.16 kB —
/i18n/locales/az 1.08 kB —
/i18n/locales/bg 1.29 kB —
/i18n/locales/bn 1.25 kB —
/i18n/locales/bs 1.02 kB —
/i18n/locales/ca 1.04 kB —
/i18n/locales/cs 1.10 kB —
/i18n/locales/cy 1.02 kB —
/i18n/locales/da 984 B —
/i18n/locales/de 1.06 kB —
/i18n/locales/el 1.42 kB —
/i18n/locales/en 801 B —
/i18n/locales/es 999 B —
/i18n/locales/et 1.02 kB —
/i18n/locales/eu 1.04 kB —
/i18n/locales/fa 1.21 kB —
/i18n/locales/fi 1.05 kB —
/i18n/locales/fr 1.01 kB —
/i18n/locales/gd 1.09 kB —
/i18n/locales/gl 1017 B —
/i18n/locales/he 1.10 kB —
/i18n/locales/hi 1.25 kB —
/i18n/locales/hr 1.05 kB —
/i18n/locales/hu 1.10 kB —
/i18n/locales/id 953 B —
/i18n/locales/it 1.01 kB —
/i18n/locales/ja 1.16 kB —
/i18n/locales/ko 1.08 kB —
/i18n/locales/lt 1.04 kB —
/i18n/locales/lv 1.09 kB —
/i18n/locales/mr 1.23 kB —
/i18n/locales/nb 990 B —
/i18n/locales/ne 1.23 kB —
/i18n/locales/nl 1.01 kB —
/i18n/locales/nn 983 B —
/i18n/locales/oc 1.05 kB —
/i18n/locales/pl 1.11 kB —
/i18n/locales/pt 1.02 kB —
/i18n/locales/pt-BR 1.02 kB —
/i18n/locales/pt-PT 1.02 kB —
/i18n/locales/ro 1.04 kB —
/i18n/locales/ru 1.36 kB —
/i18n/locales/sk 1.10 kB —
/i18n/locales/sl 1.04 kB —
/i18n/locales/sr 1.05 kB —
/i18n/locales/sv 1.01 kB —
/i18n/locales/te 1.29 kB —
/i18n/locales/th 1.20 kB —
/i18n/locales/tr 1.00 kB —
/i18n/locales/uk 1.37 kB —
/i18n/locales/vi 1.10 kB —
/i18n/locales/zh 1.01 kB —
/i18n/locales/zh-CN 1.01 kB —
/i18n/locales/zh-TW 1.02 kB —
/i18n/text/airplay 101 B —
/i18n/text/buttons 137 B —
/i18n/text/captions 93 B —
/i18n/text/cast 114 B —
/i18n/text/common 90 B —
/i18n/text/container 75 B —
/i18n/text/errors 285 B —
/i18n/text/fullscreen 98 B —
/i18n/text/live 126 B —
/i18n/text/menu 249 B —
/i18n/text/pip 101 B —
/i18n/text/playback 80 B —
/i18n/text/seek 105 B —
/i18n/text/slider 65 B —
/i18n/text/status 222 B —
/i18n/text/time 322 B —
/i18n/text/volume 133 B —
🏷️ @videojs/element — no changes
Entries (2)
Entry Initial
. 1.05 kB
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Initial
. 1.72 kB
/html 703 B
/react 512 B
🔧 @videojs/utils — no changes
Entries (13)
Entry Initial
/array 271 B
/dom 5.22 kB
/events 320 B
/function 414 B
/i18n 249 B
/jwt 176 B
/object 535 B
/predicate 297 B
/percent 281 B
/string 239 B
/style 212 B
/time 1018 B
/number 199 B
📦 @videojs/cdn — no changes
📦 @videojs/cloudflare-video — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 3.70 kB 3.70 kB -1 B (-0.0%) —
📦 @videojs/dash-video — no changes
📦 @videojs/google-cast — no changes
📦 @videojs/hlsjs-video — no changes

📦 @videojs/media

Path Base initial PR initial Initial diff Lazy diff
. 1.29 kB 3.16 kB +1.87 kB (+144.3%) —
Entries (3)
Entry Initial
. 3.16 kB
/dom 4.12 kB
/media-tracks 2.05 kB
📦 @videojs/mux — no changes
📦 @videojs/mux-audio — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 136.06 kB 135.99 kB -80 B (-0.1%) —
Entries (2)
Entry Initial
. 135.99 kB
/spf 22.67 kB
📦 @videojs/mux-data — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 24.32 kB 24.29 kB -26 B (-0.1%) —
📦 @videojs/mux-video — no changes
Entries (2)
Entry Initial
. 135.91 kB
/spf 32.75 kB
📦 @videojs/native-hls-video — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 5.26 kB 5.27 kB +12 B (+0.2%) —
📦 @videojs/shaka-video — no changes
📦 @videojs/spf — no changes
Entries (7)
Entry Initial
. 4.55 kB
/dom 7.67 kB
/hls 28.08 kB
/media-tracks 507 B
/hls-background-video 16.46 kB
/hls-audio 21.27 kB
/hls-video 31.46 kB
📦 @videojs/spotify-audio — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 3.58 kB 3.58 kB +5 B (+0.1%) —
📦 @videojs/tiktok-video — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 3.56 kB 3.57 kB +6 B (+0.2%) —
📦 @videojs/twitch-video — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 3.63 kB 3.63 kB -2 B (-0.1%) —

📦 @videojs/other

Path Base initial PR initial Initial diff Lazy diff
video.js 71.79 kB 73.44 kB +1.65 kB (+2.3%) 0 B
Entries (3)
Entry Initial Lazy
video.js 73.44 kB 56.03 kB
video.js/package.json 608 B —
video.js/errors 1.03 kB —
📦 @videojs/vimeo-video — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 10.59 kB 10.62 kB +34 B (+0.3%) —
📦 @videojs/wistia-video — 2 small size changes
Path Base initial PR initial Initial diff Lazy diff
. 1.91 kB 1.92 kB +4 B (+0.2%) —
/helpers 1.77 kB 1.77 kB +1 B (+0.1%) —
Entries (2)
Entry Initial
. 1.92 kB
/helpers 1.77 kB
📦 @videojs/youtube-video — 1 small size change
Path Base initial PR initial Initial diff Lazy diff
. 4.38 kB 4.41 kB +27 B (+0.6%) —

ℹ️ How to interpret

Each entry is independently bundled, minified, and brotli-compressed. Initial size includes its static import graph; lazy dynamic chunks are reported separately.

Entries are not additive because their dependency graphs overlap. Preset rows represent realistic combined bundles.

Changes of 300 B or less across initial, lazy, and total size are collapsed, not discarded.

Run pnpm size locally to check current initial sizes.

…eojs/html

Apps depend on the framework packages, not on @videojs/media, so importing
detectMediaSource from @videojs/media would fail under pnpm's strict
dependency resolution. Both packages now re-export it with its
DetectedMediaSource and MediaSourceKind types.
The builder scans the media source module as a framework-neutral entry point,
since framework scans skip exports owned by other packages. The page maps
each kind to its media component for React and HTML and covers MIME types,
bare ids, and the Vidstack shorthands.
MediaSource is the Media Source Extensions API, and SPF already exports
supportsMediaSource, createMediaSource, and attachMediaSource for it, so
detectMediaSource read like MSE feature detection. The types follow:
DetectedSource and SourceKind. The reference page moves to
reference/api/detect-source.
@mihar-22 mihar-22 changed the title feat(media): add detectMediaSource feat(media): add detectSource Sep 29, 2026
@mihar-22
mihar-22 marked this pull request as ready for review September 30, 2026 17:02

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@luwes luwes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal: drop src and id from DetectedSource, keep the name detectSource.

Right now the result mixes classification with normalization. That's why the docs have to say "pass the returned src" twice, and it's where the Mux token bug below comes from. Suggest:

interface DetectedSource {
  kind: SourceKind;
  type?: string;
}
  • src: move the rewriting into the media that plays the source. parseYouTubeSource accepts youtube/<id> (as nocookie), parseVimeoSource accepts vimeo/<id>, and Mux media accepts player.mux.com/<id> and maps playback-token to token next to parseMuxVideoURL. Then detectSource never changes the input, apps pass the URL they already have, and <youtube-video src="youtube/…"> works for Vidstack migrants whether or not they call detectSource. Today parseYouTubeSource doesn't recognize the shorthand, so passing one straight to YouTubeVideo doesn't work.
  • id: it means different things per kind (YouTube video id vs playlist id, Twitch VOD id vs channel name), and the result doesn't say which. Apps that need a provider id can call parseYouTubeSource and friends, which carry their own kind.

Removing fields after release is a breaking change, so it'd be good to do this before it ships, even if the adapter shorthand support lands as a follow-up.

mihar-22 and others added 3 commits September 30, 2026 11:11
`parseYouTubeSource` and `parseVimeoSource` now read Vidstack's
`youtube/<id>` and `vimeo/<id>` shorthands, so the YouTube and Vimeo
media play them as `src` without an app rewriting them first. YouTube
shorthands keep playing from the privacy-enhanced host, as in Vidstack.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…MimeType

`resolveMediaType(src, type?)` returns only the media type that plays a
source, such as `'youtube'` or `'hls'`, instead of an object with a
rewritten `src` and provider `id`. Apps pass the source they already
have to the media, and adapters read ids with their own parsers.

`resolveMimeType(src)` returns the MIME type a file extension implies,
the part of the old result that wasn't about the media type.

`player.mux.com` page URLs no longer resolve to `mux`, since Mux media
only plays stream URLs and nothing rewrites the source anymore.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replaces the detectSource page. Usage passes the original `src` to the
media, and the shorthand table says what each shorthand plays rather
than what it expands to.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1aa64cd. Configure here.

mihar-22 and others added 3 commits September 30, 2026 11:58
The type becomes `MediaSourceKind`, and the reference page moves to
`resolve-source-kind`. "Media type" read like a MIME type next to
`resolveMimeType`.

Also drops the reference page's note on calling it from Server
Components, which needs its own investigation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`stream.mux.com/<playback-id>` serves the same HLS manifest as the
`.m3u8` URL, and the installation flow already treats it as Mux. Static
renditions under a playback id, such as `/<id>/highest.mp4`, still
resolve by file extension.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`detectRendererCandidates` maps the source kind to renderers, then adds
the generic stream renderers a file extension implies, so a Mux or
Cloudflare manifest still accepts `hls` or `dash`. The host and
extension tables are gone.

Resolving through the media parsers tightens detection: provider pages
without a video, such as `youtube.com/`, and `mux.com` pages, which
aren't streams, no longer match a provider.

The CLI bundles `@videojs/media` along with the rest, so the published
file still needs only Node built-ins.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mihar-22 and others added 2 commits September 30, 2026 12:13
`resolveProviderKind(src)` answers which hosting provider serves a URL,
and `resolveFormatKind(src, type?)` answers which stream or file format
it is. `resolveSourceKind` is the first answer, falling back to the
second. `MediaSourceKind` is now `MediaProviderKind | MediaFormatKind`.

Installation needs both answers for one URL: a Mux manifest plays in
the Mux media and in the generic HLS media. The halves stay in
`@videojs/media` and aren't re-exported by the framework packages.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`detectRenderer` becomes `resolveRenderer` and returns just the
renderer; callers read its label with `getInstallationRenderer`, as
they already did for `articleFor`. `detectRendererCandidates` becomes
`resolveRendererCandidates` and lists the provider's renderers followed
by the format's, replacing the file-name lookup. The module moves to
`resolve-renderer.ts`, and `DetectionResult` is gone.

Project detection in `node.ts` keeps `detect`: it reads the file
system rather than resolving a value it was given.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`resolveProviderKind` becomes `resolveSourcePlatform` and
`resolveFormatKind` becomes `resolveSourceFormat`, with the types
`MediaSourcePlatform` and `MediaSourceFormat`, so every source resolver
reads `resolveSource*`. Prose around them says hosting platform rather
than provider.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Drops `resolveSourcePlatform` and `resolveSourceFormat` and their
types; `MediaSourceKind` is one union again. Installation resolves the
kind with `resolveSourceKind`, and resolves the file name alone for the
generic stream renderers a provider's manifest also plays in.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Summary

inconclusive — the Registry consumers job failed during registry-project setup, before any Playwright test executed: create-next-app@16.3.3 aborted with a Rust stack overflow.

Failed run

Evidence

  • The failed job invoked pnpm dlx create-next-app@16.3.3 next-react-tailwind ...; its log ends with thread '<unknown>' has overflowed its stack and fatal runtime error: stack overflow, aborting at registry global setup.
  • The uploaded playwright-report-registry contains no executed test result or trace; the workflow uploaded no trace artifact for this job.
  • The PR diff changes media-source detection, adapters, installation, and docs, but no apps/e2e files. The three immediately preceding E2E runs on this branch succeeded.

Likely cause

Verified: the process creating the Next/Tailwind registry fixture crashed before product tests ran.

Inference: this is likely a transient/upstream create-next-app/runner failure, not evidence that the media-source changes regress runtime behavior.

Recommended actions

  • Retry or locally rerun the registry-consumer suite to establish reproducibility.
  • If it recurs, reproduce the exact pnpm dlx create-next-app@16.3.3 ... --tailwind ... command from apps/e2e/suites/registry/setup/global.ts and inspect the toolchain/runtime environment before changing product code.

@mihar-22 mihar-22 changed the title feat(media): add detectSource feat(media): add resolveSourceKind and resolveMimeType Sep 30, 2026
`application/x-mpegURL; charset=utf-8` and `application/dash+xml;
profiles=…` missed the HLS and DASH checks, and `audio/mpegurl; …`
fell through to `audio`. The type's parameters are now dropped before
matching.

Also rewords the YouTube shorthand comment to say why it plays from the
privacy-enhanced host.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The installation Markdown edge function loads `dist/index.js` through
an import map, and Netlify's edge bundler resolves npm specifiers only
from the root `node_modules`, where pnpm doesn't link workspace
packages. The `@videojs/media` import broke the site's deploy previews.

Installation now bundles the source kind resolver and parsers it uses,
so its main entry imports no packages again. `@videojs/media` moves to
its devDependencies, and the CLI no longer lists it, since it bundles
installation's output.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Applies the maintain-tests audit from #3080 to the tests this branch
touches. Installation now delegates host and extension recognition to
`resolveSourceKind`, so its per-host and per-extension cases replayed
media's contract. They're gone; installation keeps one case per kind for
the renderer mapping, the use-case selection and null cases as tables,
and the file-name fallback.

Media takes over what only installation proved: the videodelivery.net
host, the Vimeo page gate, and the ogv, m4a, wav, ogg, and aac MIME
types. Whitespace trimming gets a padded URL that resolves, since a
blank string returns null with or without trimming. Shorthand variants
move to their parser tests, and query, hash, and case handling to
`resolveMimeType`. The `video/mp4; codecs=…` case is dropped because it
passes without the parameter fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The result names the type of adapter that plays a source, so the
function becomes `resolveAdapterType` and its type `AdapterType`,
alongside `resolveMimeType`. The module, tests, and reference page move
to `adapter-type`, and the prose says adapter type instead of kind.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mihar-22 mihar-22 changed the title feat(media): add resolveSourceKind and resolveMimeType feat(media): add resolveAdapterType and resolveMimeType Sep 30, 2026
@mihar-22
mihar-22 requested review from heff and luwes September 30, 2026 22:58

@luwes luwes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!
nit some mentions of provider
resolveMimeType can be used in the HLS adapter, for future.

"Provider" meant two things around `resolveAdapterType`: the hosting
service a URL belongs to, and the adapter type or renderers it resolves
to. Prose and test names now say service for the first and adapter type
or the renderers for the second. The private `resolveProvider` helper
becomes `fromService`, beside `fromMimeType`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@mihar-22
mihar-22 merged commit a77010c into main Sep 30, 2026
38 of 39 checks passed
@mihar-22
mihar-22 deleted the t3code/media-source-detection branch September 30, 2026 23:12
@videojs-release videojs-release Bot mentioned this pull request Sep 30, 2026

This branch was successfully deployed

1 active deployment
Preview — c6634c7a Deployed Sep 30, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants