Video Integration

Seamlessly integrate video content into your learning experiences. Upload, transcode, stream, and track engagement with our multimedia APIs.

Embedding a Video in a Lesson

javascript
// Upload and attach a video to a lesson
const video = await client.videos.create({
  title: "Cell Division Explained",
  source_url: "https://storage.example.com/cell-division.mp4",
  chapters: [
    { title: "Introduction", timestamp: "0:00" },
    { title: "Mitosis", timestamp: "2:15" },
    { title: "Meiosis", timestamp: "8:30" },
    { title: "Summary", timestamp: "14:00" }
  ],
  captions: { language: "en", auto_generate: true }
});

// Attach to a lesson
await client.lessons.update("les_abc123", {
  content: {
    sections: [
      { type: "video", video_id: video.id }
    ]
  }
});

Endpoints

GET /v1/videos

List all uploaded videos with filtering and pagination.

Query Parameters

  • subject string - Filter by subject
  • status string - Processing status (processing, ready, failed)
  • has_captions boolean - Only videos with captions
  • limit integer - Records per page (default: 20)
POST /v1/videos

Upload a new video. Supports direct upload or URL-based ingestion. Videos are automatically transcoded for adaptive streaming.

Request Body

  • title string required - Video title
  • source_url string - URL to fetch the video from
  • chapters object[] - Chapter markers with titles and timestamps
  • captions object - Caption configuration
  • thumbnail_url string - Custom thumbnail image
GET /v1/videos/:id

Retrieve video details including streaming URLs, chapters, captions, and analytics.

response
{
  "id": "vid_xyz789",
  "title": "Cell Division Explained",
  "status": "ready",
  "duration": "16:42",
  "streaming_url": "https://stream.plum.ng/vid_xyz789/manifest.m3u8",
  "thumbnail_url": "https://cdn.plum.ng/thumbs/vid_xyz789.jpg",
  "chapters": [
    { "title": "Introduction", "timestamp": "0:00" },
    { "title": "Mitosis", "timestamp": "2:15" },
    { "title": "Meiosis", "timestamp": "8:30" },
    { "title": "Summary", "timestamp": "14:00" }
  ],
  "captions": [
    { "language": "en", "url": "https://cdn.plum.ng/captions/vid_xyz789_en.vtt" }
  ],
  "analytics": {
    "total_views": 342,
    "avg_watch_time": "12:18",
    "completion_rate": 0.73
  }
}
GET /v1/videos/:id/analytics

Detailed viewing analytics — watch time, drop-off points, chapter engagement, and rewatch patterns.

DELETE /v1/videos/:id

Delete a video and all associated assets (transcoded files, captions, thumbnails).

Features

Adaptive Streaming

Videos are transcoded into multiple quality levels for smooth playback on any connection.

Auto Captions

Automatically generate captions using AI-powered speech recognition in 30+ languages.

Chapter Markers

Add chapters to make long videos navigable. Students can jump to specific topics.

Watch Analytics

Track viewing patterns, identify drop-off points, and measure content effectiveness.