Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonbengtsson/simple_peer_flutter
Simple WebRTC for flutter (similar to the simple-peer project)
https://github.com/simonbengtsson/simple_peer_flutter
Last synced: 6 days ago
JSON representation
Simple WebRTC for flutter (similar to the simple-peer project)
- Host: GitHub
- URL: https://github.com/simonbengtsson/simple_peer_flutter
- Owner: simonbengtsson
- License: bsd-3-clause
- Created: 2022-08-06T19:25:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T17:39:49.000Z (7 months ago)
- Last Synced: 2024-08-01T12:18:50.180Z (3 months ago)
- Language: Dart
- Size: 152 KB
- Stars: 15
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Simple WebRTC. Wraps [flutter_webrtc](https://github.com/flutter-webrtc/flutter-webrtc) similar to [simple-peer](https://github.com/feross/simple-peer)
## Getting started
Read more about how to get started with webrtc in [flutter_webrtc](https://github.com/flutter-webrtc/flutter-webrtc) or the javascript [simple-peer](https://github.com/feross/simple-peer)
## Currently unsupported features (contributions welcome!)
- Media channels (only data channels supported right now)
- Batching of large data ie such as sending files byte by byte (needs to be handled in calling application right now)## Usage
```dart
var peer1 = Peer(initiator: true);
var peer2 = Peer();peer1.onSignal = (data) async {
// When peer1 has signaling data, give it to peer2 somehow
// https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling#the_signaling_server
await peer2.signal(data);
};peer2.onSignal = (data) async {
// When peer2 has signaling data, give it to peer1 somehow
// https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling#the_signaling_server
await peer1.signal(data);
};peer2.onData = (data) async {
print(data); // hello!
};peer2.connect();
await peer1.connect();await peer1.send('hello!');
```## Example
Run the example/main.dart application and check that connection worked in console.
## Release guide (for contributors)
- Test by opening example and check logs that it works
- Update CHANGELOG.md + pubspec.yml version
- git tag vX.X.X and git push --tags
- Run `flutter pub publish` and create Github release https://github.com/simonbengtsson/simple_peer_flutter/releases/new