Show / Hide Table of Contents

Class CaptionsResource

The "captions" collection of methods.

Inheritance
System.Object
CaptionsResource
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.YouTube.v3
Assembly: Google.Apis.YouTube.v3.dll
Syntax
public class CaptionsResource

Constructors

CaptionsResource(IClientService)

Constructs a new resource.

Declaration
public CaptionsResource(IClientService service)
Parameters
Type Name Description
IClientService service

Methods

Delete(String)

Deletes a specified caption track.

Declaration
public virtual CaptionsResource.DeleteRequest Delete(string id)
Parameters
Type Name Description
System.String id

The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource.

Returns
Type Description
CaptionsResource.DeleteRequest

Download(String)

Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.

Declaration
public virtual CaptionsResource.DownloadRequest Download(string id)
Parameters
Type Name Description
System.String id

The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource.

Returns
Type Description
CaptionsResource.DownloadRequest

Insert(Caption, String)

Uploads a caption track.

Declaration
public virtual CaptionsResource.InsertRequest Insert(Caption body, string part)
Parameters
Type Name Description
Caption body

The body of the request.

System.String part

The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.

Returns
Type Description
CaptionsResource.InsertRequest

Insert(Caption, String, Stream, String)

Uploads a caption track.

Declaration
public virtual CaptionsResource.InsertMediaUpload Insert(Caption body, string part, Stream stream, string contentType)
Parameters
Type Name Description
Caption body

The body of the request.

System.String part

The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.

System.IO.Stream stream

The stream to upload.

System.String contentType

The content type of the stream to upload.

Returns
Type Description
CaptionsResource.InsertMediaUpload

List(String, String)

Returns a list of caption tracks that are associated with a specified video. Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.

Declaration
public virtual CaptionsResource.ListRequest List(string part, string videoId)
Parameters
Type Name Description
System.String part

The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet.

System.String videoId

The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks.

Returns
Type Description
CaptionsResource.ListRequest

Update(Caption, String)

Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both.

Declaration
public virtual CaptionsResource.UpdateRequest Update(Caption body, string part)
Parameters
Type Name Description
Caption body

The body of the request.

System.String part

The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id.

Returns
Type Description
CaptionsResource.UpdateRequest

Update(Caption, String, Stream, String)

Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both.

Declaration
public virtual CaptionsResource.UpdateMediaUpload Update(Caption body, string part, Stream stream, string contentType)
Parameters
Type Name Description
Caption body

The body of the request.

System.String part

The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id.

System.IO.Stream stream

The stream to upload.

System.String contentType

The content type of the stream to upload.

Returns
Type Description
CaptionsResource.UpdateMediaUpload
Back to top