-
Notifications
You must be signed in to change notification settings - Fork 157
Migrate the sample page to v3 #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| dist/ | ||
| node_modules/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Building the browser script version of AWS SDK for JS v3 | ||
|
|
||
| This module bundles the **AWS SDK v3** clients into a single JavaScript file that can be imported in a `<script>` tag, similar to how AWS SDK v2 worked. | ||
| * [Kinesis Video](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_Operations_Amazon_Kinesis_Video_Streams.html) client | ||
| * [Kinesis Video Signaling Channels](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_Operations_Amazon_Kinesis_Video_Signaling_Channels.html) client | ||
| * [Kinesis Video WebRTC Storage](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_Operations_Amazon_Kinesis_Video_WebRTC_Storage.html) client | ||
|
|
||
| ## **Installation** | ||
|
|
||
| Before building, ensure you have **Node.js** installed. | ||
|
|
||
| ### **1. Install Dependencies** | ||
| Run the following command in this directory: | ||
|
|
||
| ```sh | ||
| npm install | ||
| ``` | ||
|
|
||
| ### **2. Build the SDK** | ||
| Generate the bundled JavaScript file by running: | ||
|
|
||
| ```sh | ||
| npm run build | ||
| ``` | ||
|
|
||
| This creates the file: | ||
| ``` | ||
| dist/aws-sdk-VERSION-kvswebrtc.js | ||
| ``` | ||
|
|
||
| > [!NOTE] | ||
| > `VERSION` will be replaced with the bundled AWS SDK version. For example: 3.758.0 | ||
|
|
||
| ## **Usage in HTML** | ||
| Once built, include the script in your HTML file: | ||
|
|
||
| ```html | ||
| <script src="dist/aws-sdk-VERSION-kvswebrtc.js"></script> | ||
| ``` | ||
|
|
||
| After that, the `AWS` object is globally available, just like AWS SDK v2. | ||
|
|
||
| > [!NOTE] | ||
| > AWS SDK for JS v3 uses different syntax than v2. Refer to the [documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/kinesis-video/) for the syntax and usage. | ||
|
|
||
| ## **Updating the AWS SDK for JS v3 to the latest** | ||
|
|
||
| If you need to update the AWS SDK clients, modify `package.json` and run: | ||
|
|
||
| ```sh | ||
| npm update | ||
| ``` | ||
|
|
||
| Then, rebuild the bundle: | ||
|
|
||
| ```sh | ||
| npm run build | ||
| ``` | ||
|
|
||
| You can now move it to the `examples` to use it: | ||
| ```shell | ||
| mv ./dist/aws-sdk-*-kvswebrtc.js ../examples | ||
| ``` | ||
|
|
||
| > [!NOTE] | ||
| > You will also need to modify the `<script>` import in `examples/index.html` to pull the new file. | ||
|
|
||
| ## **Troubleshooting** | ||
| - If `npm run build` fails, try deleting `node_modules` and `package-lock.json`, then reinstall: | ||
| ```sh | ||
| rm -rf node_modules package-lock.json | ||
| npm install | ||
| ``` | ||
| - Ensure Webpack is installed by running: | ||
| ```sh | ||
| npx webpack -v | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import * as KinesisVideo from "@aws-sdk/client-kinesis-video"; | ||
| import * as KinesisVideoSignaling from "@aws-sdk/client-kinesis-video-signaling"; | ||
| import * as KinesisVideoWebRTCStorage from "@aws-sdk/client-kinesis-video-webrtc-storage"; | ||
|
|
||
| // Webpack configuration places these into window.AWS object | ||
| // Should be accessible: window.AWS.KinesisVideo.KinesisVideoClient(...) | ||
| export { | ||
| KinesisVideo, | ||
| KinesisVideoSignaling, | ||
| KinesisVideoWebRTCStorage | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.