upload_video


Description:

[ Version ( since = "0.8.0" ) ]
public UploadStream upload_video (YouTubeVideo video, string slug, string content_type, Cancellable? cancellable = null) throws Error

Uploads a video to YouTube, using the properties from video and the file data written to the resulting UploadStream.

If video has already been inserted, a ENTRY_ALREADYSERTED error will be returned. If no user is authenticated with the service, AUTHENTICATION_REQUIRED will be returned.

The stream returned by this function should be written to using the standard OutputStream methods, asynchronously or synchronously. Once the stream is closed (using close), finish_video_upload should be called on it to parse and return the updated YouTubeVideo for the uploaded video. This must be done, as video isn't updated in-place.

In order to cancel the upload, a Cancellable passed in to cancellable must be cancelled using cancel. Cancelling the individual OutputStream operations on the UploadStream will not cancel the entire upload; merely the write or close operation in question. See the cancellable for more details.

Any upload errors will be thrown by the stream methods, and may come from the ServiceError domain.

Parameters:

this

a YouTubeService

video

a YouTubeVideo to insert

slug

the filename to give to the uploaded file

content_type

the content type of the uploaded data

cancellable

a Cancellable for the entire upload stream, or null

Returns:

a UploadStream to write the video data to, or null; unref with unref