VideoBlock
Defined in: src/types/media.ts:330
Video content block.
Implements
Section titled “Implements”VideoBlockDataJSONSerializable<{video:Serialized<VideoBlockData>; }>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new VideoBlock(data): VideoBlock;Defined in: src/types/media.ts:346
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | VideoBlockData |
Returns
Section titled “Returns”VideoBlock
Properties
Section titled “Properties”readonly type: "videoBlock";Defined in: src/types/media.ts:334
Discriminator for video content.
format
Section titled “format”readonly format: VideoFormat;Defined in: src/types/media.ts:339
Video format.
Implementation of
Section titled “Implementation of”source
Section titled “source”readonly source: VideoSource;Defined in: src/types/media.ts:344
Video source.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”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.
Returns
Section titled “Returns”{ video: { format: VideoFormat; source: | { bytes: string; } | { s3Location: { uri: string; bucketOwner?: string; }; }; };}| Name | Type | Description | Defined in |
|---|---|---|---|
video | { format: VideoFormat; source: | { bytes: string; } | { s3Location: { uri: string; bucketOwner?: string; }; }; } | - | src/types/media.ts:369 |
video.format | VideoFormat | Video format. | src/types/media.ts:319 |
video.source | | { bytes: string; } | { s3Location: { uri: string; bucketOwner?: string; }; } | Video source. | src/types/media.ts:324 |
Implementation of
Section titled “Implementation of”JSONSerializable.toJSONfromJSON()
Section titled “fromJSON()”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
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.format | VideoFormat | Video format. |
data.video.source | | { bytes: string | Uint8Array<ArrayBufferLike>; } | { s3Location: { uri: string; bucketOwner?: string; }; } | Video source. |
Returns
Section titled “Returns”VideoBlock
VideoBlock instance