Skip to content

Commit 36c7cdd

Browse files
author
awstools
committedAug 5, 2024
feat(client-kinesis-video-webrtc-storage): Add JoinStorageSessionAsViewer API
1 parent 6da4252 commit 36c7cdd

File tree

10 files changed

+342
-21
lines changed

10 files changed

+342
-21
lines changed
 

‎clients/client-kinesis-video-webrtc-storage/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

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

9+
<fullname>webrtc</fullname>
10+
911
<p>
1012
</p>
1113

@@ -218,3 +220,11 @@ JoinStorageSession
218220
[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/)
219221

220222
</details>
223+
<details>
224+
<summary>
225+
JoinStorageSessionAsViewer
226+
</summary>
227+
228+
[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/)
229+
230+
</details>

‎clients/client-kinesis-video-webrtc-storage/src/KinesisVideoWebRTCStorage.ts

+25-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import { createAggregatedClient } from "@smithy/smithy-client";
33
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
44

5+
import {
6+
JoinStorageSessionAsViewerCommand,
7+
JoinStorageSessionAsViewerCommandInput,
8+
JoinStorageSessionAsViewerCommandOutput,
9+
} from "./commands/JoinStorageSessionAsViewerCommand";
510
import {
611
JoinStorageSessionCommand,
712
JoinStorageSessionCommandInput,
@@ -14,6 +19,7 @@ import {
1419

1520
const commands = {
1621
JoinStorageSessionCommand,
22+
JoinStorageSessionAsViewerCommand,
1723
};
1824

1925
export interface KinesisVideoWebRTCStorage {
@@ -33,10 +39,28 @@ export interface KinesisVideoWebRTCStorage {
3339
options: __HttpHandlerOptions,
3440
cb: (err: any, data?: JoinStorageSessionCommandOutput) => void
3541
): void;
42+
43+
/**
44+
* @see {@link JoinStorageSessionAsViewerCommand}
45+
*/
46+
joinStorageSessionAsViewer(
47+
args: JoinStorageSessionAsViewerCommandInput,
48+
options?: __HttpHandlerOptions
49+
): Promise<JoinStorageSessionAsViewerCommandOutput>;
50+
joinStorageSessionAsViewer(
51+
args: JoinStorageSessionAsViewerCommandInput,
52+
cb: (err: any, data?: JoinStorageSessionAsViewerCommandOutput) => void
53+
): void;
54+
joinStorageSessionAsViewer(
55+
args: JoinStorageSessionAsViewerCommandInput,
56+
options: __HttpHandlerOptions,
57+
cb: (err: any, data?: JoinStorageSessionAsViewerCommandOutput) => void
58+
): void;
3659
}
3760

3861
/**
39-
* <p>
62+
* <fullname>webrtc</fullname>
63+
* <p>
4064
* </p>
4165
* @public
4266
*/

‎clients/client-kinesis-video-webrtc-storage/src/KinesisVideoWebRTCStorageClient.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ import {
5353
HttpAuthSchemeResolvedConfig,
5454
resolveHttpAuthSchemeConfig,
5555
} from "./auth/httpAuthSchemeProvider";
56+
import {
57+
JoinStorageSessionAsViewerCommandInput,
58+
JoinStorageSessionAsViewerCommandOutput,
59+
} from "./commands/JoinStorageSessionAsViewerCommand";
5660
import { JoinStorageSessionCommandInput, JoinStorageSessionCommandOutput } from "./commands/JoinStorageSessionCommand";
5761
import {
5862
ClientInputEndpointParameters,
@@ -68,12 +72,12 @@ export { __Client };
6872
/**
6973
* @public
7074
*/
71-
export type ServiceInputTypes = JoinStorageSessionCommandInput;
75+
export type ServiceInputTypes = JoinStorageSessionAsViewerCommandInput | JoinStorageSessionCommandInput;
7276

7377
/**
7478
* @public
7579
*/
76-
export type ServiceOutputTypes = JoinStorageSessionCommandOutput;
80+
export type ServiceOutputTypes = JoinStorageSessionAsViewerCommandOutput | JoinStorageSessionCommandOutput;
7781

7882
/**
7983
* @public
@@ -248,7 +252,8 @@ export interface KinesisVideoWebRTCStorageClientResolvedConfig
248252
extends KinesisVideoWebRTCStorageClientResolvedConfigType {}
249253

250254
/**
251-
* <p>
255+
* <fullname>webrtc</fullname>
256+
* <p>
252257
* </p>
253258
* @public
254259
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import {
9+
KinesisVideoWebRTCStorageClientResolvedConfig,
10+
ServiceInputTypes,
11+
ServiceOutputTypes,
12+
} from "../KinesisVideoWebRTCStorageClient";
13+
import { JoinStorageSessionAsViewerInput } from "../models/models_0";
14+
import { de_JoinStorageSessionAsViewerCommand, se_JoinStorageSessionAsViewerCommand } from "../protocols/Aws_restJson1";
15+
16+
/**
17+
* @public
18+
*/
19+
export type { __MetadataBearer };
20+
export { $Command };
21+
/**
22+
* @public
23+
*
24+
* The input for {@link JoinStorageSessionAsViewerCommand}.
25+
*/
26+
export interface JoinStorageSessionAsViewerCommandInput extends JoinStorageSessionAsViewerInput {}
27+
/**
28+
* @public
29+
*
30+
* The output of {@link JoinStorageSessionAsViewerCommand}.
31+
*/
32+
export interface JoinStorageSessionAsViewerCommandOutput extends __MetadataBearer {}
33+
34+
/**
35+
* <p>
36+
* Join the ongoing one way-video and/or multi-way audio WebRTC session as
37+
* a viewer for an input channel. If there’s
38+
* no existing session for the channel, create a new streaming session and provide
39+
* the Amazon Resource Name (ARN) of the signaling channel (<code>channelArn</code>)
40+
* and client id (<code>clientId</code>).
41+
* </p>
42+
* <p>Currently for <code>SINGLE_MASTER</code> type, a video producing device
43+
* is able to ingest both audio and video media into a stream, while viewers
44+
* can only ingest audio. Both a video producing device and viewers can join
45+
* a session first and wait for other participants. While participants are having peer to peer conversations through WebRTC,
46+
* the ingested media session will be stored into the Kinesis Video Stream.
47+
* Multiple viewers are able to playback real-time media.
48+
* </p>
49+
* <p>Customers can also use existing Kinesis Video Streams features like
50+
* <code>HLS</code> or <code>DASH</code> playback, Image generation, and more
51+
* with ingested WebRTC media. If there’s an existing session with the same
52+
* <code>clientId</code> that's found in the join session request, the new request takes precedence.</p>
53+
* @example
54+
* Use a bare-bones client and the command you need to make an API call.
55+
* ```javascript
56+
* import { KinesisVideoWebRTCStorageClient, JoinStorageSessionAsViewerCommand } from "@aws-sdk/client-kinesis-video-webrtc-storage"; // ES Modules import
57+
* // const { KinesisVideoWebRTCStorageClient, JoinStorageSessionAsViewerCommand } = require("@aws-sdk/client-kinesis-video-webrtc-storage"); // CommonJS import
58+
* const client = new KinesisVideoWebRTCStorageClient(config);
59+
* const input = { // JoinStorageSessionAsViewerInput
60+
* channelArn: "STRING_VALUE", // required
61+
* clientId: "STRING_VALUE", // required
62+
* };
63+
* const command = new JoinStorageSessionAsViewerCommand(input);
64+
* const response = await client.send(command);
65+
* // {};
66+
*
67+
* ```
68+
*
69+
* @param JoinStorageSessionAsViewerCommandInput - {@link JoinStorageSessionAsViewerCommandInput}
70+
* @returns {@link JoinStorageSessionAsViewerCommandOutput}
71+
* @see {@link JoinStorageSessionAsViewerCommandInput} for command's `input` shape.
72+
* @see {@link JoinStorageSessionAsViewerCommandOutput} for command's `response` shape.
73+
* @see {@link KinesisVideoWebRTCStorageClientResolvedConfig | config} for KinesisVideoWebRTCStorageClient's `config` shape.
74+
*
75+
* @throws {@link AccessDeniedException} (client fault)
76+
* <p>You do not have required permissions to perform this operation.</p>
77+
*
78+
* @throws {@link ClientLimitExceededException} (client fault)
79+
* <p>
80+
* Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later.
81+
* </p>
82+
*
83+
* @throws {@link InvalidArgumentException} (client fault)
84+
* <p>The value for this input parameter is invalid.</p>
85+
*
86+
* @throws {@link ResourceNotFoundException} (client fault)
87+
* <p>The specified resource is not found.</p>
88+
*
89+
* @throws {@link KinesisVideoWebRTCStorageServiceException}
90+
* <p>Base exception class for all service exceptions from KinesisVideoWebRTCStorage service.</p>
91+
*
92+
* @public
93+
*/
94+
export class JoinStorageSessionAsViewerCommand extends $Command
95+
.classBuilder<
96+
JoinStorageSessionAsViewerCommandInput,
97+
JoinStorageSessionAsViewerCommandOutput,
98+
KinesisVideoWebRTCStorageClientResolvedConfig,
99+
ServiceInputTypes,
100+
ServiceOutputTypes
101+
>()
102+
.ep({
103+
...commonParams,
104+
})
105+
.m(function (this: any, Command: any, cs: any, config: KinesisVideoWebRTCStorageClientResolvedConfig, o: any) {
106+
return [
107+
getSerdePlugin(config, this.serialize, this.deserialize),
108+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
109+
];
110+
})
111+
.s("AWSAcuityRoutingServiceLambda", "JoinStorageSessionAsViewer", {})
112+
.n("KinesisVideoWebRTCStorageClient", "JoinStorageSessionAsViewerCommand")
113+
.f(void 0, void 0)
114+
.ser(se_JoinStorageSessionAsViewerCommand)
115+
.de(de_JoinStorageSessionAsViewerCommand)
116+
.build() {}

‎clients/client-kinesis-video-webrtc-storage/src/commands/JoinStorageSessionCommand.ts

+47-14
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,61 @@ export interface JoinStorageSessionCommandInput extends JoinStorageSessionInput
3232
export interface JoinStorageSessionCommandOutput extends __MetadataBearer {}
3333

3434
/**
35-
* <p>
36-
* Join the ongoing one way-video and/or multi-way audio WebRTC session as
37-
* a video producing device for an input channel. If there’s no existing
38-
* session for the channel, a new streaming session needs to be created, and the
39-
* Amazon Resource Name (ARN) of the signaling channel must be provided.
40-
* </p>
35+
* <note>
36+
* <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>
37+
* </note>
38+
* <p>Join the ongoing one way-video and/or multi-way audio WebRTC session as a video producing
39+
* device for an input channel. If there’s no existing session for the channel, a new streaming
40+
* session needs to be created, and the Amazon Resource Name (ARN) of the signaling channel must
41+
* be provided. </p>
4142
* <p>Currently for the <code>SINGLE_MASTER</code> type, a video producing
42-
* device is able to ingest both audio and video media into a stream,
43-
* while viewers can only ingest audio. Both a video producing device
44-
* and viewers can join the session first, and wait for other participants.</p>
45-
* <p>While participants are having peer to peer conversations through webRTC,
46-
* the ingested media session will be stored into the Kinesis Video Stream.
47-
* Multiple viewers are able to playback real-time media.</p>
48-
* <p>Customers can also use existing Kinesis Video Streams features like
49-
* <code>HLS</code> or <code>DASH</code> playback, Image generation, and more
43+
* 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>
44+
* <important>
45+
* <p>Both audio and video tracks are currently required for WebRTC ingestion.</p>
46+
* <p>Current requirements:</p>
47+
* <ul>
48+
* <li>
49+
* <p>Video track: H.264</p>
50+
* </li>
51+
* <li>
52+
* <p>Audio track: Opus</p>
53+
* </li>
54+
* </ul>
55+
* </important>
56+
* <p>The resulting ingested video in the Kinesis video stream will have the following
57+
* parameters: H.264 video and AAC audio.</p>
58+
* <p>Once a master participant has negotiated a connection through WebRTC, the ingested media
59+
* session will be stored in the Kinesis video stream. Multiple viewers are then able to play
60+
* back real-time media through our Playback APIs.</p>
61+
* <p>You can also use existing Kinesis Video Streams features like <code>HLS</code> or
62+
* <code>DASH</code> playback, image generation via <a href="https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/gs-getImages.html">GetImages</a>, and more
5063
* with ingested WebRTC media.</p>
5164
* <note>
65+
* <p>S3 image delivery and notifications are not currently supported.</p>
66+
* </note>
67+
* <note>
5268
* <p>Assume that only one video producing device client
5369
* can be associated with a session for the channel. If more than one
5470
* client joins the session of a specific channel as a video producing device,
5571
* the most recent client request takes precedence. </p>
5672
* </note>
73+
* <p>
74+
* <b>Additional information</b>
75+
* </p>
76+
* <ul>
77+
* <li>
78+
* <p>
79+
* <b>Idempotent</b> - This API is not idempotent.</p>
80+
* </li>
81+
* <li>
82+
* <p>
83+
* <b>Retry behavior</b> - This is counted as a new API call.</p>
84+
* </li>
85+
* <li>
86+
* <p>
87+
* <b>Concurrent calls</b> - Concurrent calls are allowed. An offer is sent once per each call.</p>
88+
* </li>
89+
* </ul>
5790
* @example
5891
* Use a bare-bones client and the command you need to make an API call.
5992
* ```javascript
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
export * from "./JoinStorageSessionAsViewerCommand";
12
// smithy-typescript generated code
23
export * from "./JoinStorageSessionCommand";

‎clients/client-kinesis-video-webrtc-storage/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// smithy-typescript generated code
22
/* eslint-disable */
33
/**
4-
* <p>
4+
* <fullname>webrtc</fullname>
5+
* <p>
56
* </p>
67
*
78
* @packageDocumentation

‎clients/client-kinesis-video-webrtc-storage/src/models/models_0.ts

+21
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,24 @@ export class ResourceNotFoundException extends __BaseException {
9797
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
9898
}
9999
}
100+
101+
/**
102+
* @public
103+
*/
104+
export interface JoinStorageSessionAsViewerInput {
105+
/**
106+
* <p>
107+
* The Amazon Resource Name (ARN) of the signaling channel.
108+
* </p>
109+
* @public
110+
*/
111+
channelArn: string | undefined;
112+
113+
/**
114+
* <p>
115+
* The unique identifier for the sender client.
116+
* </p>
117+
* @public
118+
*/
119+
clientId: string | undefined;
120+
}

0 commit comments

Comments
 (0)