|
| 1 | +# Flutter-WebRTC |
| 2 | + |
| 3 | +[](https://opencollective.com/flutter-webrtc) [](https://pub.dartlang.org/packages/flutter_webrtc) [](https://gitter.im/flutter-webrtc/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://join.slack.com/t/flutterwebrtc/shared_invite/zt-q83o7y1s-FExGLWEvtkPKM8ku_F8cEQ) |
| 4 | + |
| 5 | +Flutter平台的WebRTC插件, 支持移动端/桌面/Web网页 |
| 6 | + |
| 7 | +</br> |
| 8 | +<p align="center"> |
| 9 | +<strong>Sponsored with 💖   by</strong><br /> |
| 10 | +<a href="https://getstream.io/chat/flutter/tutorial/?utm_source=https://github.com/flutter-webrtc/flutter-webrtc&utm_medium=github&utm_content=developer&utm_term=flutter" target="_blank"> |
| 11 | +<img src="https://stream-blog-v2.imgix.net/blog/wp-content/uploads/f7401112f41742c4e173c30d4f318cb8/stream_logo_white.png?w=350" alt="Stream Chat" style="margin: 8px" /> |
| 12 | +</a> |
| 13 | +<br /> |
| 14 | +Enterprise Grade APIs for Feeds & Chat. <a href="https://getstream.io/chat/flutter/tutorial/?utm_source=https://github.com/flutter-webrtc/flutter-webrtc&utm_medium=github&utm_content=developer&utm_term=flutter" target="_blank">Try the Flutter Chat tutorial</a> 💬 |
| 15 | +</p> |
| 16 | + |
| 17 | +</br> |
| 18 | + |
| 19 | +## 功能及完成度 |
| 20 | + |
| 21 | +| Feature | Android | iOS | [Web](https://flutter.dev/web) | macOS | Windows | Linux | [Fuchsia](https://fuchsia.googlesource.com/) | |
| 22 | +| :-------------: | :-------------:| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: | |
| 23 | +| Audio/Video | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | [WIP] | | |
| 24 | +| Data Channel | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | [WIP] | | |
| 25 | +| Screen Capture | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | | | |
| 26 | +| Unified-Plan | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | | |
| 27 | +| Simulcast | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | | |
| 28 | +| MediaRecorder| :warning: | :warning: | :heavy_check_mark: | | | | | |
| 29 | + |
| 30 | +## 使用方法 |
| 31 | + |
| 32 | +添加 `flutter_webrtc` 到您的 [pubspec.yaml 依赖](https://flutter.io/using-packages/). |
| 33 | + |
| 34 | +### iOS |
| 35 | + |
| 36 | +添加下面的权限标签到 _Info.plist_ 文件, 位于 `<project root>/ios/Runner/Info.plist`: |
| 37 | + |
| 38 | +```xml |
| 39 | +<key>NSCameraUsageDescription</key> |
| 40 | +<string>$(PRODUCT_NAME) Camera Usage!</string> |
| 41 | +<key>NSMicrophoneUsageDescription</key> |
| 42 | +<string>$(PRODUCT_NAME) Microphone Usage!</string> |
| 43 | +``` |
| 44 | + |
| 45 | +用于声明必要的硬件使用权限. |
| 46 | + |
| 47 | +### Android |
| 48 | + |
| 49 | +确认下列权限标签被添加到了您的 AndroidManifest.xml 文件, 位于 `<project root>/android/app/src/main/AndroidManifest.xml`: |
| 50 | + |
| 51 | +```xml |
| 52 | +<uses-feature android:name="android.hardware.camera" /> |
| 53 | +<uses-feature android:name="android.hardware.camera.autofocus" /> |
| 54 | +<uses-permission android:name="android.permission.CAMERA" /> |
| 55 | +<uses-permission android:name="android.permission.RECORD_AUDIO" /> |
| 56 | +<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| 57 | +<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> |
| 58 | +<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> |
| 59 | +``` |
| 60 | + |
| 61 | +假设您需要使用蓝牙设备接听WebRTC通话, 您还需要添加下面的标签: |
| 62 | + |
| 63 | +```xml |
| 64 | +<uses-permission android:name="android.permission.BLUETOOTH" /> |
| 65 | +<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> |
| 66 | +``` |
| 67 | + |
| 68 | +在您对Flutter App 生成模板中添加下列行, 或许它已经存在. |
| 69 | + |
| 70 | +您需要设置为 Java 8, 因为Google 官方 WebRTC jar 现在使用静态的 `EglBase` 接口. 请将下面对行添加到您的 `build.gradle`: |
| 71 | + |
| 72 | +```groovy |
| 73 | +android { |
| 74 | + //... |
| 75 | + compileOptions { |
| 76 | + sourceCompatibility JavaVersion.VERSION_1_8 |
| 77 | + targetCompatibility JavaVersion.VERSION_1_8 |
| 78 | + } |
| 79 | +} |
| 80 | +``` |
| 81 | + |
| 82 | +如果必要,请将 `build.gradle` 中 `defaultConfig` 配置下的 `minSdkVersion` 版本设置为 `21` (Flutter 自动生成的为 `16`). |
| 83 | + |
| 84 | +### 重要提醒 |
| 85 | + |
| 86 | +如果你在Android平台需要编译成Release版本的apk, 您需要使用此提交中的操作设置, |
| 87 | +[Proguard 规则](https://github.com/flutter-webrtc/flutter-webrtc/commit/d32dab13b5a0bed80dd9d0f98990f107b9b514f4) |
| 88 | + |
| 89 | +## 贡献 |
| 90 | + |
| 91 | +社区对持久发展离不开这些支持者. |
| 92 | + |
| 93 | +- [CloudWebRTC](https://github.com/cloudwebrtc) - 项目发起者 |
| 94 | +- [RainwayApp](https://github.com/rainwayapp) - 财务赞助 |
| 95 | +- [亢少军](https://github.com/kangshaojun) - 财务赞助 |
| 96 | +- [ION](https://github.com/pion/ion) - 财务赞助 |
| 97 | +- [reSipWebRTC](https://github.com/reSipWebRTC) - 财务赞助 |
| 98 | +- [沃德米科技](https://github.com/woodemi)-[36记手写板](https://www.36notes.com) - 财务赞助 |
| 99 | + |
| 100 | +### 例子 |
| 101 | + |
| 102 | +如果您需要完整的调用例子,请参考 [flutter-webrtc-demo](https://github.com/cloudwebrtc/flutter-webrtc-demo/). |
| 103 | + |
| 104 | +## 贡献者 |
| 105 | + |
| 106 | +### 代码贡献者 |
| 107 | + |
| 108 | +感谢下列所有人对项目贡献了代码. [[Contribute](CONTRIBUTING.md)]. |
| 109 | +<a href="https://github.com/cloudwebrtc/flutter-webrtc/graphs/contributors"><img src="https://opencollective.com/flutter-webrtc/contributors.svg?width=890&button=false" /></a> |
| 110 | + |
| 111 | +### 财务贡献者 |
| 112 | + |
| 113 | +成为财务贡献者,帮助flutter-webrtc社区持续发展. [[Contribute](https://opencollective.com/flutter-webrtc/contribute)] |
| 114 | + |
| 115 | +#### 来自个人的赞助 |
| 116 | + |
| 117 | +<a href="https://opencollective.com/flutter-webrtc"><img src="https://opencollective.com/flutter-webrtc/individuals.svg?width=890"></a> |
| 118 | + |
| 119 | +#### 来自组织的赞助 |
| 120 | + |
| 121 | +使用您的项目进行赞助. 您的logo及网站连接将会出现在此处. [[Contribute](https://opencollective.com/flutter-webrtc/contribute)] |
| 122 | + |
| 123 | +<a href="https://opencollective.com/flutter-webrtc/organization/0/website"><img src="https://opencollective.com/flutter-webrtc/organization/0/avatar.svg"></a> |
| 124 | +<a href="https://opencollective.com/flutter-webrtc/organization/1/website"><img src="https://opencollective.com/flutter-webrtc/organization/1/avatar.svg"></a> |
| 125 | +<a href="https://opencollective.com/flutter-webrtc/organization/2/website"><img src="https://opencollective.com/flutter-webrtc/organization/2/avatar.svg"></a> |
| 126 | +<a href="https://opencollective.com/flutter-webrtc/organization/3/website"><img src="https://opencollective.com/flutter-webrtc/organization/3/avatar.svg"></a> |
| 127 | +<a href="https://opencollective.com/flutter-webrtc/organization/4/website"><img src="https://opencollective.com/flutter-webrtc/organization/4/avatar.svg"></a> |
| 128 | +<a href="https://opencollective.com/flutter-webrtc/organization/5/website"><img src="https://opencollective.com/flutter-webrtc/organization/5/avatar.svg"></a> |
| 129 | +<a href="https://opencollective.com/flutter-webrtc/organization/6/website"><img src="https://opencollective.com/flutter-webrtc/organization/6/avatar.svg"></a> |
| 130 | +<a href="https://opencollective.com/flutter-webrtc/organization/7/website"><img src="https://opencollective.com/flutter-webrtc/organization/7/avatar.svg"></a> |
| 131 | +<a href="https://opencollective.com/flutter-webrtc/organization/8/website"><img src="https://opencollective.com/flutter-webrtc/organization/8/avatar.svg"></a> |
| 132 | +<a href="https://opencollective.com/flutter-webrtc/organization/9/website"><img src="https://opencollective.com/flutter-webrtc/organization/9/avatar.svg"></a> |
0 commit comments