Open
Conversation
✅ Deploy Preview for cld-video-player ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
❌ Deploy Preview for cld-vp-esm-pages failed. Why did it fail? →
|
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.
Summary
The default player bundle is now lightweight (~10kb initial) and loads the full player core on demand. This is the new default behavior for v4.x - no configuration needed to get the small bundle.
How the player works in v4.x
Default behavior (lazy loading)
The default entry (
player.js/import from 'cloudinary-video-player') ships a ~10kb stub that loads the full player core (~130kb) asynchronously on first use. ThevideoPlayer()API remains synchronous - it returns a deferred proxy that buffers calls (.source(),.on(),.playlist(), etc.) and replays them in order once the core finishes loading:The proxy is also thenable, so consumers who need the real player instance can
awaitit:Full bundle (eager loading)
For consumers who need everything loaded upfront (SSR, legacy integrations),
player-full.jsloads the entire player synchronously (~140kb).videoPlayer()returns a realVideoPlayerinstance immediately.Backward compatibility
cld-video-player.jsplayer-full.js- same eager behavior as beforecld-video-player.cssplayer.css- identical CSScld-video-player.light.jsplayer-full.jswith console.warnBundles
videoPlayer()returnsplayer.js(default)player-full.jsVideoPlayer(sync)cld-video-player.jsVideoPlayer(sync)npm imports
cloudinary-video-playerlib/index.js, CJS:dist/player.min.js)cloudinary-video-player/alllib/all.js, CJS:dist/player-full.min.js)cloudinary-video-player/player.min.csscloudinary-video-player/cld-video-player.min.cssSource structure
src/index.jsCloudinary.new()legacy wrappersrc/index.full.jsvideoPlayer()src/index.all.jssrc/utils/deferred-player.jsBreaking changes
export { videojs }removed - useimport videojs from 'video.js'directly./lazy,./player,./videoPlayer,./fulldist/cld-video-player-lazy.jsno longer produced (replaced bydist/player.js)How to Test
npm run test:unit- all 127 tests passnpm start- dev server loads demo pages viaplayer.js+player.csscld-video-player.jsworks for existing consumers (copy ofplayer-full.js)cd docs/es-modules && npx vite- verify examples load without errors