Where this project coming from? Black Door Chat Project Introduction.
I have just implemented the minimum necessary interfaces for committing the controller's requirements - MVC.
This ChatService hides the complexity under webrtc-adapter/out/adapter.js
implementations. Also the signialling process, the offer and answer negotiation among others.
I personally believe those 265 lines of code could be reduced. As an example, I could move the signaling process into an other class.
However, I have decided to keep it as a single class for my own convenience.
- Install dependencies
yarn install
- Regenerate the distribution package (
dist
directory )yarn build
- Run minimal testing
yarn start
and navigate tolib/test/index
Particularly in this project I have included a minimal testing (lib/test/index.ts
) which runs when you execute yarn start
command. It is because the implementation of adapter.js
requires a live browser.
Just run yarn start
, navigate to lib/test/index
and open the console to see more details.
lib/test/index.ts
will give you an idea about the use of this ChatService
class. In fact, this test emulates a simple conversation between 2 peers sending a simple message.