tencent cloud

Mobile Live Video Broadcasting

Release Notes and Announcements
TUILiveKit Release Notes
Live SDK Release Notes
User Guide
Product Introduction
Overview
Strengths
Performance Statistics
Concepts
Purchase Guide
TRTC Live Billing Overview
Billing of Video Live Component
Activating the Service (TUILiveKit)
Free Demo
Demo
Run Demo(TUILiveKit)
Integration Guide
Video Live Streaming
Preparation
Host Live Streaming
Audience Viewing
Live Stream List Live Stream List
Voice Chat Room
Preparation
Host Live Streaming
Audience Viewing
Live Stream List
Live Streaming Kit
Live Streaming Kit(Electron Desktop Application)
Live Streaming Kit(Web Desktop Browser)
Live Broadcast Monitoring
Monitoring Webpage (Web Desktop Browser React)
Monitoring Webpage (Web Desktop Browser Vue)
UI Customization
Live Stream Video Component
Video Source Editing Canvas
Audience List Component
Barrage Component
Media Source Configuration Panel
Link Management Panel
Live Gift Component
No UI Integration
Video Live Streaming
Voice Chat Room
Feature Guide
Follow Anchors (TUILiveKit)
Ultimate Image Quality (TUILiveKit)
Push Media Stream Into Room (TUILiveKit)
Gift System (TUILiveKit)
Client APIs
Android
iOS
Web
Server APIs (TUILiveKit)
Account System
REST API
Third-Party Webhooks
Error Codes (TUILiveKit)
FAQs
Platform Compilation
User Authentication
Live SDK
Product Introduction
Purchase Guide
Free Demo
Free Trial License
SDK Download
Licenses
Advanced Features
Client API
FAQs
Integration (No UI)
API Documentation
OSS information
OSS Attribution Notice

V2TXLivePlayerObserver

Focus Mode
Font Size
Last updated: 2026-03-27 17:23:03
Copyright (c) 2021 Tencent. All rights reserved.

Module: V2TXLivePlayerObserver @ TXLiteAVSDK

Function: Tencent Cloud live player callback notification


Function

Player callback notification for Tencent Cloud Live.

Introduce

You can receive some callback notifications from the V2TXLivePlayer player, including player status, playback volume callback, audio and video first frame callback, statistical data, warning and error messages, etc.

V2TXLivePlayerObserver

V2TXLivePlayerObserver

FuncList
DESC
live player error notification, which is called back when the player encounters an error
live player warning notification
live player resolution change notification
live player has successfully connected to the server notification
Video playback event
Audio playback event
Video loading event
Audio loading event
Player playback volume callback
Live player statistics callback
Screenshot callback
Custom video rendering callback
Audio Data callback
Callback of receiving an SEI message. The sender calls sendSeiMessage in V2TXLivePusher to send an SEI
Resolution stream switch callback
Picture-in-Picture state change callback
The SDK returns this callback when you call startLocalRecording to start local recording.
The SDK returns this callback when you call startLocalRecording to start local recording, which means recording task in progress.
The SDK returns this callback when you call stopLocalRecording to start local recording.

onError:code:message:extraInfo:

onError:code:message:extraInfo:
- (void)onError:
(id<V2TXLivePlayer>)player
code:
(V2TXLiveCode)code
message:
(NSString *)msg
extraInfo:
(NSDictionary *)extraInfo
live player error notification, which is called back when the player encounters an error
Param
DESC
code
Error code V2TXLiveCode.
extraInfo
Extended information.
msg
Error message.
player
Player object that calls back this notification.

onWarning:code:message:extraInfo:

onWarning:code:message:extraInfo:
- (void)onWarning:
(id<V2TXLivePlayer>)player
code:
(V2TXLiveCode)code
message:
(NSString *)msg
extraInfo:
(NSDictionary *)extraInfo
live player warning notification
Param
DESC
code
Warning code V2TXLiveCode.
extraInfo
Extended information.
msg
Warning message.
player
Player object that calls back this notification.

onVideoResolutionChanged:width:height:

onVideoResolutionChanged:width:height:
- (void)onVideoResolutionChanged:
(id<V2TXLivePlayer>)player
width:
(NSInteger)width
height:
(NSInteger)height
live player resolution change notification
Param
DESC
height
Video height.
player
Player object that calls back this notification.
width
Video width.

onConnected:extraInfo:

onConnected:extraInfo:
- (void)onConnected:
(id<V2TXLivePlayer>)player
extraInfo:
(NSDictionary *)extraInfo
live player has successfully connected to the server notification
Param
DESC
extraInfo
Extended information.
player
Player object that calls back this notification.

onVideoPlaying:firstPlay:extraInfo:

onVideoPlaying:firstPlay:extraInfo:
- (void)onVideoPlaying:
(id<V2TXLivePlayer>)player
firstPlay:
(BOOL)firstPlay
extraInfo:
(NSDictionary *)extraInfo
Video playback event
Param
DESC
extraInfo
Extended information.
firstPlay
Play for the first time.
player
Player object that calls back this notification.

onAudioPlaying:firstPlay:extraInfo:

onAudioPlaying:firstPlay:extraInfo:
- (void)onAudioPlaying:
(id<V2TXLivePlayer>)player
firstPlay:
(BOOL)firstPlay
extraInfo:
(NSDictionary *)extraInfo
Audio playback event
Param
DESC
extraInfo
Extended information.
firstPlay
Play for the first time.
player
Player object that calls back this notification.

onVideoLoading:extraInfo:

onVideoLoading:extraInfo:
- (void)onVideoLoading:
(id<V2TXLivePlayer>)player
extraInfo:
(NSDictionary *)extraInfo
Video loading event
Param
DESC
extraInfo
Extended information.
player
Player object that calls back this notification.

onAudioLoading:extraInfo:

onAudioLoading:extraInfo:
- (void)onAudioLoading:
(id<V2TXLivePlayer>)player
extraInfo:
(NSDictionary *)extraInfo
Audio loading event
Param
DESC
extraInfo
Extended information.
player
Player object that calls back this notification.

onPlayoutVolumeUpdate:volume:

onPlayoutVolumeUpdate:volume:
- (void)onPlayoutVolumeUpdate:
(id<V2TXLivePlayer>)player
volume:
(NSInteger)volume
Player playback volume callback
Param
DESC
player
Player object that calls back this notification.
volume
Current playback volume.
Note
This callback notification is received after enableVolumeEvaluation is called to enable playback volume display.

onStatisticsUpdate:statistics:

onStatisticsUpdate:statistics:
- (void)onStatisticsUpdate:
(id<V2TXLivePlayer>)player
statistics:
(V2TXLivePlayerStatistics *)statistics
Live player statistics callback
Param
DESC
player
Player object that calls back this notification.
statistics
Player statistics V2TXLivePlayerStatistics.

onSnapshotComplete:image:

onSnapshotComplete:image:
- (void)onSnapshotComplete:
(id<V2TXLivePlayer>)player
image:
(nullable TXImage *)image
Screenshot callback
Param
DESC
image
Captured video image.
player
Player object that calls back this notification.
Note
This callback notification is received after snapshot is called to snapshot.

onRenderVideoFrame:frame:

onRenderVideoFrame:frame:
- (void)onRenderVideoFrame:
(id<V2TXLivePlayer>)player
frame:
(V2TXLiveVideoFrame *)videoFrame
Custom video rendering callback
Param
DESC
player
Player object that calls back this notification.
videoFrame
Video frame data V2TXLiveVideoFrame.
Note
Need you call enableObserveVideoFrame to turn on the callback switch.

onPlayoutAudioFrame:frame:

onPlayoutAudioFrame:frame:
- (void)onPlayoutAudioFrame:
(id<V2TXLivePlayer>)player
frame:
(V2TXLiveAudioFrame *)audioFrame
Audio Data callback
Param
DESC
aduioFrame
Audio frame data V2TXLiveAudioFrame.
player
Player object that calls back this notification.
Note
Need you call enableObserveAudioFrame to turn on the callback switch. Please use the data of audioFrame in the current callback.

onReceiveSeiMessage:payloadType:data:

onReceiveSeiMessage:payloadType:data:
- (void)onReceiveSeiMessage:
(id<V2TXLivePlayer>)player
payloadType:
(int)payloadType
data:
(NSData *)data
Callback of receiving an SEI message. The sender calls `sendSeiMessage` in {@link V2TXLivePusher} to send an SEI
Param
DESC
data
sei message data.
payloadType
The payload type of the received SEI message.
player
Player object that calls back this notification.
Note
You will receive this callback after calling enableReceiveSeiMessage in V2TXLivePlayer to enable the receiving of SEI.

onStreamSwitched:url:code:

onStreamSwitched:url:code:
- (void)onStreamSwitched:
(id<V2TXLivePlayer>)player
url:
(NSString *)url
code:
(NSInteger)code
Resolution stream switch callback
Param
DESC
code
Status code, 0:success, -1:timeout, -2:failed, server error, -3:failed, client error.
player
Player object that calls back this notification.
url
Switched playback address.
Note
This callback notification is received after switchStream is called to switch stream.

onPictureInPictureStateUpdate:state:message:extraInfo:

onPictureInPictureStateUpdate:state:message:extraInfo:
- (void)onPictureInPictureStateUpdate:
(id<V2TXLivePlayer>)player
state:
message:
(NSString *)msg
extraInfo:
(NSDictionary *)extraInfo
Picture-in-Picture state change callback
Param
DESC
extraInfo
Extended information.
player
Player object that calls back this notification.
state
Picture-in-Picture state。
Note
This callback notification is received after enablePictureInPicture is called to enable Picture-in-Picture.

onLocalRecordBegin:errCode:storagePath:

onLocalRecordBegin:errCode:storagePath:
- (void)onLocalRecordBegin:
(id<V2TXLivePlayer>)player
errCode:
(NSInteger)errCode
storagePath:
(NSString *)storagePath
The SDK returns this callback when you call {@link startLocalRecording} to start local recording.
Param
DESC
code
status.
0: successful.
-1: failed.
-2: unsupported format.
-6: recording has been started. Stop recording first.
-7: recording file already exists and needs to be deleted.
-8: recording directory does not have the write permission. Please check the directory permission.
player
Player object that calls back this notification.
storagePath
recording filePath.

onLocalRecording:durationMs:storagePath:

onLocalRecording:durationMs:storagePath:
- (void)onLocalRecording:
(id<V2TXLivePlayer>)player
durationMs:
(NSInteger)durationMs
storagePath:
(NSString *)storagePath
The SDK returns this callback when you call {@link startLocalRecording} to start local recording, which means recording task in progress.
Param
DESC
durationMs
recording duration.
player
Player object that calls back this notification.
storagePath
recording filePath.

onLocalRecordComplete:errCode:storagePath:

onLocalRecordComplete:errCode:storagePath:
- (void)onLocalRecordComplete:
(id<V2TXLivePlayer>)player
errCode:
(NSInteger)errCode
storagePath:
(NSString *)storagePath
The SDK returns this callback when you call {@link stopLocalRecording} to start local recording.
Param
DESC
code
status
0: successful.
-1: failed.
-2: Switching resolution or horizontal and vertical screen causes the recording to stop.
-3: recording duration is too short or no video or audio data is received. Check the recording duration or whether audio or video capture is enabled.
player
Player object that calls back this notification.
storagePath
recording filePath.

Help and Support

Was this page helpful?

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

Feedback