awslabs / amazon-kinesis-video-streams-webrtc-sdk-js

JS SDK for interfacing with the Amazon Kinesis Video Streams Signaling Service.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html
Apache License 2.0
285 stars 140 forks source link

How to export example folder? #316

Closed overheat closed 1 month ago

overheat commented 1 month ago

A newbie to js.

How to export example folder to another place? I tried those:

  1. cp -r
  2. npm run release

Both of them got error, after I click on start viewer button.

[ERROR] [VIEWER] Encountered error starting: @file:///Users/myname/repos/amazon-kinesis-video-streams/webrtc/js/examples/viewer.js:408:36
overheat commented 1 month ago

I found this in package.json

"copy-examples-to-dist": "cp -r examples dist",

Looks npm run release just cp -r in the last step.

sirknightj commented 1 month ago

Glad you were able to figure it out!

Running npm run release will create the following files in the dist/ folder.

kvs-webrtc.js
kvs-webrtc.min.js

The sample webpage in the examples/ directory requires kvs-webrtc.js one directory above. You can adjust the path if needed.

https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-js/blob/de209884fcd388c3fea4937a5b99354ef9519af3/examples/index.html#L412

overheat commented 1 month ago

Thanks!