Skip to content

VideoBlock

Defined in: src/types/media.ts:292

Video content block.

new VideoBlock(data): VideoBlock;

Defined in: src/types/media.ts:308

ParameterType
dataVideoBlockData

VideoBlock

readonly type: "videoBlock";

Defined in: src/types/media.ts:296

Discriminator for video content.


readonly format: VideoFormat;

Defined in: src/types/media.ts:301

Video format.

VideoBlockData.format


readonly source: VideoSource;

Defined in: src/types/media.ts:306

Video source.

VideoBlockData.source

toJSON(): {
video: {
format: VideoFormat;
source: | {
bytes: string;
}
| {
location: {
type: "s3";
uri: string;
bucketOwner?: string;
};
};
};
};

Defined in: src/types/media.ts:331

Serializes the VideoBlock to a JSON-compatible ContentBlockData object. Called automatically by JSON.stringify(). Uint8Array bytes are encoded as base64 string.

{
video: {
format: VideoFormat;
source: | {
bytes: string;
}
| {
location: {
type: "s3";
uri: string;
bucketOwner?: string;
};
};
};
}
NameTypeDescriptionDefined in
video{ format: VideoFormat; source: | { bytes: string; } | { location: { type: "s3"; uri: string; bucketOwner?: string; }; }; }-src/types/media.ts:331
video.formatVideoFormatVideo format.src/types/media.ts:281
video.source| { bytes: string; } | { location: { type: "s3"; uri: string; bucketOwner?: string; }; }Video source.src/types/media.ts:286
JSONSerializable.toJSON

static fromJSON(data): VideoBlock;

Defined in: src/types/media.ts:353

Creates a VideoBlock instance from its wrapped data format. Base64-encoded bytes are decoded back to Uint8Array.

ParameterTypeDescription
data{ video: { format: VideoFormat; source: | { bytes: string | Uint8Array<ArrayBufferLike>; } | { location: { type: "s3"; uri: string; bucketOwner?: string; }; }; }; }Wrapped VideoBlockData to deserialize (accepts both string and Uint8Array for bytes)
data.video{ format: VideoFormat; source: | { bytes: string | Uint8Array<ArrayBufferLike>; } | { location: { type: "s3"; uri: string; bucketOwner?: string; }; }; }-
data.video.formatVideoFormatVideo format.
data.video.source| { bytes: string | Uint8Array<ArrayBufferLike>; } | { location: { type: "s3"; uri: string; bucketOwner?: string; }; }Video source.

VideoBlock

VideoBlock instance