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 | ValueListenable<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. |
void addListener(PusherListener? listener);
Parameter | Type | Description |
listener | Listener. |
void removeListener(PusherListener? listener);
Parameter | Type | Description |
listener | Listener. |
AtomicLiveView container.void setView(AtomicLiveWidget view);
Parameter | Type | Description |
view | The render view container. |
void startPush(PusherInfo config);
Parameter | Type | Description |
config | Live room configuration. |
void stopPush();
startPush to update live room info such as name, cover, category etc.void updateConfig(PusherInfo config, List<PusherInfoModifyFlag> modifyFlagList);
Parameter | Type | Description |
config | Updated configuration. | |
modifyFlagList | Modify flags. |
void release();
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 | -1 | Invalid parameter. |
errorInvalidState | -2 | The operation is not allowed in the current state (e.g. startPush again while pushing, updateConfig before startPush). |
errorStartPushRequestFailed | -3 | The startPush request chain failed (server / signaling / TRTC). See message for details. |
errorUpdateConfigRequestFailed | -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. |
updateConfig. Each flag is a bit value aligned with the underlying engine's field flags, so the raw values are intentionally non-contiguous (bits used by unrelated fields are skipped).Enum Value | Value | Description |
liveName | 1 | Update the live name. |
notice | 2 | Update the notice. |
isPublicVisible | 32 | Update whether the live is publicly visible. |
coverURL | 128 | Update the cover URL. |
backgroundURL | 256 | Update the background URL. |
categoryList | 512 | Update the category list. |
metaData | 4096 | Update the custom metadata. |
addListener / removeListener.Property | Type | Description |
totalViewers | int | Cumulative view count. |
totalGiftsSent | int | Total number of gifts sent. |
totalGiftCoins | int | Total gift amount. |
totalUniqueGiftSenders | int | Number of gift senders. |
totalLikesReceived | int | Total likes. |
totalMessageCount | int | Total messages. |
liveDuration | int | Live duration (seconds). |
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 | ValueListenable<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 | int | Create time. |
categoryList | List<int> | Category list. |
isPublicVisible | bool | Whether publicly visible. |
metaData | Map<String, String> | Custom metadata. |
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários