Skip to content

VideoBlock

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

Video content block.

new VideoBlock(data): VideoBlock;

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

ParameterType
dataVideoBlockData

VideoBlock

readonly type: "videoBlock";

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

Discriminator for video content.


readonly format: VideoFormat;

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

Video format.

VideoBlockData.format


readonly source: VideoSource;

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

Video source.

VideoBlockData.source

toJSON(): {
video: {
format: VideoFormat;
source: | {
bytes: string;
}
| {
s3Location: {
uri: string;
bucketOwner?: string;
};
};
};
};

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

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;
}
| {
s3Location: {
uri: string;
bucketOwner?: string;
};
};
};
}
NameTypeDescriptionDefined in
video{ format: VideoFormat; source: | { bytes: string; } | { s3Location: { uri: string; bucketOwner?: string; }; }; }-src/types/media.ts:369
video.formatVideoFormatVideo format.src/types/media.ts:319
video.source| { bytes: string; } | { s3Location: { uri: string; bucketOwner?: string; }; }Video source.src/types/media.ts:324
JSONSerializable.toJSON

static fromJSON(data): VideoBlock;

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

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>; } | { s3Location: { uri: string; bucketOwner?: string; }; }; }; }Wrapped VideoBlockData to deserialize (accepts both string and Uint8Array for bytes)
data.video{ format: VideoFormat; source: | { bytes: string | Uint8Array<ArrayBufferLike>; } | { s3Location: { uri: string; bucketOwner?: string; }; }; }-
data.video.formatVideoFormatVideo format.
data.video.source| { bytes: string | Uint8Array<ArrayBufferLike>; } | { s3Location: { uri: string; bucketOwner?: string; }; }Video source.

VideoBlock

VideoBlock instance