Skip to main content

Class: VideoCaptions

Captions of a video

Example


console.log(video.captions.languages.map((l) => `${l.code} - ${l.name}`)); // printing out available languages for captions

console.log(await video.captions.get("en")); // printing out captions of a specific language using language code

Hierarchy

  • Base

    VideoCaptions

Properties

client

client: Client

An instance of Client

Inherited from

Base.client


languages

languages: CaptionLanguage[]

List of available languages for this video


video

Optional video: BaseVideo

The video this captions belongs to

Methods

get

get(languageCode?, translationLanguageCode?): Promise<undefined | Caption[]>

Get captions of a specific language or a translation of a specific language

Parameters

NameType
languageCode?string
translationLanguageCode?string

Returns

Promise<undefined | Caption[]>