feat!: detect players with Video.js resolveAdapterType - #2050
Merged
Merged
Conversation
luwes
force-pushed
the
feat/resolve-adapter-type
branch
from
October 2, 2026 00:09
59e9247 to
dd1757d
Compare
1 of 5 tasks
luwes
added this pull request to stack #2051
October 2, 2026 00:09
luwes
force-pushed
the
feat/resolve-adapter-type
branch
from
October 2, 2026 00:23
dd1757d to
1f228a4
Compare
luwes
force-pushed
the
feat/resolve-adapter-type
branch
from
October 2, 2026 00:33
1f228a4 to
f0c7810
Compare
luwes
force-pushed
the
feat/resolve-adapter-type
branch
from
October 2, 2026 00:55
f0c7810 to
3b1ac2d
Compare
Replace the URL regexes in patterns.ts with resolveAdapterType and resolveMimeType from @videojs/react, so ReactPlayer recognizes the same sources as the Video.js v10 media components it renders. - YouTube, Vimeo, Wistia, Mux, Spotify, Twitch, TikTok and DASH sources are matched by adapter type. - Mux stream URLs ending in .m3u8 still play with hls.js. - File playback keeps AUDIO_EXTENSIONS and VIDEO_EXTENSIONS as a fallback for extensions Video.js does not recognize (m4v, m4b, weba, oga, spx, ...). Newly recognized sources: - localized Spotify URLs (open.spotify.com/intl-de/track/...) and spotify: URIs - youtube/<id> and vimeo/<id> shorthands - .flac files Breaking changes: - react-player/patterns no longer exports HLS_EXTENSIONS, DASH_EXTENSIONS, MATCH_URL_MUX, MATCH_URL_YOUTUBE, MATCH_URL_VIMEO, MATCH_URL_WISTIA, MATCH_URL_SPOTIFY, MATCH_URL_TWITCH or MATCH_URL_TIKTOK. Use resolveAdapterType from @videojs/react instead. - These URLs are no longer matched to a service player and fall back to the HTML player: youtube.com/user/..., music.youtube.com, vimeo.com/channels/..., vimeo.com/showcase/... and player.twitch.tv/?video=... BREAKING CHANGE: URL pattern exports were removed from react-player/patterns in favor of resolveAdapterType from @videojs/react, and some URLs now resolve to a different player.
Every built-in player key is a Video.js adapter type (plus html), so patterns.ts resolves a URL to its player key once and canPlay(key) compares against it, instead of a table of per-player predicates. The Mux .m3u8 -> hls.js rule and the extension fallback for the HTML player are unchanged; player selection is identical for every URL compared. Also removes canPlayFile, which handled arrays of sources that src no longer accepts.
Breaking changes:
- react-player/patterns exports canPlay as a function of the player key: canPlay.youtube(url) becomes canPlay('youtube')(url).
BREAKING CHANGE: canPlay in react-player/patterns is now canPlay(key)(url) instead of canPlay[key](url).
luwes
force-pushed
the
feat/resolve-adapter-type
branch
from
October 2, 2026 01:46
3b1ac2d to
ef45ca4
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2049.
Replaces the URL regexes in
src/patterns.tswithresolveAdapterType/resolveMimeTypefrom@videojs/react, so ReactPlayer recognizes the same sources as the Video.js v10 media components it renders.html), sopatterns.tsresolves a URL to its player key once and each player'scanPlayiscanPlay('<key>'), instead of a table of per-player predicates..m3u8still play with hls.js.AUDIO_EXTENSIONS/VIDEO_EXTENSIONSas a fallback for extensions Video.js does not recognize (m4v,m4b,weba,oga,spx, ...).canPlayFile, which handled arrays of sources thatsrcno longer accepts.Release notes
Features
resolveAdapterTypefrom Video.js v10.open.spotify.com/intl-de/track/...),spotify:URIs,youtube/<id>andvimeo/<id>shorthands, and.flacfiles.Breaking changes:
react-player/patternsno longer exportsHLS_EXTENSIONS,DASH_EXTENSIONS,MATCH_URL_MUX,MATCH_URL_YOUTUBE,MATCH_URL_VIMEO,MATCH_URL_WISTIA,MATCH_URL_SPOTIFY,MATCH_URL_TWITCHorMATCH_URL_TIKTOK. UseresolveAdapterTypefrom@videojs/reactinstead:canPlayinreact-player/patternsis now a function of the player key:canPlay.youtube(url)becomescanPlay('youtube')(url).These URLs are no longer matched to a service player and fall back to the HTML player:
youtube.com/user/...,music.youtube.com/watch?v=...vimeo.com/channels/<channel>/<id>,vimeo.com/showcase/<id>player.twitch.tv/?video=<id>Testing
pnpm lint,pnpm typecheck,pnpm test,pnpm buildandpnpm build:demopass, on each commit.canPlay(key)refactor, re-ran the comparison against the previous commit: identical player selection for every URL.