Skip to content

LectureVideo

Defined in: v1/schemas.ts:697

Finding the video_id — use CoursesAPI.getLecture to fetch the lecture and find the attachment where kind === 'video'. The attachment.id is the video_id to pass to CoursesAPI.getVideo.

// Find the video_id from a lecture's attachments
const { lecture } = await coursesAPI.getLecture(1886748, 42809204);
const videoAttachment = lecture.attachments?.find(a => a.kind === 'video');
if (videoAttachment) {
const { video } = await coursesAPI.getVideo(1886748, 42809204, videoAttachment.id);
console.log(`Stream: ${video.video_asset?.url}`);
}
  • output<typeof LectureVideoSchema>

id: number

Defined in: v1/schemas.ts:674

z.infer.id


optional media_duration?: number | null

Defined in: v1/schemas.ts:678

z.infer.media_duration


optional media_type?: string

Defined in: v1/schemas.ts:677

z.infer.media_type


optional status?: string

Defined in: v1/schemas.ts:675

z.infer.status


optional url_thumbnail?: string | null

Defined in: v1/schemas.ts:676

z.infer.url_thumbnail


optional video_asset?: { content_type?: string | null; url?: string | null; }

Defined in: v1/schemas.ts:679

optional content_type?: string | null

optional url?: string | null

z.infer.video_asset