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 | StateFlow<Int> | Total viewer count. |
Function | Description |
Add player event callback listener. | |
Remove player event callback listener. | |
Set the render view. | |
Set render rotation angle. | |
Capture the current video frame. | |
Start playing the remote stream specified by URL. | |
Stop playback. | |
Seamlessly switch to a new stream URL. | |
Set playback volume. | |
Join channel. | |
Leave channel. | |
Enable or disable receiving SEI messages. | |
Enable advanced features by key-value pair. |
fun addListener(listener: PlayerListener?) = impl.addListener(listener)
Parameter | Type | Description |
listener | Listener. |
fun removeListener(listener: PlayerListener?) = impl.removeListener(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.fun setView(view: AtomicLiveView) = impl.setView(view)
Parameter | Type | Description |
view | Render view container. |
fun setRenderRotation(rotation: PlayerRenderRotation) = impl.setRenderRotation(rotation)
Parameter | Type | Description |
rotation | Render rotation angle. |
fun snapshot(callback: SnapshotCallback? = null) = impl.snapshot(callback)
Parameter | Type | Description |
callback | SnapshotCallback? | Snapshot result callback. The image is null if the snapshot fails. |
fun startPlay(url: String) = impl.startPlay(url)
Parameter | Type | Description |
url | String | Stream URL. |
fun stopPlay() = impl.stopPlay()
fun switchStream(url: String, completion: CompletionHandler? = null) = impl.switchStream(url, completion)
Parameter | Type | Description |
url | String | New stream URL. |
completion | Completion callback (success/failure status). |
fun setVolume(volume: Int) = impl.setVolume(volume)
Parameter | Type | Description |
volume | Int | Volume level, with a value range from 0 to 100; values outside the range will be clamped. |
fun joinChannel(liveID: String, completion: CompletionHandler? = null) = impl.joinChannel(liveID, completion)
Parameter | Type | Description |
liveID | String | Live ID. |
completion | Completion callback. |
fun leaveChannel() = impl.leaveChannel()
PlayerEvent.seiReceived event.fun enableReceiveSeiMessage(enable: Boolean, payloadType: Int) = impl.enableReceiveSeiMessage(enable, payloadType)
Parameter | Type | Description |
enable | Boolean | Whether to enable SEI message receiving. |
payloadType | Int | SEI payload type to filter. Common values: 243 (custom layout), 100 (volume layout), 245 (ASR message). |
fun enableAdvancedFeature(key: String, value: Any) = impl.enableAdvancedFeature(key, value)
Parameter | Type | Description |
key | String | Feature key. |
value | Any | Feature value, type depends on the specific key. |
Enum Value | Value | Description |
OK | 0 | No error, operation succeeded. |
ERROR_INVALID_PARAMETER | -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 |
ROTATION_0 | 0 | No rotation. |
ROTATION_90 | 1 | Rotated 90 degrees clockwise. |
ROTATION_180 | 2 | Rotated 180 degrees clockwise. |
ROTATION_270 | 3 | Rotated 270 degrees clockwise. |
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 | StateFlow<Int> | Total viewer count. |
フィードバック