Flutter-WebRTC

Financial Contributors on Open Collective pub package Gitter

WebRTC plugin for Flutter Mobile/Desktop/Web

Functionality

FeatureAndroidiOSWebmacOSWindowsLinuxFuchsia
Audio/Video:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:WIPWIP
Data Channel:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:WIPWIP
Screen Capture:heavy_check_mark::heavy_check_mark::heavy_check_mark:
Unified-Plan
MediaRecorder:warning::warning::heavy_check_mark:

Usage

Add flutter_webrtc as a dependency in your pubspec.yaml file.

iOS

Add the following entry to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) Camera Usage!</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) Microphone Usage!</string>

This entry allows your app to access camera and microphone.

Android

Ensure the following permission is present in your Android Manifest file, located in `/android/app/src/main/AndroidManifest.xml:

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

The Flutter project template adds it, so it may already be there.

Also you will need to set your build settings to Java 8, because official WebRTC jar now uses static methods in EglBase interface. Just add this to your app level build.gradle:

android {
    //...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Contributing

The project is inseparable from the contributors of the community.

Example

For more examples, please refer to flutter-webrtc-demo.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Libraries

enums
get_user_media
get_user_media
media_recorder
media_recorder
media_stream
media_stream
media_stream_track
media_stream_track
rtc_data_channel
rtc_data_channel
rtc_dtmf_sender
rtc_ice_candidate
rtc_ice_candidate
rtc_peerconnection
rtc_peerconnection
rtc_peerconnection_factory
rtc_peerconnection_factory
rtc_session_description
rtc_session_description
rtc_stats_report
rtc_video_view
rtc_video_view
utils
utils
webrtc

Dart

VM

dart:ffi
Foreign Function Interface for interoperability with the C programming language. [...]

Web

dart:html
HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
dart:js
Low-level support for interoperating with JavaScript. [...]
dart:js_util
Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.