-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1079133
commit 0ece6d9
Showing
15 changed files
with
254 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,125 @@ | ||
> [!IMPORTANT] | ||
> Waterbus is an open source video conferencing app built on latest WebRTC SDK. Currently, Waterbus is an early release that is subject to the following limitations: it may have limited support, changes may not be compatible with other pre-general availability versions, and availability may change without notice. | ||
## Flutter [Waterbus](https://docs.waterbus.tech) SDK | ||
|
||
# Flutter [Waterbus](https://docs.waterbus.tech) SDK | ||
Flutter plugin of [Waterbus](https://docs.waterbus.tech). Build video call or online meeting application with SFU model. Supports iOS, Android. [ExampleApp](https://github.com/waterbustech/waterbus) | ||
|
||
<img src="/.github/waterbus-sdk-banner.png" width="100%"/> | ||
<img src="./.github/waterbus-sdk-banner.png" width="100%"/> | ||
|
||
Flutter plugin of [Waterbus](https://docs.waterbus.tech). Build video call or online meeting application with SFU model. Supports iOS, Android. [ExampleApp](https://github.com/lambiengcode/waterbus) | ||
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-green.svg"/></a> | ||
<img src="https://img.shields.io/github/issues/waterbustech/waterbus-flutter-sdk" alt="GitHub issues"><a href="https://chromium.googlesource.com/external/webrtc/+/branch-heads/6099"><img src="https://img.shields.io/badge/libwebrtc-122.6261.01-yellow.svg" alt="libwebrtc"></a><img src="https://img.shields.io/cocoapods/v/KaiRTC" alt="Cocoapods Version"><a href="https://github.com/lambiengcode"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat&logo=github" alt="PRs Welcome"></a> | ||
|
||
## Codec supported | ||
| Codec | VP8 | VP9 | H264 | H265 | AV1 | | ||
| :-----: | :---------------: | :------------: | :------------: | :----------------: | :--------------------------------: | | ||
| iOS | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | | ||
| Android | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | | ||
## ⚡ Current supported features | ||
|
||
## Features | ||
| Feature | Subscribe/Publish | Screen Sharing | Picture in Picture | Virtual Background | Beauty Filters | End to End Encryption | | ||
| ------------------ | ----------------- | -------------- | ------------------ | ------------------ | -------------- | --------------------- | | ||
| Android | 🟢 | 🟢 | 🟢 | 🟢 | 🟡 | 🟢 | | ||
| iOS | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | 🟢 | | ||
| MacOS | 🟢 | 🟢 | 🔴 | 🟢 | 🟢 | 🟢 | | ||
| Web | 🟢 | 🟢 | 🟢 | 🟢 | 🟡 | 🟢 | | ||
|
||
- Join room | ||
|
||
🟢 = Available | ||
|
||
🟡 = Coming soon (Work in progress) | ||
|
||
🔴 = Not currently available (Possibly in the future) | ||
|
||
## Installation | ||
|
||
### Add dependency | ||
|
||
Add the dependency from command-line | ||
|
||
```bash | ||
$ flutter pub add waterbus_sdk | ||
``` | ||
|
||
The command above will add this to the `pubspec.yaml` file in your project (you can do this manually): | ||
```yaml | ||
dependencies: | ||
waterbus_sdk: ^1.3.13 | ||
``` | ||
## Usage | ||
### Initialize | ||
Firstly, call `WaterbusSdk.instance.initial` to set your server url and sdk connect WebSocket. | ||
|
||
```dart | ||
await WaterbusSdk.instance.joinRoom( | ||
roomId: roomCode, | ||
participantId: participantId, | ||
onNewEvent: (event) { | ||
switch (event.event) { | ||
case CallbackEvents.shouldBeUpdateState: | ||
// rebuild your ui | ||
break; | ||
case CallbackEvents.newParticipant: | ||
final String? participantId = event.participantId; | ||
if (participantId == null) return; | ||
// add new participant to your ui | ||
break; | ||
case CallbackEvents.participantHasLeft: | ||
final String? participantId = event.participantId; | ||
if (participantId == null) return; | ||
// remove participant to your ui | ||
break; | ||
default: | ||
break; | ||
} | ||
}, | ||
); | ||
await WaterbusSdk.instance.initial( | ||
waterbusUrl: ApiEndpoints.wsUrl, | ||
apiWaterbusUrl: ApiEndpoints.baseUrl, | ||
recordBenchmarkPath: '', | ||
); | ||
``` | ||
|
||
- Leave room | ||
### Create room | ||
|
||
```dart | ||
await WaterbusSdk.instance.leaveRoom(); | ||
final Meeting? meeting = await WaterbusSdk.instance.createRoom( | ||
meeting: Meeting(title: 'Meeting with Kai Dao'), | ||
password: 'password', | ||
userId: 1, // <- modify to your user id | ||
); | ||
``` | ||
|
||
- Prepare Media (will prepare the camera and microphone for you to turn on and off before entering the meeting) | ||
### Update room | ||
|
||
```dart | ||
await WaterbusSdk.instance.prepareMedia(); | ||
final Meeting? meeting = await WaterbusSdk.instance.updateRoom( | ||
meeting: Meeting(title: 'Meeting with Kai Dao - 2'), | ||
password: 'new-password', | ||
userId: 1, // <- modify to your user id | ||
); | ||
``` | ||
|
||
## Getting started | ||
### Join room | ||
|
||
- Include this package to your pubspec.yaml | ||
```dart | ||
final Meeting? meeting = await WaterbusSdk.instance.joinRoom( | ||
meeting: _currentMeeting, | ||
password: 'room-password-here', | ||
userId: 1, // <- modify to your user id | ||
); | ||
``` | ||
|
||
```yaml | ||
waterbus_sdk: | ||
git: | ||
url: https://github.com/waterbustech/waterbus-flutter-sdk.git | ||
path: '.' | ||
ref: 0.0.1 | ||
### Set callback room events | ||
|
||
```dart | ||
void _onEventChanged(CallbackPayload event) { | ||
switch (event.event) { | ||
case CallbackEvents.shouldBeUpdateState: | ||
break; | ||
case CallbackEvents.newParticipant: | ||
break; | ||
case CallbackEvents.participantHasLeft: | ||
break; | ||
case CallbackEvents.meetingEnded: | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
``` | ||
|
||
```dart | ||
WaterbusSdk.instance.onEventChangedRegister = _onEventChanged; | ||
``` | ||
|
||
### Leave room | ||
|
||
```dart | ||
await WaterbusSdk.instance.leaveRoom(); | ||
``` | ||
|
||
#### Prepare Media (will prepare the camera and microphone for you to turn on and off before entering the meeting) | ||
|
||
```dart | ||
await WaterbusSdk.instance.prepareMedia(); | ||
``` | ||
|
||
## Configuration | ||
|
||
### Android | ||
|
||
Ensure the following permission is present in your Android Manifest file, located in `<project root>/android/app/src/main/AndroidManifest.xml`: | ||
|
@@ -139,9 +190,11 @@ Contributions are welcome! Please feel free to submit a pull request or open an | |
|
||
## Contact Information | ||
|
||
If you have any questions or suggestions related to this application, please contact me via email: [email protected] or [email protected]. | ||
If you have any questions or suggestions related to this application, please contact me via email: [email protected]. | ||
|
||
## Reference | ||
|
||
## Reference: [flutter_webrtc](https://github.com/flutter-webrtc/flutter-webrtc) | ||
- [flutter_webrtc](https://github.com/flutter-webrtc/flutter-webrtc) | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.