Skip to content

Commit 9db39ee

Browse files
author
strausr
committed
fix: update video player example
1 parent 82b2ae0 commit 9db39ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

templates/.cursorrules.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ Use when the user asks for a **video player** (styled UI, controls, playlists).
420420
**Rule: imperative element only.** Do **not** pass a React-managed `<video ref={...} />` to the player — the library mutates the DOM and React will throw removeChild errors. Create the video element with `document.createElement('video')`, append it to a container ref, and pass that element to `videoPlayer(el, ...)`.
421421

422422
- **Package**: `cloudinary-video-player`. Install with `npm install cloudinary-video-player` (no version).
423-
- **Import**: `import { videoPlayer } from 'cloudinary-video-player'` (named) and `import 'cloudinary-video-player/cld-video-player.min.css'` (no `dist/` in path).
423+
- **Import**: `import { videoPlayer } from 'cloudinary-video-player'` (named) and `import 'cloudinary-video-player/cld-video-player.min.css'` (no `dist/` in path). The package only exposes paths under `lib/` via `exports`; use `cld-video-player.min.css` (no `dist/`), which resolves to `lib/cld-video-player.min.css`.
424+
- ❌ **WRONG**: `import 'cloudinary-video-player/dist/cld-video-player.min.css'` — package `exports` do not expose `dist/`; the valid path is `cloudinary-video-player/cld-video-player.min.css`.
424425
- **player.source()** takes an **object**: `player.source({ publicId: 'samples/elephants' })`. Not a string.
425426
- **Cleanup**: Call `player.dispose()`, then **only if** `el.parentNode` exists call `el.parentNode.removeChild(el)` (avoids NotFoundError).
426427
- **If init fails** (CSP, extensions, timing): render **AdvancedVideo** with the same publicId. Do not relax CSP in index.html or ask the user to disable extensions.

0 commit comments

Comments
 (0)