Tencent Cloud live player callback notification
Some V2TXLivePlayer callback notifications can be received, including the player status, playback volume callback, audio/video first-frame callback, statistics, warning, and error messages.
◆ liteav::V2TXLivePlayerObserver
class liteav::V2TXLivePlayerObserver |
Public Member Functions |
virtual | ~V2TXLivePlayerObserver () |
|
virtual void | onError (V2TXLivePlayer *player, int32_t code, const char *msg, void *extraInfo) |
|
virtual void | onWarning (V2TXLivePlayer *player, int32_t code, const char *msg, void *extraInfo) |
|
virtual void | onConnected (V2TXLivePlayer *player, void *extraInfo) |
|
virtual void | onVideoPlaying (V2TXLivePlayer *player, bool firstPlay, void *extraInfo) |
|
virtual void | onAudioPlaying (V2TXLivePlayer *player, bool firstPlay, void *extraInfo) |
|
virtual void | onVideoLoading (V2TXLivePlayer *player, void *extraInfo) |
|
virtual void | onAudioLoading (V2TXLivePlayer *player, void *extraInfo) |
|
virtual void | onPlayoutVolumeUpdate (V2TXLivePlayer *player, int32_t volume) |
|
virtual void | onStatisticsUpdate (V2TXLivePlayer *player, V2TXLivePlayerStatistics statistics) |
|
virtual void | onSnapshotComplete (V2TXLivePlayer *player, const char *image, int length, int width, int height, V2TXLivePixelFormat format) |
|
virtual void | onRenderVideoFrame (V2TXLivePlayer *player, const V2TXLiveVideoFrame *videoFrame) |
|
virtual void | onReceiveSeiMessage (V2TXLivePlayer *player, int payloadType, const uint8_t *data, uint32_t dataSize) |
|
◆ ~V2TXLivePlayerObserver()
◆ onAudioLoading()
virtual void onAudioLoading |
( |
V2TXLivePlayer * |
player, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
Audio loading event
- Parameters
-
player | Player object that calls back this notification |
extraInfo | Extended information |
◆ onAudioPlaying()
virtual void onAudioPlaying |
( |
V2TXLivePlayer * |
player, |
|
|
bool |
firstPlay, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
Audio playback event
- Parameters
-
player | Player object that calls back this notification |
firstPlay | Play for the first time |
extraInfo | Extended information |
◆ onConnected()
virtual void onConnected |
( |
V2TXLivePlayer * |
player, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
live player has successfully connected to the server notification
- Parameters
-
player | Player object that calls back this notification |
extraInfo | Extended information |
◆ onError()
virtual void onError |
( |
V2TXLivePlayer * |
player, |
|
|
int32_t |
code, |
|
|
const char * |
msg, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
live player error notification, which is called back when the player encounters an error
- Parameters
-
player | Player object that calls back this notification |
code | Error code V2TXLiveCode |
msg | Error message |
extraInfo | Extended information |
◆ onPlayoutVolumeUpdate()
virtual void onPlayoutVolumeUpdate |
( |
V2TXLivePlayer * |
player, |
|
|
int32_t |
volume |
|
) |
| |
|
inlinevirtual |
Player playback volume callback.
- Attention
- This callback notification is received after V2TXLivePlayer#enableVolumeEvaluation(int) is called to enable playback volume display.
- Parameters
-
player | Player object that calls back this notification |
volume | Current playback volume |
◆ onReceiveSeiMessage()
virtual void onReceiveSeiMessage |
( |
V2TXLivePlayer * |
player, |
|
|
int |
payloadType, |
|
|
const uint8_t * |
data, |
|
|
uint32_t |
dataSize |
|
) |
| |
|
inlinevirtual |
Callback of receiving an SEI message. The sender calls sendSeiMessage
in V2TXLivePusher to send an SEI message.
- Attention
- You will receive this callback after calling
enableReceiveSeiMessage
in V2TXLivePlayer to enable the receiving of SEI messages.
- Parameters
-
player | Player object that calls back this notification |
payloadType | The payload type of the received sei message |
data | sei message data |
dataSize | sei message data size |
◆ onRenderVideoFrame()
Custom video rendering callback
- Attention
- Need you call V2TXLivePlayer::enableObserveVideoFrame:pixelFormat:bufferType: "enableObserveVideoFrame" to turn on the callback switch.
- Parameters
-
player | Player object that calls back this notification |
videoFrame | Video frame data V2TXLiveVideoFrame |
◆ onSnapshotComplete()
Screenshot callback
- Attention
- This callback notification is received after snapshot is called to snapshot.
- Parameters
-
player | Player object that calls back this notification |
image | Screenshot data. If it is nullptr , it indicates that the SDK failed to take the screenshot. |
length | Screenshot data length. In BGRA32 format, length = width * height * 4. |
width | Screenshot width |
height | Screenshot height |
format | Screenshot data format. Only TRTCVideoPixelFormat_BGRA32 is supported now. |
◆ onStatisticsUpdate()
Live player statistics callback.
- Parameters
-
◆ onVideoLoading()
virtual void onVideoLoading |
( |
V2TXLivePlayer * |
player, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
Video loading event
- Parameters
-
player | Player object that calls back this notification |
extraInfo | Extended information |
◆ onVideoPlaying()
virtual void onVideoPlaying |
( |
V2TXLivePlayer * |
player, |
|
|
bool |
firstPlay, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
Video playback event
- Parameters
-
player | Player object that calls back this notification |
firstPlay | Play for the first time |
extraInfo | Extended information |
◆ onWarning()
virtual void onWarning |
( |
V2TXLivePlayer * |
player, |
|
|
int32_t |
code, |
|
|
const char * |
msg, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
live player warning notification
- Parameters
-
player | Player object that calls back this notification |
code | Warning code V2TXLiveCode |
msg | Warning message |
extraInfo | Extended information |