AtomicPusher.shared.setView(view), start pushing via startPush(config), monitor state for state changes, and release resources via release().Property | Type | Description |
networkState | Connection state. | |
statistics | Pusher runtime statistics. | |
pusherInfo | Pusher live room info. | |
totalViewerCount | StateFlow<Int> | Total viewer count. |
Function | Description |
Get the global singleton. | |
Add pusher event callback listener. | |
Remove pusher event callback listener. | |
Set the render view. | |
Start pushing (streaming). | |
Stop pushing (streaming). | |
Update live room configuration. | |
Release pusher resources. | |
Enable advanced features by key-value pair. |
abstract fun addListener(listener: PusherListener?)
Parameter | Type | Description |
listener | Listener. |
abstract fun removeListener(listener: PusherListener?)
Parameter | Type | Description |
listener | Listener. |
AtomicLiveView container.abstract fun setView(view: AtomicLiveView)
Parameter | Type | Description |
view | The render view container. |
abstract fun startPush(config: PusherInfo)
Parameter | Type | Description |
config | Live room configuration. |
abstract fun stopPush()
startPush to update live room info such as name, cover, category etc.abstract fun updateConfig(config: PusherInfo,modifyFlagList: List<PusherInfo.ModifyFlag>,)
Parameter | Type | Description |
config | Updated configuration. | |
modifyFlagList | List<PusherInfo.ModifyFlag> | Modify flags. |
abstract fun release()
abstract fun enableAdvancedFeature(key: String, value: Any)
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 | -1 | Invalid parameter. |
ERROR_INVALID_STATE | -2 | The operation is not allowed in the current state (e.g. startPush again while pushing, updateConfig before startPush). |
ERROR_START_PUSH_REQUEST_FAILED | -3 | The startPush request chain failed (server / signaling / TRTC). See message for details. |
ERROR_UPDATE_CONFIG_REQUEST_FAILED | -4 | The updateConfig request chain failed (server / signaling). See message for details. |
startPushDISCONNECTED ─────────────▶ CONNECTING▲ ││ │ join/push succeeded│ ▼│ CONNECTED│ ││ network jitter / dropped, SDK auto-reconnects│ ▼│ CONNECTING│ ││ reconnect succeeded ─▶ CONNECTED└───── reconnect failed / stopPush / release
DISCONNECTED is the initial state; it is also returned to after calling stopPush / release. The auto-reconnect process reuses CONNECTING, without distinguishing "first connection" from "reconnecting".Enum Value | Value | Description |
DISCONNECTED | 0 | Not connected. Initial state, or after actively stopping the push / final reconnect failure. |
CONNECTING | 1 | Establishing connection. Used for both the first room-join handshake and auto-reconnect after a disconnection. |
CONNECTED | 2 | Connected, the push link is normal. |
addListener / removeListener.Property | Type | Description |
videoWidth | Int | Video width (pixels). |
videoHeight | Int | Video height (pixels). |
videoFps | Int | Video frame rate (fps). |
videoBitrate | Int | Video bitrate (bps). |
audioBitrate | Int | Audio bitrate (bps). |
rtt | Int | Network round-trip time (milliseconds). |
packetLossRate | Int | Network packet loss rate (percentage). |
state.Property | Type | Description |
networkState | Connection state. | |
statistics | Pusher runtime statistics. | |
pusherInfo | Pusher live room info. | |
totalViewerCount | StateFlow<Int> | Total viewer count. |
startPush / updateConfig, and carried in state.pusherInfo as the live room info returned from the engine.Property | Type | Description |
liveID | String | Live ID. |
liveName | String | Live name. |
coverURL | String | Cover URL. |
backgroundURL | String | Background URL. |
notice | String | Notice. |
createTime | Long | Create time. |
categoryList | List<Int> | Category list. |
isPublicVisible | Boolean | Whether publicly visible. |
metaData | Map<String, String> | Custom metadata. |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan