Home > @magiclane/maps-sdk > GemCameraPlayer
GemCameraPlayer class
Controller for managing camera feed playback from a data source.
Manages playback of camera frames from a DataSource by tracking the GemCameraPlayerStatus state. Automatically registers a DataSourceListener to receive new camera frames and update the playback status. Use with camera rendering components to display 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.
Sensor Data Source
Signature:
export declare class GemCameraPlayer Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Creates a camera player controller from a data source. Initializes the controller with loading status and validates that the dataSource supports camera data (sets error status if not). Automatically registers a DataSourceListener to receive camera frames and playback status changes. Updates status to ended if playback is already stopped. |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
SenseData | null |
The latest camera frame data received from the data source. | |
|
|
CameraConfiguration | undefined |
(Optional) | |
|
| |||
|
|
boolean |
Whether the controller has been disposed. | |
|
|
[number, number] | null |
The resolution of the camera frame as (width, height). Returns the native dimensions of incoming camera frames based on the actual sensor data, not the on-screen display size. If configurationOverride is set, uses those dimensions. | |
|
|
The current playback status of the camera player. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Disposes of the controller and cleans up resources. Removes the registered DataSourceListener from the data source, marks the controller as disposed, and cleans up resources. After calling this method, the controller cannot be used and should not be accessed. | ||
|
Pauses the camera feed playback. Sets the playback status to paused if currently playing. Does not affect the underlying DataSource sensor playback. | ||
|
Resumes the camera feed playback. Sets the playback status to playing if currently paused. Does not affect the underlying DataSource sensor playback. |