AtomicPlayer class abstract
Atomic player related interfaces, managing video stream playback, render view binding, and player event listening for low-latency live streaming and CDN streams.
AtomicPlayer AtomicPlayer provides live streaming playback (downstream) capabilities, including stream pulling, render view binding, playback state management, and event callbacks.
AtomicPlayer manages video stream playback for low-latency live streaming and CDN streams.
The render view is bound at runtime via setView; the video frames will be rendered into the given AtomicLiveView container. This binding is decoupled from the view's window-attachment timing: it is safe to call setView before the view is attached to a window (e.g. inside UICollectionView cells or RecyclerView), the binding will be completed automatically once the view is ready.
Key Features:
- Stream pulling and playback (
startPlay/stopPlay) - Render view binding and rotation mode control (
setView/setRenderRotation) - Channel join and leave (
joinChannel/leaveChannel) - Playback control (
switchStream) - SEI message receiving (
enableReceiveSeiMessage) - Playback state and statistics (
statereal-time state,PlayerStatisticsstatistics) - Event callbacks (SEI data, errors, live ended, kicked out, etc. via
playerEventon Swift oraddListeneron Kotlin)
Key Features
- PlayerState:Playback state, including playback lifecycle state and statistics.
- PlayerEvent:Player event callbacks, including SEI receiving, playback errors, live ended, kicked out, and other event types.
Topics
See Also
- AtomicPusher
- AtomicLiveView
- Implementers
Constructors
- AtomicPlayer()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → PlayerState
-
Reactive state. Carries connection state, buffering status, playback statistics, etc. You can read the current value or observe changes.
no setter
Methods
-
addListener(
PlayerListener? listener) → void - Add player event callback listener.
-
enableAdvancedFeature(
String key, Object value) → void - Enable an advanced feature by key-value pair. Supported keys depend on the underlying native player capability and may evolve over versions.
-
enableReceiveSeiMessage(
bool enable, int payloadType) → void -
Enable or disable receiving SEI messages. When enabled, SEI data embedded in the video stream will be delivered via the
PlayerEvent.seiReceivedevent. -
joinChannel(
String liveID) → Future< CompletionHandler> - Join channel.
-
leaveChannel(
) → void - Leave channel.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeListener(
PlayerListener? listener) → void - Remove player event callback listener.
-
setRenderRotation(
PlayerRenderRotation rotation) → void - Set render rotation angle.
-
setView(
AtomicLiveWidget view) → void -
Set the render view. The video frames will be rendered into the given
AtomicLiveViewcontainer. This binding is decoupled from the view's window-attachment timing: it is safe to call this before the view is attached to a window (e.g. inside UICollectionView cells or RecyclerView), the binding will be completed automatically once the view is ready. -
setVolume(
int volume) → void - Set playback volume.
-
snapshot(
) → Future< Image?> - Capture the current video frame.
-
startPlay(
String url) → void - Start playing the remote stream specified by URL. Calling this method on an already-playing instance will stop the previous stream and play the new one.
-
stopPlay(
) → void - Stop playback.
-
switchStream(
String url) → Future< CompletionHandler> - Seamlessly switch to a new stream URL without tearing down the current render view. Suitable for quality switching (such as 720p → 1080p) and CDN line failover.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited