1
1
# Flutter-WebRTC
2
- [ ![ pub package] ( https://img.shields.io/pub/v/flutter_webrtc.svg )] ( https://pub.dartlang.org/packages/flutter_webrtc ) [ ![ Join the chat at https://gitter.im/flutter-webrtc/Lobby ] ( https://badges.gitter.im/flutter-webrtc/Lobby.svg )] ( https://gitter.im/flutter-webrtc/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content= badge )
2
+ [ ![ Financial Contributors on Open Collective ] ( https://opencollective.com/flutter-webrtc/all/badge.svg?label=financial+contributors )] ( https://opencollective.com/flutter-webrtc ) [ ![ pub package] ( https://img.shields.io/pub/v/flutter_webrtc.svg )] ( https://pub.dartlang.org/packages/flutter_webrtc ) [ ![ Gitter ] ( https://badges.gitter.im/flutter-webrtc/Lobby.svg )] ( https://gitter.im/flutter-webrtc/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge )
3
3
4
- Flutter WebRTC plugin for iOS/Android
4
+ WebRTC plugin for Flutter Mobile/Desktop/Web
5
+
6
+ ## Functionality
7
+ | Feature | Android | iOS | [ Web] ( https://flutter.dev/web ) | macOS | Windows | Linux | [ Fuchsia] ( https://fuchsia.googlesource.com/ ) |
8
+ | :-------------: | :-------------:| :-----: | :-----: | :-----: | :-----: | :-----: | :-----: |
9
+ | Audio/Video | :heavy_check_mark : | :heavy_check_mark : | :heavy_check_mark : | :heavy_check_mark : | [ WIP] | [ WIP] | |
10
+ | Data Channel | :heavy_check_mark : | :heavy_check_mark : | :heavy_check_mark : | :heavy_check_mark : | [ WIP] | [ WIP] | |
11
+ | Screen Capture | :heavy_check_mark : | :heavy_check_mark : | :heavy_check_mark : | | | | |
12
+ | Unified-Plan | | | | | | | |
13
+ | MediaRecorder| :warning : | :warning : | :heavy_check_mark : | | | | |
5
14
6
15
## Usage
7
16
Add ` flutter_webrtc ` as a [ dependency in your pubspec.yaml file] ( https://flutter.io/using-packages/ ) .
@@ -21,7 +30,7 @@ This entry allows your app to access camera and microphone.
21
30
22
31
### Android
23
32
24
- Ensure the following permission is present in your Android Manifest file, located in `<project root >/android/app/src/main/AndroidManifest.xml:
33
+ Ensure the following permission is present in your Android Manifest file, located in ` <project root>/android/app/src/main/AndroidManifest.xml ` :
25
34
26
35
``` xml
27
36
<uses-feature android : name =" android.hardware.camera" />
@@ -46,125 +55,40 @@ android {
46
55
}
47
56
```
48
57
49
- ## Functionality
50
- We intend to implement support the following features:
51
-
52
- - [X] Data Channel
53
- - [ ] Port to [ Flutter-Desktop-Embedding] ( https://github.com/google/flutter-desktop-embedding )
54
- - [X] Screen Capture (iOS/Android)
55
- - [ ] ORTC API
56
- - [ ] Support [ Fuchsia] ( https://fuchsia.googlesource.com/ )
57
- - [ ] MediaRecorder
58
- - [ ] Flutter Web
58
+ ## Contributing
59
+ The project is inseparable from the contributors of the community.
60
+ - [ CloudWebRTC] ( https://github.com/cloudwebrtc ) - Original Author
61
+ - [ RainwayApp] ( https://github.com/rainwayapp ) - Sponsor from Paypal
59
62
60
63
### Example
64
+ For more examples, please refer to [ flutter-webrtc-demo] ( https://github.com/cloudwebrtc/flutter-webrtc-demo/ ) .
61
65
62
- ``` dart
63
- import 'package:flutter/material.dart';
64
- import 'package:flutter_webrtc/webrtc.dart';
65
- import 'dart:core';
66
+ ## Contributors
66
67
67
- /**
68
- * getUserMedia sample
69
- */
70
- class GetUserMediaSample extends StatefulWidget {
71
- static String tag = 'get_usermedia_sample';
68
+ ### Code Contributors
72
69
73
- @override
74
- _GetUserMediaSampleState createState() => new _GetUserMediaSampleState();
75
- }
70
+ This project exists thanks to all the people who contribute. [[ Contribute] ( CONTRIBUTING.md )] .
71
+ <a href =" https://github.com/cloudwebrtc/flutter-webrtc/graphs/contributors " ><img src =" https://opencollective.com/flutter-webrtc/contributors.svg?width=890&button=false " /></a >
76
72
77
- class _GetUserMediaSampleState extends State<GetUserMediaSample> {
78
- MediaStream _localStream;
79
- final _localRenderer = new RTCVideoRenderer();
80
- bool _inCalling = false;
81
-
82
- @override
83
- initState() {
84
- super.initState();
85
- initRenderers();
86
- }
87
-
88
- @override
89
- deactivate() {
90
- super.deactivate();
91
- if (_inCalling) {
92
- _hangUp();
93
- }
94
- }
95
-
96
- initRenderers() async {
97
- await _localRenderer.initialize();
98
- }
99
-
100
- // Platform messages are asynchronous, so we initialize in an async method.
101
- _makeCall() async {
102
- final Map<String, dynamic> mediaConstraints = {
103
- "audio": true,
104
- "video": {
105
- "mandatory": {
106
- "minWidth":'640', // Provide your own width, height and frame rate here
107
- "minHeight": '480',
108
- "minFrameRate": '30',
109
- },
110
- "facingMode": "user",
111
- "optional": [],
112
- }
113
- };
114
-
115
- try {
116
- var stream = await navigator.getUserMedia(mediaConstraints);
117
- _localStream = stream;
118
- _localRenderer.srcObject = _localStream;
119
- } catch (e) {
120
- print(e.toString());
121
- }
122
- if (!mounted) return;
123
-
124
- setState(() {
125
- _inCalling = true;
126
- });
127
- }
128
-
129
- _hangUp() async {
130
- try {
131
- await _localStream.dispose();
132
- _localRenderer.srcObject = null;
133
- } catch (e) {
134
- print(e.toString());
135
- }
136
- setState(() {
137
- _inCalling = false;
138
- });
139
- }
140
-
141
- @override
142
- Widget build(BuildContext context) {
143
- return new Scaffold(
144
- appBar: new AppBar(
145
- title: new Text('GetUserMedia API Test'),
146
- ),
147
- body: new OrientationBuilder(
148
- builder: (context, orientation) {
149
- return new Center(
150
- child: new Container(
151
- margin: new EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
152
- width: MediaQuery.of(context).size.width,
153
- height: MediaQuery.of(context).size.height,
154
- child: RTCVideoView(_localRenderer),
155
- decoration: new BoxDecoration(color: Colors.black54),
156
- ),
157
- );
158
- },
159
- ),
160
- floatingActionButton: new FloatingActionButton(
161
- onPressed: _inCalling ? _hangUp : _makeCall,
162
- tooltip: _inCalling ? 'Hangup' : 'Call',
163
- child: new Icon(_inCalling ? Icons.call_end : Icons.phone),
164
- ),
165
- );
166
- }
167
- }
168
- ```
73
+ ### Financial Contributors
169
74
170
- For more examples, please refer to [ flutter-webrtc-demo] ( https://github.com/cloudwebrtc/flutter-webrtc-demo/ ) .
75
+ Become a financial contributor and help us sustain our community. [[ Contribute] ( https://opencollective.com/flutter-webrtc/contribute )]
76
+
77
+ #### Individuals
78
+
79
+ <a href =" https://opencollective.com/flutter-webrtc " ><img src =" https://opencollective.com/flutter-webrtc/individuals.svg?width=890 " ></a >
80
+
81
+ #### Organizations
82
+
83
+ Support this project with your organization. Your logo will show up here with a link to your website. [[ Contribute] ( https://opencollective.com/flutter-webrtc/contribute )]
84
+
85
+ <a href =" https://opencollective.com/flutter-webrtc/organization/0/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/0/avatar.svg " ></a >
86
+ <a href =" https://opencollective.com/flutter-webrtc/organization/1/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/1/avatar.svg " ></a >
87
+ <a href =" https://opencollective.com/flutter-webrtc/organization/2/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/2/avatar.svg " ></a >
88
+ <a href =" https://opencollective.com/flutter-webrtc/organization/3/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/3/avatar.svg " ></a >
89
+ <a href =" https://opencollective.com/flutter-webrtc/organization/4/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/4/avatar.svg " ></a >
90
+ <a href =" https://opencollective.com/flutter-webrtc/organization/5/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/5/avatar.svg " ></a >
91
+ <a href =" https://opencollective.com/flutter-webrtc/organization/6/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/6/avatar.svg " ></a >
92
+ <a href =" https://opencollective.com/flutter-webrtc/organization/7/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/7/avatar.svg " ></a >
93
+ <a href =" https://opencollective.com/flutter-webrtc/organization/8/website " ><img src =" https://opencollective.com/flutter-webrtc/organization/8/avatar.svg " ></a >
94
+ <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