Skip to content

Commit

Permalink
feat(client-kinesis-video-webrtc-storage): Add JoinStorageSessionAsVi…
Browse files Browse the repository at this point in the history
…ewer API
  • Loading branch information
awstools committed Aug 5, 2024
1 parent 6da4252 commit 36c7cdd
Show file tree
Hide file tree
Showing 10 changed files with 342 additions and 21 deletions.
10 changes: 10 additions & 0 deletions clients/client-kinesis-video-webrtc-storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

AWS SDK for JavaScript KinesisVideoWebRTCStorage Client for Node.js, Browser and React Native.

<fullname>webrtc</fullname>

<p>
</p>

Expand Down Expand Up @@ -218,3 +220,11 @@ JoinStorageSession
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/kinesis-video-webrtc-storage/command/JoinStorageSessionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis-video-webrtc-storage/Interface/JoinStorageSessionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis-video-webrtc-storage/Interface/JoinStorageSessionCommandOutput/)

</details>
<details>
<summary>
JoinStorageSessionAsViewer
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/kinesis-video-webrtc-storage/command/JoinStorageSessionAsViewerCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis-video-webrtc-storage/Interface/JoinStorageSessionAsViewerCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-kinesis-video-webrtc-storage/Interface/JoinStorageSessionAsViewerCommandOutput/)

</details>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import {
JoinStorageSessionAsViewerCommand,
JoinStorageSessionAsViewerCommandInput,
JoinStorageSessionAsViewerCommandOutput,
} from "./commands/JoinStorageSessionAsViewerCommand";
import {
JoinStorageSessionCommand,
JoinStorageSessionCommandInput,
Expand All @@ -14,6 +19,7 @@ import {

const commands = {
JoinStorageSessionCommand,
JoinStorageSessionAsViewerCommand,
};

export interface KinesisVideoWebRTCStorage {
Expand All @@ -33,10 +39,28 @@ export interface KinesisVideoWebRTCStorage {
options: __HttpHandlerOptions,
cb: (err: any, data?: JoinStorageSessionCommandOutput) => void
): void;

/**
* @see {@link JoinStorageSessionAsViewerCommand}
*/
joinStorageSessionAsViewer(
args: JoinStorageSessionAsViewerCommandInput,
options?: __HttpHandlerOptions
): Promise<JoinStorageSessionAsViewerCommandOutput>;
joinStorageSessionAsViewer(
args: JoinStorageSessionAsViewerCommandInput,
cb: (err: any, data?: JoinStorageSessionAsViewerCommandOutput) => void
): void;
joinStorageSessionAsViewer(
args: JoinStorageSessionAsViewerCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: JoinStorageSessionAsViewerCommandOutput) => void
): void;
}

/**
* <p>
* <fullname>webrtc</fullname>
* <p>
* </p>
* @public
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ import {
HttpAuthSchemeResolvedConfig,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import {
JoinStorageSessionAsViewerCommandInput,
JoinStorageSessionAsViewerCommandOutput,
} from "./commands/JoinStorageSessionAsViewerCommand";
import { JoinStorageSessionCommandInput, JoinStorageSessionCommandOutput } from "./commands/JoinStorageSessionCommand";
import {
ClientInputEndpointParameters,
Expand All @@ -68,12 +72,12 @@ export { __Client };
/**
* @public
*/
export type ServiceInputTypes = JoinStorageSessionCommandInput;
export type ServiceInputTypes = JoinStorageSessionAsViewerCommandInput | JoinStorageSessionCommandInput;

/**
* @public
*/
export type ServiceOutputTypes = JoinStorageSessionCommandOutput;
export type ServiceOutputTypes = JoinStorageSessionAsViewerCommandOutput | JoinStorageSessionCommandOutput;

/**
* @public
Expand Down Expand Up @@ -248,7 +252,8 @@ export interface KinesisVideoWebRTCStorageClientResolvedConfig
extends KinesisVideoWebRTCStorageClientResolvedConfigType {}

/**
* <p>
* <fullname>webrtc</fullname>
* <p>
* </p>
* @public
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import {
KinesisVideoWebRTCStorageClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../KinesisVideoWebRTCStorageClient";
import { JoinStorageSessionAsViewerInput } from "../models/models_0";
import { de_JoinStorageSessionAsViewerCommand, se_JoinStorageSessionAsViewerCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link JoinStorageSessionAsViewerCommand}.
*/
export interface JoinStorageSessionAsViewerCommandInput extends JoinStorageSessionAsViewerInput {}
/**
* @public
*
* The output of {@link JoinStorageSessionAsViewerCommand}.
*/
export interface JoinStorageSessionAsViewerCommandOutput extends __MetadataBearer {}

/**
* <p>
* Join the ongoing one way-video and/or multi-way audio WebRTC session as
* a viewer for an input channel. If there’s
* no existing session for the channel, create a new streaming session and provide
* the Amazon Resource Name (ARN) of the signaling channel (<code>channelArn</code>)
* and client id (<code>clientId</code>).
* </p>
* <p>Currently for <code>SINGLE_MASTER</code> type, a video producing device
* is able to ingest both audio and video media into a stream, while viewers
* can only ingest audio. Both a video producing device and viewers can join
* a session first and wait for other participants. While participants are having peer to peer conversations through WebRTC,
* the ingested media session will be stored into the Kinesis Video Stream.
* Multiple viewers are able to playback real-time media.
* </p>
* <p>Customers can also use existing Kinesis Video Streams features like
* <code>HLS</code> or <code>DASH</code> playback, Image generation, and more
* with ingested WebRTC media. If there’s an existing session with the same
* <code>clientId</code> that's found in the join session request, the new request takes precedence.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { KinesisVideoWebRTCStorageClient, JoinStorageSessionAsViewerCommand } from "@aws-sdk/client-kinesis-video-webrtc-storage"; // ES Modules import
* // const { KinesisVideoWebRTCStorageClient, JoinStorageSessionAsViewerCommand } = require("@aws-sdk/client-kinesis-video-webrtc-storage"); // CommonJS import
* const client = new KinesisVideoWebRTCStorageClient(config);
* const input = { // JoinStorageSessionAsViewerInput
* channelArn: "STRING_VALUE", // required
* clientId: "STRING_VALUE", // required
* };
* const command = new JoinStorageSessionAsViewerCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param JoinStorageSessionAsViewerCommandInput - {@link JoinStorageSessionAsViewerCommandInput}
* @returns {@link JoinStorageSessionAsViewerCommandOutput}
* @see {@link JoinStorageSessionAsViewerCommandInput} for command's `input` shape.
* @see {@link JoinStorageSessionAsViewerCommandOutput} for command's `response` shape.
* @see {@link KinesisVideoWebRTCStorageClientResolvedConfig | config} for KinesisVideoWebRTCStorageClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>You do not have required permissions to perform this operation.</p>
*
* @throws {@link ClientLimitExceededException} (client fault)
* <p>
* Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later.
* </p>
*
* @throws {@link InvalidArgumentException} (client fault)
* <p>The value for this input parameter is invalid.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource is not found.</p>
*
* @throws {@link KinesisVideoWebRTCStorageServiceException}
* <p>Base exception class for all service exceptions from KinesisVideoWebRTCStorage service.</p>
*
* @public
*/
export class JoinStorageSessionAsViewerCommand extends $Command
.classBuilder<
JoinStorageSessionAsViewerCommandInput,
JoinStorageSessionAsViewerCommandOutput,
KinesisVideoWebRTCStorageClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: KinesisVideoWebRTCStorageClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AWSAcuityRoutingServiceLambda", "JoinStorageSessionAsViewer", {})
.n("KinesisVideoWebRTCStorageClient", "JoinStorageSessionAsViewerCommand")
.f(void 0, void 0)
.ser(se_JoinStorageSessionAsViewerCommand)
.de(de_JoinStorageSessionAsViewerCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,61 @@ export interface JoinStorageSessionCommandInput extends JoinStorageSessionInput
export interface JoinStorageSessionCommandOutput extends __MetadataBearer {}

/**
* <p>
* Join the ongoing one way-video and/or multi-way audio WebRTC session as
* a video producing device for an input channel. If there’s no existing
* session for the channel, a new streaming session needs to be created, and the
* Amazon Resource Name (ARN) of the signaling channel must be provided.
* </p>
* <note>
* <p>Before using this API, you must call the <code>GetSignalingChannelEndpoint</code> API to request the WEBRTC endpoint. You then specify the endpoint and region in your <code>JoinStorageSession</code> API request.</p>
* </note>
* <p>Join the ongoing one way-video and/or multi-way audio WebRTC session as a video producing
* device for an input channel. If there’s no existing session for the channel, a new streaming
* session needs to be created, and the Amazon Resource Name (ARN) of the signaling channel must
* be provided. </p>
* <p>Currently for the <code>SINGLE_MASTER</code> type, a video producing
* device is able to ingest both audio and video media into a stream,
* while viewers can only ingest audio. Both a video producing device
* and viewers can join the session first, and wait for other participants.</p>
* <p>While participants are having peer to peer conversations through webRTC,
* the ingested media session will be stored into the Kinesis Video Stream.
* Multiple viewers are able to playback real-time media.</p>
* <p>Customers can also use existing Kinesis Video Streams features like
* <code>HLS</code> or <code>DASH</code> playback, Image generation, and more
* device is able to ingest both audio and video media into a stream. Only video producing devices can join the session and record media.</p>
* <important>
* <p>Both audio and video tracks are currently required for WebRTC ingestion.</p>
* <p>Current requirements:</p>
* <ul>
* <li>
* <p>Video track: H.264</p>
* </li>
* <li>
* <p>Audio track: Opus</p>
* </li>
* </ul>
* </important>
* <p>The resulting ingested video in the Kinesis video stream will have the following
* parameters: H.264 video and AAC audio.</p>
* <p>Once a master participant has negotiated a connection through WebRTC, the ingested media
* session will be stored in the Kinesis video stream. Multiple viewers are then able to play
* back real-time media through our Playback APIs.</p>
* <p>You can also use existing Kinesis Video Streams features like <code>HLS</code> or
* <code>DASH</code> playback, image generation via <a href="https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/gs-getImages.html">GetImages</a>, and more
* with ingested WebRTC media.</p>
* <note>
* <p>S3 image delivery and notifications are not currently supported.</p>
* </note>
* <note>
* <p>Assume that only one video producing device client
* can be associated with a session for the channel. If more than one
* client joins the session of a specific channel as a video producing device,
* the most recent client request takes precedence. </p>
* </note>
* <p>
* <b>Additional information</b>
* </p>
* <ul>
* <li>
* <p>
* <b>Idempotent</b> - This API is not idempotent.</p>
* </li>
* <li>
* <p>
* <b>Retry behavior</b> - This is counted as a new API call.</p>
* </li>
* <li>
* <p>
* <b>Concurrent calls</b> - Concurrent calls are allowed. An offer is sent once per each call.</p>
* </li>
* </ul>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./JoinStorageSessionAsViewerCommand";
// smithy-typescript generated code
export * from "./JoinStorageSessionCommand";
3 changes: 2 additions & 1 deletion clients/client-kinesis-video-webrtc-storage/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// smithy-typescript generated code
/* eslint-disable */
/**
* <p>
* <fullname>webrtc</fullname>
* <p>
* </p>
*
* @packageDocumentation
Expand Down
21 changes: 21 additions & 0 deletions clients/client-kinesis-video-webrtc-storage/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,24 @@ export class ResourceNotFoundException extends __BaseException {
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
}
}

/**
* @public
*/
export interface JoinStorageSessionAsViewerInput {
/**
* <p>
* The Amazon Resource Name (ARN) of the signaling channel.
* </p>
* @public
*/
channelArn: string | undefined;

/**
* <p>
* The unique identifier for the sender client.
* </p>
* @public
*/
clientId: string | undefined;
}
Loading

0 comments on commit 36c7cdd

Please sign in to comment.