RTCVideoRenderer class

Says which video an RTCVideoView shows.

Every video and screen-share RTCStream comes with one in RTCStream.renderer; pass it straight to an RTCVideoView. Create your own only to preview a track before joining, by setting srcObject to the track's mediaStream.

Example

final renderer = RTCVideoRenderer();
final track = await VideoSDK.createCameraVideoTrack();
renderer.srcObject = track?.mediaStream;

// in build():
RTCVideoView(renderer, mirror: true);

// when the preview closes:
await renderer.dispose();
Inheritance

Constructors

RTCVideoRenderer()
Creates an unbound renderer. Assign srcObject, or let a RTCStream bind it, then pass it to a RTCVideoView.

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
muted ↔ bool
Whether the bound track's audio is silenced for this viewer.
getter/setter pair
onFirstFrameRendered ↔ Function?
Called the first time the bound track produces a frame.
getter/setter pair
onResize ↔ Function?
Called when the bound track's dimensions change.
getter/setter pair
renderVideo → bool
Whether there is something to draw. False before the first frame, and whenever no track is bound — RTCVideoView shows its placeholder then.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
srcObject ↔ NativeMediaStream?
The stream this renderer draws. Setting it rebinds the view; setting it to null leaves the view blank.
getter/setter pair
value ↔ RTCVideoValue
The current value stored in this notifier.
getter/setter pairinherited
videoHeight → int
Height of the last frame, in pixels. Zero until the first frame arrives.
no setter
videoWidth → int
Width of the last frame, in pixels. Zero until the first frame arrives.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → Future<void>
Releases this renderer.
override
initialize() → Future<void>
Completes immediately. Awaiting it before first render is harmless but not needed — the native view sets itself up when it is shown.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setMirror(bool mirror) → void
Flips the video horizontally in every RTCVideoView showing this renderer, overriding the view's mirror: parameter.
toString() → String
A string representation of this object.
inherited

Operators

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