Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinyoshiaki/webrtc4me
This is a webrtc wrapper library for browser and node.js. Implemented very easy signaling way. Support multi label datachannel and media stream.
https://github.com/shinyoshiaki/webrtc4me
filesharing p2p react signaling webrtc
Last synced: about 1 month ago
JSON representation
This is a webrtc wrapper library for browser and node.js. Implemented very easy signaling way. Support multi label datachannel and media stream.
- Host: GitHub
- URL: https://github.com/shinyoshiaki/webrtc4me
- Owner: shinyoshiaki
- Created: 2018-10-12T06:07:09.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-10T17:31:14.000Z (about 2 years ago)
- Last Synced: 2024-10-28T10:16:52.357Z (3 months ago)
- Topics: filesharing, p2p, react, signaling, webrtc
- Language: TypeScript
- Homepage:
- Size: 24.6 MB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# webrtc4me
# What is this?
This is a webrtc wrapper library for browser and node.js.
Implemented very easy signaling way.
Support multi label datachannel and media stream.# How to use?
look `src/tests/` `example/`
## vanilla ice
```typescript
const peerOffer = new WebRTC();
const peerAnswer = new WebRTC();peerOffer.makeOffer();
const offer = await peerOffer.onSignal.asPromise();
peerAnswer.setSdp(offer);
const answer = await peerAnswer.onSignal.asPromise();
peerOffer.setSdp(answer);await Promise.all([
peerOffer.onConnect.asPromise(),
peerAnswer.onConnect.asPromise()
]);
```## trickle ice
```typescript
const peerOffer = new WebRTC({ trickle: true });
const peerAnswer = new WebRTC({ trickle: true });
peerOffer.makeOffer();
peerOffer.onSignal.subscribe(sdp => {
peerAnswer.setSdp(sdp);
});
peerAnswer.onSignal.subscribe(sdp => {
peerOffer.setSdp(sdp);
});peerOffer.onConnect.once(() => {
});peerAnswer.onConnect.once(() => {
});
```# example