Skip to content

Function: uploadReel() ​

ts
function uploadReel(
   client, 
   mp4, 
   coverJpeg, 
   options?
): Promise<{
[key: string]: unknown;
  caption?:   | {
   [key: string]: unknown;
     text?: string;
   }
     | null;
  code?: string;
  comment_count?: number | null;
  id?: string;
  image_versions2?: {
   [key: string]: unknown;
     candidates?: object[];
  };
  like_count?: number | null;
  media_type?: number;
  pk?: string;
  taken_at?: number;
  user?: {
   [key: string]: unknown;
     biography?: string;
     external_url?: string | null;
     follower_count?: number | null;
     following_count?: number | null;
     full_name?: string;
     is_private?: boolean;
     is_verified?: boolean;
     media_count?: number | null;
     pk?: string;
     profile_pic_url?: string | null;
     username?: string;
  };
  usertags?:   | {
   [key: string]: unknown;
     in?: object[];
   }
     | null;
  video_versions?: object[] | null;
}>;

Publishes an MP4 as a reel. The caller supplies the cover JPEG (frame extraction needs a decoder, which the SDK does not bundle). Duration and size are read from the MP4 unless given. The steps are the app's: the upload settings, the video, the cover, then the configure call, retried while the server is still transcoding.

Parameters ​

ParameterType
clientPrivateClient
mp4Uint8Array
coverJpegUint8Array
options?ReelUploadOptions

Returns ​

Promise<{ [key: string]: unknown; caption?: | { [key: string]: unknown; text?: string; } | null; code?: string; comment_count?: number | null; id?: string; image_versions2?: { [key: string]: unknown; candidates?: object[]; }; like_count?: number | null; media_type?: number; pk?: string; taken_at?: number; user?: { [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }; usertags?: | { [key: string]: unknown; in?: object[]; } | null; video_versions?: object[] | null; }>

MIT License. Not affiliated with, endorsed or sponsored by Meta or Instagram.