tencent cloud

Mobile Live Video Broadcasting

AtomicLiveView

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-11-02 17:31:48
Traduzido por IA

Introduction

AtomicLiveWidget is a lightweight render container for pure playback / preview scenarios. It only renders video (mix-stream or per-seat) plus business widgets, and does not provide seat / co-hosting / PK APIs. Pass AtomicLiveWidget to AtomicPlayer.setView / AtomicPusher.setView to complete the video output pipeline; the live ID is bound by the player / pusher, so business code never needs to set it.

Data Structures

AtomicLiveViewType

Render type of AtomicLiveView.
Enum Value
Description
playView
Play view, used with AtomicPlayer.
pushView
Push view, used with AtomicPusher.

UnitInfo

Live unit info, describing a single seat rendered on the AtomicLiveView.
Property
Type
Description
index
Int
Unit index.
liveID
String
Live ID.
userID
String
User ID.
userName
String
User name.
avatarURL
String
Avatar URL.
microphoneStatus
Microphone status.
cameraStatus
Camera status.
userSuspendStatus
User suspend status.

AtomicLiveViewChangeAdapter

AtomicLiveView widget adapter. Implement this protocol to provide overlay sub-UIs for the current AtomicLiveView as needed, and receive callbacks such as video view frame changes. The SDK mounts them at the correct layer above the push preview view without affecting the underlying rendering. Returning nil from create* methods indicates that the view does not need that type of widget.
Methods
onCreateUnitView: Build the seat widget view when a unit is newly added; use onUpdateUnitView to refresh its content later.
Widget? onCreateUnitView(UnitInfo unitInfo);
Parameter
Type
Description
unitInfo
UnitInfo
Live unit info.
onUpdateUnitView: Update an existing seat widget view when its business fields change.
void onUpdateUnitView(UnitInfo unitInfo, Key? view);
Parameter
Type
Description
unitInfo
UnitInfo
Latest live unit info.
view
Key?
The current widget view of this seat, or nil if the seat has no widget yet.
onVideoViewFrameChanged: Video view frame change callback. Triggered by the SDK when the position / size of the co-guest seat video view changes. The business side can use this to synchronously adjust the layout of custom widgets overlaid on it. Positions are expressed as ratios relative to the parent container, in the range 0, 1.
void onVideoViewFrameChanged(double left, double top, double right, double bottom);
Parameter
Type
Description
left
double
Ratio of the top-left point from the left edge.
top
double
Ratio of the top-left point from the top edge.
right
double
Ratio of the bottom-right point from the left edge.
bottom
double
Ratio of the bottom-right point from the top edge.
onVolumeChanged: Speaking volume change callback. Triggered by the SDK when the speaking volume of a seat user changes, for both the play side (volume carried by the stream) and the push side (local capture and remote co-guest users). The callback is only delivered when the volume of that user actually changes.
void onVolumeChanged(UnitInfo unitInfo, int volume, Key? view);
Parameter
Type
Description
unitInfo
UnitInfo
Live unit info of the seat whose volume changed.
volume
int
Latest speaking volume of this seat user, in the range 0 to 100.
view
Key?
Key identifying the current widget of this seat, or null if the seat has no widget yet.

AtomicLiveController

Controller of the minimal atomic live view, exposing the active interfaces of the widget. The live ID is bound by AtomicPlayer / AtomicPusher when the render view is handed to them, so the controller exposes no live ID setter.
Methods
create: Create AtomicLiveController.
static AtomicLiveController create(AtomicLiveViewType viewType) {
return AtomicLiveControllerImpl(viewType);
}
Parameter
Type
Description
viewType
Atomic live view type, play or push.
setViewChangeAdapter: Sets the view adapter used to overlay custom widget UIs on the view (e.g., beauty panel, mute / flip control bar, co-guest seats, countdown, etc.). The returned views are overlaid on the video without affecting the underlying rendering.
void setViewChangeAdapter(AtomicLiveViewChangeAdapter adapter);
Parameter
Type
Description
adapter
View adapter.


Ajuda e Suporte

Esta página foi útil?

comentários