Skip to content

Commit f749f08

Browse files
author
strausr
committed
fix(rules): video player CSS import — use path without dist/
- Primary path: cloudinary-video-player/cld-video-player.min.css only - Remove fallback that suggested dist/ path - Fix common-error section that recommended dist path
1 parent 6170140 commit f749f08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/.cursorrules.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ res.json({ signature, timestamp: paramsToSign.timestamp, api_key: process.env.CL
400400
### Cloudinary Video Player (The Player)
401401
- ✅ **Purpose**: The actual video player — full-featured UI, controls, playlists, recommendations, ads, chapters. Use when the user asks for a "video player"; use AdvancedVideo when they just need to display a video.
402402
- ✅ **Package**: `cloudinary-video-player` (separate package)
403-
- ✅ **Import** (named, not default): `import { videoPlayer } from 'cloudinary-video-player'` and `import 'cloudinary-video-player/cld-video-player.min.css'`. If CSS fails, try `'cloudinary-video-player/dist/cld-video-player.css'`.
403+
- ✅ **Import** (named, not default): `import { videoPlayer } from 'cloudinary-video-player'` and `import 'cloudinary-video-player/cld-video-player.min.css'`. **Do not use `dist/` in the CSS path** — use `cloudinary-video-player/cld-video-player.min.css` only.
404404
- ❌ **WRONG**: `import cloudinary from 'cloudinary-video-player'` then `cloudinary.videoPlayer(...)` — use named `videoPlayer` instead.
405405
- ✅ **player.source()** takes an **object**, not a string: `player.source({ publicId: 'samples/elephants' })`. ❌ WRONG: `player.source('samples/elephants')`.
406406
- ✅ **Use refs**, not IDs: `const videoRef = useRef<HTMLVideoElement>(null)`; pass `videoRef.current` to `videoPlayer()`. Avoid `document.getElementById` with React (can cause DOM conflicts).
@@ -710,7 +710,7 @@ res.json({ signature, timestamp: paramsToSign.timestamp, api_key: process.env.CL
710710
- ❌ Problem: Configuration or initialization issue with standalone player
711711
- ✅ Solution:
712712
1. Check `cloud_name` is provided in player config
713-
2. Ensure CSS file is imported: `import 'cloudinary-video-player/dist/cld-video-player.css'`
713+
2. Ensure CSS file is imported: `import 'cloudinary-video-player/cld-video-player.min.css'` (no `dist/` in path)
714714
3. Verify player is initialized in `useEffect` with proper cleanup
715715
4. Check video element has required classes: `cld-video-player cld-fluid`
716716
5. Always call `player.dispose()` in useEffect cleanup function

0 commit comments

Comments
 (0)