Demo app for the blog post: How to add chapters to an MP4 video.
Demonstrates manual chapter markers on an IKVideoPlayer — progress-bar markers and a chapter menu from an inline chapters object — with ImageKit and the @imagekit/video-player SDK.
| Route | Description |
|---|---|
/ |
Product-walkthrough lesson with 16 inline chapters |
- Chapter markers — timestamps from
lib/lesson.tsrendered as markers on the progress bar - Chapter menu — jump between sections from the control bar (e.g. "DAM Sharing" at 8:09)
- Inline
chaptersshape —chapters: { [seconds]: title }on the playersourceprop
-
Clone the repo and navigate to this folder:
cd chapters-demo -
Install dependencies:
npm install
-
Create
.env.localwith your ImageKit ID (optional — defaults toikmedia):NEXT_PUBLIC_IMAGEKIT_ID=your_imagekit_idThe sample video is hosted on ImageKit's
ikmediaendpoint. To use your own video, updateLESSON_VIDEO_SRCinlib/lesson.ts. -
Start the dev server:
npm run dev
Open http://localhost:3000.
| Variable | Description |
|---|---|
NEXT_PUBLIC_IMAGEKIT_ID |
Your ImageKit ID (path segment after ik.imagekit.io/), e.g. your_imagekit_id |