vcp-lite v1.0.0
Setup
probably some
npm install
Running
npm run watch
and then open the page (src/index.html) in your browser and manually refresh or
npm run server
and then go to localhost:8081/src/
look in the console log for the webrtc connection info and a live feed of the audio volume. You should get on another vcom client and talk to this one in order to give it some audio.
Testing
First, build the project with npm run build
or npm run watch
and set up the server with npm run server
Then go to localhost:8081/src/test/manual-testing/loginAndListen/
Then click the page to initialize the AudioContext
The app will log in to the demo server and start listening to a selector that should be playing audio
Development tools
- cspell
- biomejs
- quick-lint-js
- typescript
- webpack
Publishing
This project can be used inside VCOM_Web by publishing it to as a global variable named 'lite' This allows us to get automatic completions and type checking when using 'lite' within VCOM_Web.
Run npm run build
to create a file structure looking like this:
- dist
- bundle
- lib
- < more directories of .d.ts files >
- < more directories of .d.ts files >
- < more directories of .d.ts files >
- ...
- index.d.ts
- index.js
- lib
- bundle
copy everything inside the bundle directory to Assets/Scripts/lite/ in the VCOM_Web project.
At which point you should immediately see type completions for 'lite' in the source files of VCOM_Web.
Try typing lite.
and you should see a list of functions and properties available on the 'lite' object.
Note that VCOM_Web requires in its tsconfig.json multiple references to Assets/Scripts/lite/ including
specifically listing Assets/Scripts/lite/index.d.ts
and Assets/Scripts/lite/index.js
in the 'include' array as well as "Assets/Scripts/lite/" in "typeRoots".
There is an example project in src/test/example-project-using-vcp-lite-as-global/ that demonstrates this in action Navigate to localhost:8081/src/test/example-project-using-vcp-lite-as-global/ to see it in action
1 year ago