WebRTCStreamController class
The stream's state for the whole page, so a view that remounts finds it as it was.
A view attaches while it shows the stream and detaches when it goes. The session outlives the last view for keepAlive, so a language or theme change keeps the picture; after that the next view opens a new session from the producers the client already knows, without waiting for an event that fired before it existed.
Constructors
- WebRTCStreamController(SignallingClient _client, {required int reconnectionTimeoutMs, String? producerId, Duration keepAlive = const Duration(seconds: 30), Duration retryAfter = const Duration(seconds: 3), Duration negotiationTimeout = const Duration(seconds: 15)})
Properties
- detail → String Function(dynamic l10n)?
-
The reason behind stage, localized at render time;
nullmeans the stage's default.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
How long the browser tab may be hidden before the session closes; ObservANT encodes per viewer.
final
- keepAlive → Duration
-
How long a session stays open with no view attached.
final
- negotiationTimeout → Duration
-
A session that is not streaming after this rebuilds the signalling connection.
final
- playback → dynamic
-
The latest PlaybackStats, from reportPlayback;
nullbefore two reports.final - producerId → String?
-
Consume only this producer;
nulltakes the first one announced.final - reconnectionTimeoutMs → int
-
The signalling client's retry interval, for the message after a dropped connection.
final
- retryAfter → Duration
-
How long after a failed session the next one is tried.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stage → WebRTCStage
-
no setter
Methods
-
attach(
) → void - A view shows the stream: it gets the open session, or a new one at once.
-
detach(
) → void - A view went away; with none left, the session closes after keepAlive.
-
dispose(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pageHidden(
) → void - The browser hid or showed the tab: hidden for hiddenGrace, the session closes, and showing it opens one again.
-
reportFrames(
int total) → void - The video's decoded-frame count, which the view reports every 2 s. A count that stops while streaming is media that died unnoticed, with the camera restarted behind a dead socket.
-
reportPlayback(
{required int totalFrames, required int droppedFrames, required int width, required int height, required DateTime at}) → void -
The video's counters at
at: two reports give the frames per second between them. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited