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:startPlay / stopPlay).setView / setRenderRotation).joinChannel / leaveChannel).switchStream).enableReceiveSeiMessage).state real-time state, PlayerStatistics statistics).playerEvent on Swift or addListener on Kotlin).Property | Type | Description |
playbackStatus | Playback status. Reflects the current playback lifecycle. | |
statistics | Playback runtime statistics, delivered periodically by the SDK. | |
totalViewerCount | ValueListenable<int> | Total viewer count. |
Function | Description |
Add player event callback listener. | |
Remove player event callback listener. | |
Set the render view. | |
Set render rotation angle. | |
Start playing the remote stream specified by URL. | |
Stop playback. | |
Set playback volume. | |
Leave channel. | |
Enable or disable receiving SEI messages. | |
Enable advanced features by key-value pair. |
void addListener(PlayerListener? listener);
Parameter | Type | Description |
listener | Listener. |
void removeListener(PlayerListener? listener);
Parameter | Type | Description |
listener | Listener. |
AtomicLiveView container. 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.void setView(AtomicLiveWidget view);
Parameter | Type | Description |
view | Render view container. |
void setRenderRotation(PlayerRenderRotation rotation);
Parameter | Type | Description |
rotation | Render rotation angle. |
void startPlay(String url);
Parameter | Type | Description |
url | String | Stream URL. |
void stopPlay();
void setVolume(int volume);
Parameter | Type | Description |
volume | int | Volume level, with a value range from 0 to 100; values outside the range will be clamped. |
void leaveChannel();
PlayerEvent.seiReceived event.void enableReceiveSeiMessage(bool enable, int payloadType);
Parameter | Type | Description |
enable | bool | Whether to enable SEI message receiving. |
payloadType | int | SEI payload type to filter. Common values: 243 (custom layout), 100 (volume layout), 245 (ASR message). |
void enableAdvancedFeature(String key, Object value);
Parameter | Type | Description |
key | String | Feature key. |
value | Object | Feature value, type depends on the specific key. |
Enum Value | Value | Description |
ok | 0 | No error, operation succeeded. |
errorInvalidParameter | -1001 | Invalid parameter. |
startPlayIDLE ──────────────────▶ LOADING▲ ││ play succeededstopPlay │connection lost ││ ▼│◀─────────────────────PLAYING ◀────────────────┐│ │ ││ │ ││ buffering recover succeeded│ │ ││ ▼ │└──────────────────────LOADING ─────────────────┘
IDLE is the initial state; it is also returned to after calling stopPlay. The buffering / auto-recovery process reuses LOADING, without distinguishing "first loading" from "re-buffering".Enum Value | Value | Description |
idle | 0 | Idle. Initial state, or playback stopped / connection lost. |
loading | 1 | Loading. Establishing the connection or buffering data; the video has not started or is temporarily stalled. |
playing | 2 | Playing. The link is normal and the video is playing smoothly. |
Enum Value | Value | Description |
rotation0 | 0 | No rotation. |
rotation90 | 1 | Rotated 90 degrees clockwise. |
rotation180 | 2 | Rotated 180 degrees clockwise. |
rotation270 | 3 | Rotated 270 degrees clockwise. |
Enum Value | Value | Description |
endedByHost | 0 | Actively ended by the host. |
endedByServer | 1 | Ended by the server. |
Enum Value | Value | Description |
byAdmin | 0 | Kicked out by an admin. |
byLoggedOnOtherDevice | 1 | Logged in on another device. |
byServer | 2 | Kicked out by the server. |
forNetworkDisconnected | 3 | Network disconnected. |
forLiveChannelExpired | 4 | The live channel expired. |
addListener / removeListener.Property | Type | Description |
videoWidth | int | Video width in pixels. |
videoHeight | int | Video height in pixels. |
videoFps | int | Video frame rate in fps. |
videoBitrate | int | Video bitrate in bps. |
audioBitrate | int | Audio bitrate in bps. |
state.Property | Type | Description |
playbackStatus | Playback status. Reflects the current playback lifecycle. | |
statistics | Playback runtime statistics, delivered periodically by the SDK. | |
totalViewerCount | ValueListenable<int> | Total viewer count. |
フィードバック