QuickRTCMediaRenderer class

All-in-one media renderer widget with customizable overlays

Handles:

  • Video rendering with automatic RTCVideoRenderer lifecycle
  • Audio state tracking and display
  • Android track timing (onAddTrack listener)
  • Customizable overlays (audio/video indicators, name, etc.)
  • Theme integration via QuickRTCTheme

Basic Usage

QuickRTCMediaRenderer(
  stream: localStream,
  mirror: true,
  participantName: 'You',
  isAudioEnabled: !state.isLocalAudioPaused,
  isVideoEnabled: !state.isLocalVideoPaused,
)

Using with RemoteStream

QuickRTCMediaRenderer(
  remoteStream: participant.videoStream,
  participantName: participant.name,
  isAudioEnabled: participant.hasAudio,
  isVideoEnabled: participant.hasVideo,
)

Full Customization

QuickRTCMediaRenderer(
  stream: stream,
  participantName: 'John',
  isLocal: false,
  showAudioIndicator: true,
  showVideoIndicator: true,
  showName: true,
  audioIndicatorPosition: OverlayPosition.topRight,
  namePosition: OverlayPosition.bottomLeft,
  audioIndicatorBuilder: (context, enabled) => MyCustomIndicator(enabled),
  placeholderBuilder: (context, name) => MyAvatar(name),
  overlayBuilder: (context, state) => MyCustomOverlay(state),
  onTap: () => _focusParticipant(),
)
Inheritance

Constructors

QuickRTCMediaRenderer({Key? key, MediaStream? stream, LocalStream? localStream, RemoteStream? remoteStream, bool mirror = false, RTCVideoViewObjectFit objectFit = RTCVideoViewObjectFit.RTCVideoViewObjectFitCover, bool? isAudioEnabled, bool? isVideoEnabled, String? participantName, bool isLocal = false, bool showAudioIndicator = true, bool showVideoIndicator = false, bool showName = true, bool showLocalLabel = true, OverlayPosition? audioIndicatorPosition, OverlayPosition? videoIndicatorPosition, OverlayPosition? namePosition, CustomPosition? audioCustomPosition, CustomPosition? videoCustomPosition, CustomPosition? nameCustomPosition, Widget audioIndicatorBuilder(BuildContext context, bool isEnabled)?, Widget videoIndicatorBuilder(BuildContext context, bool isEnabled)?, Widget nameOverlayBuilder(BuildContext context, String name, bool isLocal)?, Widget placeholderBuilder(BuildContext context, String? name)?, Widget loadingBuilder(BuildContext context)?, Widget overlayBuilder(BuildContext context, QuickRTCMediaRendererState state)?, BoxDecoration? containerDecoration, BorderRadius? borderRadius, EdgeInsets overlayPadding = const EdgeInsets.all(8), VoidCallback? onTap, VoidCallback? onDoubleTap, VoidCallback? onLongPress, void onStateChanged(QuickRTCMediaRendererState state)?})
const

Properties

audioCustomPosition CustomPosition?
Custom position for audio indicator (overrides audioIndicatorPosition)
final
audioIndicatorBuilder Widget Function(BuildContext context, bool isEnabled)?
Custom audio indicator builder
final
audioIndicatorPosition OverlayPosition?
Position for audio indicator (null = use theme default)
final
borderRadius BorderRadius?
Border radius (overrides theme)
final
containerDecoration BoxDecoration?
Container decoration (overrides theme)
final
hashCode int
The hash code for this object.
no setterinherited
isAudioEnabled bool?
Audio enabled state override (null = derive from track.enabled)
final
isLocal bool
Whether this is the local user (affects name display)
final
isVideoEnabled bool?
Video enabled state override (null = derive from track.enabled)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder Widget Function(BuildContext context)?
Custom loading builder (shown while initializing)
final
localStream LocalStream?
LocalStream from state (convenience accessor)
final
mirror bool
Mirror the video (typically true for local/front camera)
final
nameCustomPosition CustomPosition?
Custom position for name overlay (overrides namePosition)
final
nameOverlayBuilder Widget Function(BuildContext context, String name, bool isLocal)?
Custom name overlay builder
final
namePosition OverlayPosition?
Position for name overlay (null = use theme default)
final
objectFit RTCVideoViewObjectFit
How to fit the video in the container
final
onDoubleTap VoidCallback?
Called when the renderer is double-tapped
final
onLongPress VoidCallback?
Called when the renderer is long-pressed
final
onStateChanged → void Function(QuickRTCMediaRendererState state)?
Called when renderer state changes (video tracks added, etc.)
final
onTap VoidCallback?
Called when the renderer is tapped
final
overlayBuilder Widget Function(BuildContext context, QuickRTCMediaRendererState state)?
Builder for additional custom overlays
final
overlayPadding EdgeInsets
Padding for overlay elements
final
participantName String?
Participant/user name for display
final
placeholderBuilder Widget Function(BuildContext context, String? name)?
Custom placeholder builder (shown when no video)
final
remoteStream RemoteStream?
RemoteStream from participant (convenience accessor)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showAudioIndicator bool
Show audio mute/unmute indicator
final
showLocalLabel bool
Show "(You)" label for local participant
final
showName bool
Show participant name overlay
final
showVideoIndicator bool
Show video on/off indicator (shown only when video is off)
final
stream MediaStream?
Direct MediaStream to render
final
videoCustomPosition CustomPosition?
Custom position for video indicator (overrides videoIndicatorPosition)
final
videoIndicatorBuilder Widget Function(BuildContext context, bool isEnabled)?
Custom video indicator builder
final
videoIndicatorPosition OverlayPosition?
Position for video indicator (null = use theme default)
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<QuickRTCMediaRenderer>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited