quickrtc_flutter_client library

QuickRTC Flutter Client Library

A Flutter WebRTC client library built on MediaSoup for real-time video conferencing.

Quick Start (Controller-Based API)

import 'package:quickrtc_flutter_client/quickrtc_flutter_client.dart';
import 'package:socket_io_client/socket_io_client.dart' as io;

// Create socket and controller
final socket = io.io('https://your-server.com');
final controller = QuickRTCController(socket: socket);

// Wrap your app with QuickRTCProvider
QuickRTCProvider(
  controller: controller,
  child: MyApp(),
)

// Use QuickRTCBuilder to react to state changes
QuickRTCBuilder(
  buildWhen: (prev, curr) => prev.participants != curr.participants,
  builder: (context, state) {
    return ParticipantGrid(participants: state.participantList);
  },
)

// Join and produce media (high-level API)
await controller.joinMeeting(conferenceId: 'room-123', participantName: 'Alice');
await controller.enableMedia(); // Enables camera and microphone

// Or use low-level API for more control
final media = await QuickRTCStatic.getLocalMedia(MediaConfig.audioVideo());
await controller.produce(ProduceInput.fromTracksWithTypes(media.tracksWithTypes));

// Control media
await controller.toggleCamera();
await controller.toggleMicrophone();
await controller.startScreenShare();

// Leave
await controller.leaveMeeting();

Classes

AndroidAudioConfiguration
AndroidNativeAudioManagement
AppleAudioConfiguration
AppleNativeAudioManagement
AudioConfig
Audio configuration
AudioControl
AudioOutputOptions
An object that configures what device(s) may be offered in the user prompt.
AudioStreamEntry
Entry for audio stream in QuickRTCAudioGroup
CameraUtils
ConnectedEvent
Connected event data
ConsumerInfo
Internal consumer info
ConsumerParamsData
Consumer parameters from server
CustomPosition
Custom position for fine-grained control
DataPacketCryptor
DataPacketCryptorFactory
DesktopCapturer
DesktopCapturerSource
DisconnectedEvent
Disconnected event data
EncryptedPacket
ErrorEvent
Error event data
FrameCryptor
Frame encryption/decryption.
FrameCryptorFactory
Factory for creating frame Cryptors. For End 2 End Encryption, you need to create a KeyProvider for each peer. And set your key in keyProvider.
Helper
HttpClientAdapter
Adapter responsible for establishing the underlying WebSocket connection used by the websocket transport.
JoinConfig
Configuration for joining a conference
KeyProvider
Shared secret key for frame encryption.
KeyProviderOptions
LocalMedia
Result from getLocalMedia containing streams and tracks
LocalStream
Local stream handle returned from produce()
LocalStreamEndedEvent
Local stream ended event (e.g., user clicked browser's "Stop sharing" button)
MediaConfig
Configuration for getLocalMedia
MediaDeviceInfo
This describe the media input and output devices, such as microphones, cameras, headsets, and so forth.
MediaDevices
MediaRecorder
MediaStream
https://w3c.github.io/mediacapture-main/#mediastream
MediaStreamConstraints
MediaStreamTrack
MediaTrackSupportedConstraints
MediaTrackSupportedConstraints represents the list of constraints controlling the capabilities of a MediaStreamTrack.
NativeAudioManagement
NativeVideoPlayerViewState
NewParticipantEvent
New participant event data Streams array may be empty if participant hasn't started sharing media yet
NewProducerData
OptionBuilder
Option Builder to help developer to construct an options map.
ParserOptions
Parser options
Participant
Participant information
ParticipantInfoData
Participant info from server
ParticipantJoinedData
ParticipantLeftData
ParticipantLeftEvent
Participant left event data
ProduceInput
Input for produce() - can be single track, array of tracks, or tracks with types Use the factory methods for convenience
ProducerClosedData
ProducerInfo
Internal producer info
QuickRTCAudioGroup
A widget that combines multiple audio streams into one managed group
QuickRTCAudioRenderer
Dedicated audio stream renderer
QuickRTCAudioRenderers
Helper widget to render all audio streams from participants
QuickRTCBuilder
A widget that rebuilds when the QuickRTCState changes.
QuickRTCConfig
Configuration for QuickRTC client instance
QuickRTCConsumer
A comprehensive wrapper widget that combines Provider, Listener, and Builder.
QuickRTCConsumerLite
A simpler consumer that doesn't include a Provider.
QuickRTCController
QuickRTCController - Main controller for WebRTC conferencing
QuickRTCListener
A widget that invokes a callback in response to QuickRTCState changes.
QuickRTCMediaRenderer
All-in-one media renderer widget with customizable overlays
QuickRTCMediaRendererState
State data exposed by the renderer
QuickRTCPlatform
Platform-specific screen capture service handler.
QuickRTCProvider
Provides a QuickRTCController instance to the widget tree.
QuickRTCState
Immutable state for QuickRTC
QuickRTCStatic
Static utility methods for QuickRTC
QuickRTCTheme
InheritedWidget to provide QuickRTCThemeData to the widget tree
QuickRTCThemeData
Theme data for QuickRTC widgets
RemoteParticipant
Remote participant with their streams
RemoteStream
Remote stream from a participant
RTCDataChannel
RTCDataChannelInit
RTCDataChannelMessage
A class that represents a datachannel message. Can either contain binary data as a Uint8List or text data as a String.
RTCDTMFSender
RTCFactory
RTCFactoryNative
RTCHeaderExtension
RTCIceCandidate
RTCPeerConnection
RTCRTCPParameters
RTCRtpCapabilities
RTCRTPCodec
RTCRtpCodecCapability
RTCRtpEncoding
RTCRtpHeaderExtensionCapability
RTCRtpParameters
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCRtpTransceiverInit
RTCSessionDescription
RTCTrackEvent
RTCVideoPlatFormView
RTCVideoPlatformViewController
RTCVideoRenderer
RTCVideoRendererWidget
Widget for rendering RTC video streams
RTCVideoValue
RTCVideoView
ScreenSelectDialog
A dialog for selecting a screen to share.
ScreenShareConfig
Screen share configuration
Socket
Socket constructor.
StatsReport
StreamPausedEvent
Stream paused event (remote participant muted audio/video)
StreamRemovedEvent
Stream removed event data
StreamResumedEvent
Stream resumed event (remote participant unmuted audio/video)
ThumbnailSize
TrackWithType
Track with optional type hint for producing
TransportOptionsData
Transport options from server
VideoConfig
Video configuration
VideoRenderer
WebRTC

Enums

AdapterType
Algorithm
Built-in Algorithm.
AndroidAudioAttributesContentType
AndroidAudioAttributesUsageType
AndroidAudioFocusMode
AndroidAudioMode
AndroidAudioStreamType
AppleAudioCategory
AppleAudioCategoryOption
AppleAudioIOMode
AppleAudioMode
CameraExposureMode
CameraFocusMode
ConnectionStatus
Connection status for QuickRTC
FrameCryptorState
KeyDerivationAlgorithm
MediaType
Media types for getLocalMedia
MessageType
RTCDataChannelMessage type
MicrophoneMuteMode
Strategy used by the AVAudioEngine-based audio device module to mute microphone input. iOS/macOS only.
OverlayPosition
Position options for overlay elements
RecorderAudioChannel
RTCDataChannelState
RTCDegradationPreference
RTCIceConnectionState
RTCIceGatheringState
RTCPeerConnectionState
RTCPriorityType
Priority levels for RTP encoding, matching WebRTC's RTCPriorityType. Used for both priority and networkPriority in RTCRtpEncodingParameters.
RTCRtpMediaType
RTCSignalingState
RTCVideoViewObjectFit
SourceType
StreamType
Stream types
TransceiverDirection

Constants

reservedEvents → const Map<String, int>

Typedefs

QuickRTCBuildWhen = bool Function(QuickRTCState previous, QuickRTCState current)
Signature for the buildWhen function which takes the previous and current QuickRTCState and returns a boolean indicating whether the builder should be called.
QuickRTCConsumerWidgetBuilder = Widget Function(BuildContext context, QuickRTCState state, QuickRTCController controller)
Signature for the consumer builder - receives context, state, AND controller
QuickRTCConsumerWidgetListener = void Function(BuildContext context, QuickRTCController controller)
Signature for consumer listener - receives context and controller
QuickRTCErrorBuilder = Widget Function(BuildContext context, String error)
Signature for the onError builder which takes the BuildContext and error message and returns a widget.
QuickRTCListenWhen = bool Function(QuickRTCState previous, QuickRTCState current)
Signature for the listenWhen function which takes the previous and current QuickRTCState and returns a boolean indicating whether the listener should be called.
QuickRTCWidgetBuilder = Widget Function(BuildContext context, QuickRTCState state)
Signature for the builder function which takes the BuildContext and QuickRTCState and returns a widget.
QuickRTCWidgetListener = void Function(BuildContext context, QuickRTCController controller)
Signature for the listener function which takes the BuildContext and QuickRTCController.
StreamAddedEvent = RemoteStream
Stream added event (for existing participants who start new media)
StreamTrackCallback = dynamic Function()
WebSocketConnector = Future<WebSocket> Function(Uri uri, {Map<String, String>? headers, Iterable<String>? protocols})
Factory function to create a WebSocket connection. Allows consumers to provide custom WebSocket implementations (e.g., CupertinoWebSocket, OkHttpWebSocket).

Exceptions / Errors

ScreenCapturePermissionException
Exception thrown when screen capture permission is not granted