Documentation
OAuth.OAuthCaptions
Constructors
constructor
• new OAuthCaptions(oauth)
Parameters
| Name | Type |
|---|---|
oauth | OAuth |
Defined in
Properties
oauth
• oauth: OAuth
Defined in
Methods
deleteCaption
▸ deleteCaption(id): Promise<void>
Deletes a Caption track.
Last tested 06/11/2020 04:50. PASSING
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The ID of the caption track to delete. |
Returns
Promise<void>
Defined in
downloadCaption
▸ downloadCaption(id, format?, language?): Promise<Buffer>
Downloads a Caption track.
Last tested 06/11/2020 04:50. PASSING
Parameters
| Name | Type | Description |
|---|---|---|
id | string | The ID of the caption track to download. |
format? | "sbv" | "scc" | "srt" | "ttml" | "vtt" | The file format to download the track in. |
language? | string | The language to download the track in. |
Returns
Promise<Buffer>
Defined in
getCaption
▸ getCaption(videoResolvable, captionId): Promise<Caption>
Get a Caption object from the ID of the caption.
Last tested 06/11/2020 04:50. PASSING
Parameters
| Name | Type | Description |
|---|---|---|
videoResolvable | VideoResolvable | The Title, URL, or ID of the video to get the caption from. |
captionId | string | The ID of the caption. |
Returns
Promise<Caption>
Defined in
getCaptions
▸ getCaptions(videoResolvable): Promise<Caption[]>
Gets the Captions of a Video. Used mostly internally with Video.fetchCaptions.
Last tested 06/11/2020 04:50. PASSING
Parameters
| Name | Type | Description |
|---|---|---|
videoResolvable | VideoResolvable | The Title, URL, or ID of the video to get the captions from. |
Returns
Promise<Caption[]>
Defined in
updateCaption
▸ updateCaption(id, track?, draft?): Promise<Caption>
Edits a Caption track.
If your request does not specify a value for a property that already has a value,
the property's existing value will be deleted.
Last tested 06/11/2020 04:50. PASSING
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
id | string | undefined | The ID of the caption track to edit. |
track? | Buffer | undefined | The caption track to upload. |
draft | boolean | null | Whether or not the caption track is a draft. If it is, it isn't visible to users. |
Returns
Promise<Caption>
Defined in
uploadCaption
▸ uploadCaption(videoResolvable, language, name, track, draft?): Promise<Caption>
Uploads a Caption track for a Video.
Last tested 06/11/2020 04:50. PASSING
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
videoResolvable | VideoResolvable | undefined | The video to add the caption track to. |
language | string | undefined | The language that the caption track is in. |
name | string | undefined | The name of the caption track. |
track | Buffer | undefined | The caption track to upload. |
draft | boolean | false | Whether or not the caption track is a draft. If it is, it isn't visible to users. |
Returns
Promise<Caption>