Skip to content

Commit

Permalink
feat(client-ivs-realtime): adds support for multiple new composition …
Browse files Browse the repository at this point in the history
…layout configuration options (grid, pip)
  • Loading branch information
awstools committed Mar 13, 2024
1 parent bf5a23e commit 376fe5a
Show file tree
Hide file tree
Showing 5 changed files with 465 additions and 0 deletions.
16 changes: 16 additions & 0 deletions clients/client-ivs-realtime/src/commands/GetCompositionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ export interface GetCompositionCommandOutput extends GetCompositionResponse, __M
* // layout: { // LayoutConfiguration
* // grid: { // GridConfiguration
* // featuredParticipantAttribute: "STRING_VALUE",
* // omitStoppedVideo: true || false,
* // videoAspectRatio: "AUTO" || "VIDEO" || "SQUARE" || "PORTRAIT",
* // videoFillMode: "FILL" || "COVER" || "CONTAIN",
* // gridGap: Number("int"),
* // },
* // pip: { // PipConfiguration
* // featuredParticipantAttribute: "STRING_VALUE",
* // omitStoppedVideo: true || false,
* // videoFillMode: "FILL" || "COVER" || "CONTAIN",
* // gridGap: Number("int"),
* // pipParticipantAttribute: "STRING_VALUE",
* // pipBehavior: "STATIC" || "DYNAMIC",
* // pipOffset: Number("int"),
* // pipPosition: "TOP_LEFT" || "TOP_RIGHT" || "BOTTOM_LEFT" || "BOTTOM_RIGHT",
* // pipWidth: Number("int"),
* // pipHeight: Number("int"),
* // },
* // },
* // destinations: [ // DestinationList // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ export interface StartCompositionCommandOutput extends StartCompositionResponse,
* layout: { // LayoutConfiguration
* grid: { // GridConfiguration
* featuredParticipantAttribute: "STRING_VALUE",
* omitStoppedVideo: true || false,
* videoAspectRatio: "AUTO" || "VIDEO" || "SQUARE" || "PORTRAIT",
* videoFillMode: "FILL" || "COVER" || "CONTAIN",
* gridGap: Number("int"),
* },
* pip: { // PipConfiguration
* featuredParticipantAttribute: "STRING_VALUE",
* omitStoppedVideo: true || false,
* videoFillMode: "FILL" || "COVER" || "CONTAIN",
* gridGap: Number("int"),
* pipParticipantAttribute: "STRING_VALUE",
* pipBehavior: "STATIC" || "DYNAMIC",
* pipOffset: Number("int"),
* pipPosition: "TOP_LEFT" || "TOP_RIGHT" || "BOTTOM_LEFT" || "BOTTOM_RIGHT",
* pipWidth: Number("int"),
* pipHeight: Number("int"),
* },
* },
* destinations: [ // DestinationConfigurationList // required
Expand Down Expand Up @@ -98,6 +114,22 @@ export interface StartCompositionCommandOutput extends StartCompositionResponse,
* // layout: { // LayoutConfiguration
* // grid: { // GridConfiguration
* // featuredParticipantAttribute: "STRING_VALUE",
* // omitStoppedVideo: true || false,
* // videoAspectRatio: "AUTO" || "VIDEO" || "SQUARE" || "PORTRAIT",
* // videoFillMode: "FILL" || "COVER" || "CONTAIN",
* // gridGap: Number("int"),
* // },
* // pip: { // PipConfiguration
* // featuredParticipantAttribute: "STRING_VALUE",
* // omitStoppedVideo: true || false,
* // videoFillMode: "FILL" || "COVER" || "CONTAIN",
* // gridGap: Number("int"),
* // pipParticipantAttribute: "STRING_VALUE",
* // pipBehavior: "STATIC" || "DYNAMIC",
* // pipOffset: Number("int"),
* // pipPosition: "TOP_LEFT" || "TOP_RIGHT" || "BOTTOM_LEFT" || "BOTTOM_RIGHT",
* // pipWidth: Number("int"),
* // pipHeight: Number("int"),
* // },
* // },
* // destinations: [ // DestinationList // required
Expand Down
171 changes: 171 additions & 0 deletions clients/client-ivs-realtime/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,37 @@ export interface Destination {
detail?: DestinationDetail;
}

/**
* @public
* @enum
*/
export const VideoAspectRatio = {
AUTO: "AUTO",
PORTRAIT: "PORTRAIT",
SQUARE: "SQUARE",
VIDEO: "VIDEO",
} as const;

/**
* @public
*/
export type VideoAspectRatio = (typeof VideoAspectRatio)[keyof typeof VideoAspectRatio];

/**
* @public
* @enum
*/
export const VideoFillMode = {
CONTAIN: "CONTAIN",
COVER: "COVER",
FILL: "FILL",
} as const;

/**
* @public
*/
export type VideoFillMode = (typeof VideoFillMode)[keyof typeof VideoFillMode];

/**
* @public
* <p>Configuration information specific to Grid layout, for server-side composition. See
Expand All @@ -911,6 +942,140 @@ export interface GridConfiguration {
* slot.</p>
*/
featuredParticipantAttribute?: string;

/**
* @public
* <p>Determines whether to omit participants with stopped video in the composition. Default: <code>false</code>.</p>
*/
omitStoppedVideo?: boolean;

/**
* @public
* <p>Sets the non-featured participant display mode. Default: <code>VIDEO</code>.</p>
*/
videoAspectRatio?: VideoAspectRatio;

/**
* @public
* <p>Defines how video fits within the participant tile. When not set,
* <code>videoFillMode</code> defaults to <code>COVER</code> fill mode for participants in the grid
* and to <code>CONTAIN</code> fill mode for featured participants.</p>
*/
videoFillMode?: VideoFillMode;

/**
* @public
* <p>Specifies the spacing between participant tiles in pixels. Default: <code>2</code>.</p>
*/
gridGap?: number;
}

/**
* @public
* @enum
*/
export const PipBehavior = {
DYNAMIC: "DYNAMIC",
STATIC: "STATIC",
} as const;

/**
* @public
*/
export type PipBehavior = (typeof PipBehavior)[keyof typeof PipBehavior];

/**
* @public
* @enum
*/
export const PipPosition = {
BOTTOM_LEFT: "BOTTOM_LEFT",
BOTTOM_RIGHT: "BOTTOM_RIGHT",
TOP_LEFT: "TOP_LEFT",
TOP_RIGHT: "TOP_RIGHT",
} as const;

/**
* @public
*/
export type PipPosition = (typeof PipPosition)[keyof typeof PipPosition];

/**
* @public
* <p>Configuration information specific to Picture-in-Picture (PiP) layout,
* for <a href="https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/server-side-composition.html">server-side composition</a>.
* </p>
*/
export interface PipConfiguration {
/**
* @public
* <p>This attribute name identifies the featured slot. A participant with this attribute set
* to <code>"true"</code> (as a string value) in <a>ParticipantTokenConfiguration</a> is placed in the featured
* slot.</p>
*/
featuredParticipantAttribute?: string;

/**
* @public
* <p>Determines whether to omit participants with stopped video in the composition. Default: <code>false</code>.</p>
*/
omitStoppedVideo?: boolean;

/**
* @public
* <p>Defines how video fits within the participant tile. Default: <code>COVER</code>.
* </p>
*/
videoFillMode?: VideoFillMode;

/**
* @public
* <p>Specifies the spacing between participant tiles in pixels. Default: <code>0</code>.</p>
*/
gridGap?: number;

/**
* @public
* <p>Identifies the PiP slot. A participant with this attribute set
* to <code>"true"</code> (as a string value) in <a>ParticipantTokenConfiguration</a>
* is placed in the PiP slot.</p>
*/
pipParticipantAttribute?: string;

/**
* @public
* <p>Defines PiP behavior when all participants have left. Default: <code>STATIC</code>.</p>
*/
pipBehavior?: PipBehavior;

/**
* @public
* <p>Sets the PiP window’s offset position in pixels from the closest edges determined by <code>PipPosition</code>.
* Default: <code>0</code>.</p>
*/
pipOffset?: number;

/**
* @public
* <p>Determines the corner position of the PiP window. Default: <code>BOTTOM_RIGHT</code>.</p>
*/
pipPosition?: PipPosition;

/**
* @public
* <p>Specifies the width of the PiP window in pixels. When this is not set explicitly,
* <code>pipWidth</code>’s value will be based on the size of the composition and the
* aspect ratio of the participant’s video.</p>
*/
pipWidth?: number;

/**
* @public
* <p>Specifies the height of the PiP window in pixels. When this is not set explicitly,
* <code>pipHeight</code>’s value will be based on the size of the composition and the
* aspect ratio of the participant’s video.</p>
*/
pipHeight?: number;
}

/**
Expand All @@ -923,6 +1088,12 @@ export interface LayoutConfiguration {
* <p>Configuration related to grid layout. Default: Grid layout.</p>
*/
grid?: GridConfiguration;

/**
* @public
* <p>Configuration related to PiP layout.</p>
*/
pip?: PipConfiguration;
}

/**
Expand Down
5 changes: 5 additions & 0 deletions clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ import {
ParticipantTokenCapability,
ParticipantTokenConfiguration,
PendingVerification,
PipConfiguration,
RecordingConfiguration,
ResourceNotFoundException,
S3DestinationConfiguration,
Expand Down Expand Up @@ -1489,6 +1490,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont

// se_ParticipantTokenConfigurations omitted.

// se_PipConfiguration omitted.

// se_RecordingConfiguration omitted.

// se_S3DestinationConfiguration omitted.
Expand Down Expand Up @@ -1733,6 +1736,8 @@ const de_ParticipantTokenList = (output: any, context: __SerdeContext): Particip
return retVal;
};

// de_PipConfiguration omitted.

// de_RecordingConfiguration omitted.

// de_S3DestinationConfiguration omitted.
Expand Down
Loading

0 comments on commit 376fe5a

Please sign in to comment.