tencent cloud

Mobile Live Video Broadcasting

AtomicLiveView

Download
Focus Mode
Font Size
Last updated: 2026-11-02 17:31:51
AI-Translated

Introduction

A lightweight standalone 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 this view to AtomicPlayer.setView(_:) / AtomicPusher.setView(_:) to complete the video output pipeline.

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.
func onCreateUnitView(unitInfo: UnitInfo?) -> UIView?
Parameter
Type
Description
unitInfo
Live unit info.
onUpdateUnitView: Update an existing seat widget view when its business fields change.
func onUpdateUnitView(unitInfo: UnitInfo?, view: UIView?)
Parameter
Type
Description
unitInfo
Latest live unit info.
view
UIView?
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.
func onVideoViewFrameChanged(left: CGFloat, top: CGFloat, right: CGFloat, bottom: CGFloat)
Parameter
Type
Description
left
CGFloat
Ratio of the top-left point from the left edge.
top
CGFloat
Ratio of the top-left point from the top edge.
right
CGFloat
Ratio of the bottom-right point from the left edge.
bottom
CGFloat
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.
func onVolumeChanged(unitInfo: UnitInfo?, volume: Int, view: UIView?)
Parameter
Type
Description
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
UIView?
The current widget view of this seat, or nil if the seat has no widget yet.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback