腾讯云直播SDKV2TXLivePlayerObserver_音视频解决方案_同尘科技

直播SDK 1年前 (2023-10-19) 浏览 27

Copyright (c) 2021 Tencent. All rights reserved.
Module: V2TXLivePlayerObserver @ TXLiteAVSDK
Function: 腾讯云直播的播放器回调通知

功能

腾讯云直播的播放器回调通知。

介绍

可以接收 V2TXLivePlayer 播放器的一些回调通知,包括播放器状态、播放音量回调、音视频首帧回调、统计数据、警告和错误信息等。
V2TXLivePlayerObserver

V2TXLivePlayerObserver

函数列表 描述
onError:code:message:extraInfo: 直播播放器错误通知,播放器出现错误时,会回调该通知
onWarning:code:message:extraInfo: 直播播放器警告通知
onVideoResolutionChanged:width:height: 直播播放器分辨率变化通知
onConnected:extraInfo: 已经成功连接到服务器
onVideoPlaying:firstPlay:extraInfo: 视频播放事件
onAudioPlaying:firstPlay:extraInfo: 音频播放事件
onVideoLoading:extraInfo: 视频加载事件
onAudioLoading:extraInfo: 音频加载事件
onPlayoutVolumeUpdate:volume: 播放器音量大小回调
onStatisticsUpdate:statistics: 直播播放器统计数据回调
onSnapshotComplete:image: 截图回调
onRenderVideoFrame:frame: 自定义视频渲染回调
onPlayoutAudioFrame:frame: 音频数据回调
onReceiveSeiMessage:payloadType:data: 收到 SEI 消息的回调,发送端通过 V2TXLivePusher 中的 sendSeiMessage 来发送 SEI 消息
onStreamSwitched:url:code: 分辨率无缝切换回调
onPictureInPictureStateUpdate:state:message:extraInfo: 画中画状态变更回调

onError:code:message:extraInfo:

onError:code:message:extraInfo:

– (void)onError: (id)player
code: (V2TXLiveCode)code
message: (NSString *)msg
extraInfo: (NSDictionary *)extraInfo

直播播放器错误通知,播放器出现错误时,会回调该通知

参数 描述
code 错误码 V2TXLiveCode。
extraInfo 扩展信息。
msg 错误信息。
player 回调该通知的播放器对象。

onWarning:code:message:extraInfo:

onWarning:code:message:extraInfo:

– (void)onWarning: (id)player
code: (V2TXLiveCode)code
message: (NSString *)msg
extraInfo: (NSDictionary *)extraInfo

直播播放器警告通知

参数 描述
code 警告码 V2TXLiveCode。
extraInfo 扩展信息。
msg 警告信息。
player 回调该通知的播放器对象。

onVideoResolutionChanged:width:height:

onVideoResolutionChanged:width:height:

– (void)onVideoResolutionChanged: (id)player
width: (NSInteger)width
height: (NSInteger)height

直播播放器分辨率变化通知

参数 描述
height 视频高。
player 回调该通知的播放器对象。
width 视频宽。

onConnected:extraInfo:

onConnected:extraInfo:

– (void)onConnected: (id)player
extraInfo: (NSDictionary *)extraInfo

已经成功连接到服务器

参数 描述
extraInfo 扩展信息。
player 回调该通知的播放器对象。

onVideoPlaying:firstPlay:extraInfo:

onVideoPlaying:firstPlay:extraInfo:

– (void)onVideoPlaying: (id)player
firstPlay: (BOOL)firstPlay
extraInfo: (NSDictionary *)extraInfo

视频播放事件

参数 描述
extraInfo 扩展信息。
firstPlay 第一次播放标志。
player 回调该通知的播放器对象。

onAudioPlaying:firstPlay:extraInfo:

onAudioPlaying:firstPlay:extraInfo:

– (void)onAudioPlaying: (id)player
firstPlay: (BOOL)firstPlay
extraInfo: (NSDictionary *)extraInfo

音频播放事件

参数 描述
extraInfo 扩展信息。
firstPlay 第一次播放标志。
player 回调该通知的播放器对象。

onVideoLoading:extraInfo:

onVideoLoading:extraInfo:

– (void)onVideoLoading: (id)player
extraInfo: (NSDictionary *)extraInfo

视频加载事件

参数 描述
extraInfo 扩展信息。
player 回调该通知的播放器对象。

onAudioLoading:extraInfo:

onAudioLoading:extraInfo:

– (void)onAudioLoading: (id)player
extraInfo: (NSDictionary *)extraInfo

音频加载事件

参数 描述
extraInfo 扩展信息。
player 回调该通知的播放器对象。

onPlayoutVolumeUpdate:volume:

onPlayoutVolumeUpdate:volume:

– (void)onPlayoutVolumeUpdate: (id)player
volume: (NSInteger)volume

播放器音量大小回调

参数 描述
player 回调该通知的播放器对象。
volume 音量大小。

注意调用 enableVolumeEvaluation 开启播放音量大小提示之后,会收到这个回调通知。

onStatisticsUpdate:statistics:

onStatisticsUpdate:statistics:

– (void)onStatisticsUpdate: (id)player
statistics: (V2TXLivePlayerStatistics *)statistics

直播播放器统计数据回调

参数 描述
player 回调该通知的播放器对象。
statistics 播放器统计数据 V2TXLivePlayerStatistics。

onSnapshotComplete:image:

onSnapshotComplete:image:

– (void)onSnapshotComplete: (id)player
image: (nullable TXImage *)image

截图回调

参数 描述
image 已截取的视频画面。
player 回调该通知的播放器对象。

注意调用 snapshot 截图之后,会收到这个回调通知。

onRenderVideoFrame:frame:

onRenderVideoFrame:frame:

– (void)onRenderVideoFrame: (id)player
frame: (V2TXLiveVideoFrame *)videoFrame

自定义视频渲染回调

参数 描述
player 回调该通知的播放器对象。
videoFrame 视频帧数据 V2TXLiveVideoFrame。

注意需要您调用 enableObserveVideoFrame 开启回调开关。

onPlayoutAudioFrame:frame:

onPlayoutAudioFrame:frame:

– (void)onPlayoutAudioFrame: (id)player
frame: (V2TXLiveAudioFrame *)audioFrame

音频数据回调

参数 描述
audioFrame 音频帧数据 V2TXLiveAudioFrame。
player 回调该通知的播放器对象。

注意需要您调用 enableObserveAudioFrame 开启回调开关。请在当前回调中使用 audioFrame 的 data。

onReceiveSeiMessage:payloadType:data:

onReceiveSeiMessage:payloadType:data:

– (void)onReceiveSeiMessage: (id)player
payloadType: (int)payloadType
data: (NSData *)data

收到 SEI 消息的回调,发送端通过 {@link V2TXLivePusher} 中的 `sendSeiMessage` 来发送 SEI 消息

参数 描述
data 数据。
payloadType 回调数据的SEI payloadType。
player 回调该通知的播放器对象。

注意调用 V2TXLivePlayer 中的 enableReceiveSeiMessage 开启接收 SEI 消息之后,会收到这个回调通知。

onStreamSwitched:url:code:

onStreamSwitched:url:code:

– (void)onStreamSwitched: (id)player
url: (NSString *)url
code: (NSInteger)code

分辨率无缝切换回调

参数 描述
code 状态码,0:成功,-1:切换超时,-2:切换失败,服务端错误,-3:切换失败,客户端错误。
player 回调该通知的播放器对象。
url 切换的播放地址。

注意调用 V2TXLivePlayer 中的 switchStream 切换分辨率,会收到这个回调通知。

onPictureInPictureStateUpdate:state:message:extraInfo:

onPictureInPictureStateUpdate:state:message:extraInfo:

– (void)onPictureInPictureStateUpdate: (id)player
state: (V2TXLivePictureInPictureState)state
message: (NSString *)msg
extraInfo: (NSDictionary *)extraInfo

画中画状态变更回调

参数 描述
extraInfo 扩展信息。
player 回调该通知的播放器对象。
state 画中画的状态。

注意调用 V2TXLivePlayer 中的 enablePictureInPicture 开启画中画之后,会收到这个回调通知。

对音视频的解决方案有疑惑?想了解解决方案收费? 联系解决方案专家

腾讯云限时活动1折起,即将结束: 马上收藏

同尘科技为腾讯云授权服务中心,购买腾讯云享受折上折,更有现金返利:同意关联,立享优惠

阿里云解决方案也看看?: 点击对比阿里云的解决方案

- 0人点赞 -

发表点评 (0条)

not found

暂无评论,你要说点什么吗?