GemCameraPlayerController class Sensor Data Source

Controller for managing camera feed playback from a data source.

Manages playback of camera frames from a DataSource by wrapping a ValueNotifier that tracks GemCameraPlayerValue state. Automatically registers a DataSourceListener to receive new camera frames and update the playback status. Use with GemCameraPlayer widget to render camera feed frames.

The controller validates that the data source supports camera data and sets an error status if unavailable. It handles automatic state transitions between loading, playing, paused, and ended states based on incoming data and playback events. The controller must be disposed when no longer needed to clean up listeners and resources.

See also:

Inheritance

Constructors

GemCameraPlayerController({required DataSource dataSource, CameraConfiguration? configurationOverride})
Creates a camera player controller from a data source.

Properties

camera Camera?
The latest camera frame data received from the data source.
no setter
configurationOverride CameraConfiguration?
final
datasource DataSource
The data source providing camera frame data to the player.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isDisposed bool
Whether the controller has been disposed.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size → (int, int)?
The resolution of the camera frame as (width, height).
no setter
status GemCameraPlayerStatus
The current playback status of the camera player.
no setter
value GemCameraPlayerValue
The current value stored in this notifier.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Disposes of the controller and cleans up resources.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
pause() → void
Pauses the camera feed playback.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resume() → void
Resumes the camera feed playback.
toString() String
A string representation of this object.
inherited

Operators

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