Interface UploadAPI

Functions to upload binary content to Rev.

interface UploadAPI {
    channelLogo(
        channelId: string,
        file: FileUploadType,
        options?: ImageOptions,
    ): Promise<void>;
    chapters(
        videoId: string,
        chapters: Video.Chapter.Request[],
        action?: "replace" | "append",
        options?: RequestOptions,
    ): Promise<void>;
    presentationChapters(
        videoId: string,
        file: FileUploadType,
        options?: PresentationChaptersOptions,
    ): Promise<void>;
    replaceVideo(
        videoId: string,
        file: FileUploadType,
        options?: VideoOptions,
    ): Promise<void>;
    supplementalFile(
        videoId: string,
        file: FileUploadType,
        options?: SupplementalOptions,
    ): Promise<void>;
    thumbnail(
        videoId: string,
        file: FileUploadType,
        options?: ImageOptions,
    ): Promise<void>;
    transcription(
        videoId: string,
        file: FileUploadType,
        language?: SupportedLanguage,
        options?: TranscriptionOptions,
    ): Promise<void>;
    userProfileImage(
        userId: string,
        file: FileUploadType,
        options?: ImageOptions,
    ): Promise<void>;
    video(
        file: FileUploadType,
        metadata?: UploadMetadata,
        options?: VideoOptions,
    ): Promise<string>;
    webcastBackground(
        eventId: string,
        file: FileUploadType,
        options: ImageOptions,
    ): Promise<void>;
    webcastBranding(
        eventId: string,
        request: BrandingRequest,
        options?: ImageOptions,
    ): Promise<void>;
    webcastPresentation(
        eventId: string,
        file: FileUploadType,
        options: PresentationChaptersOptions,
    ): Promise<void>;
    webcastProducerLayoutBackground(
        eventId: string,
        file: FileUploadType,
        options: ImageOptions,
    ): Promise<void>;
}

Hierarchy

  • API
    • UploadAPI

Methods

  • Parameters

    • videoId: string

      id of video to add chapters to

    • chapters: Video.Chapter.Request[]

      list of chapters. Must have time value and one of title or imageFile

    • action: "replace" | "append" = 'replace'

      replace = POST/replace existing with this payload append = PUT/add or edit without removing existing

    • options: RequestOptions = {}

      additional upload + request options

    Returns Promise<void>

  • Upload a profile image for a given user. Only account admins can upload user profile image.

    Parameters

    Returns Promise<void>

  • Upload a video, and returns the resulting video ID

    Parameters

    • file: FileUploadType

      A File/Blob. if using nodejs you can also pass in the path to a file

    • metadata: UploadMetadata = ...

      metadata to add to video (title, etc.) - see API docs

    • options: VideoOptions = {}

      Additional RequestInit options, as well as customizing the contentType/contentLength/filename of the file in the POST upload form (only needed if they can't be inferred from input)

    Returns Promise<string>

    the resulting video id

    const rev = new RevClient(...config...);
    await rev.connect();

    // if browser - pass in File
    const file = fileInputElement.files[0];
    // if nodejs - can pass in path to file instead
    // const file = "/path/to/local/video.mp4";
    // upload returns resulting ID when complete
    const videoId = await rev.upload.video(file, {
    uploader: 'username.of.uploader',
    title: 'video uploaded via the API',
    //categories: [EXISTING_REV_CATEGORY_NAME],
    unlisted: true,
    isActive: true
    /// ...any additional metadata
    });