dart_webrtc
1.8.2, released 3 months ago by flutter-webrtc.org
WebRTC API wrapper for Dart, enabling browser-based audio/video communication.
What it does
Provides a Dart-friendly interface to the browser's WebRTC API, exposing peer connections, media streams, data channels, and E2EE support. It wraps the native JS objects using dart/js for cross-browser compatibility.
AI-written summary of version 1.8.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need real-time audio/video or data communication in a Flutter web app.
- You want to use WebRTC without writing JavaScript interop yourself.
- You need E2EE or advanced media stream handling in the browser.
Skip it when
- You are targeting mobile or desktop platforms only; this package is web-only.
- You need a native WebRTC implementation for iOS/Android; use flutter-webrtc instead.
Strengths
- Pure Dart wrapper, no native plugins required.
- Supports E2EE and advanced WebRTC features like priority control and data channel buffering.
- Regularly updated with bug fixes and new browser support.
Weaknesses
- Web-only; not usable on mobile or desktop.
- Requires manual compilation of the E2EE worker for wasm compatibility.
- Relies on dart/js, so no type safety for all JS interop.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 6
Add dependency in pubspec, import package, no additional build steps needed.
import 'package:dart_webrtc/dart_webrtc.dart';
final pc = RTCPeerConnection();
await pc.createOffer();
await pc.setLocalDescription();Alternatives
Packages that do the same job and could replace dart_webrtc.
- speech_to_text_platform_interface
A common platform interface for the speech_to_text plugin.
75Compare - flutter_midi_command_platform_interface
A common platform interface for the FlutterMidiCommand plugin.
75Compare - flutter_vlc_player_platform_interface
Defines the platform interface for the Flutter VLC player plugin.
53Compare - just_audio_platform_interface
A platform interface for the just_audio plugin, defining the contract for platform-specific implementations.
64Compare
Works with
Packages commonly used together with dart_webrtc: ones it builds on, ones built on it, and its own family.
- webdart_webrtc depends on itLightweight bindings for browser APIs via JS interop
- loggingdart_webrtc depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- synchronizeddart_webrtc depends on itLock mechanism to prevent concurrent access to asynchronous code.
- webrtc_interfacedart_webrtc depends on itCommon WebRTC interfaces and type definitions for Flutter and Dart Web.
- flutter_webrtcBuilt on dart_webrtcWebRTC plugin for real-time audio, video and data communication.
- livekit_clientBuilt on dart_webrtcFlutter Client SDK for LiveKit to build real-time video, audio, and data features.
- stream_videoBuilt on dart_webrtcOfficial low-level client for Stream Video, supporting calls, audio rooms, and live streaming.
- gravix_rtcBuilt on dart_webrtcReal-time video and audio rooms for Flutter on Gravix Cloud.