TalkfunSDKLifeLiveDelegate
房间事件回调
- 如果加入成功,code 会是一个正数(code > 0),代表加入房间成功)。 error 为nill
- 如果加入失败,code 会是一个负数(code < 0),代表进房失败的错误码。 error 有值
- 调用刷新refreshData: 也会重新回调
- 进房失败的错误码含义请参见[错误码 TalkfunSDK 文件的TalkfunError 枚举
- (void)onEnterRoom:(NSInteger)code result:(TFError*_Nonnull)error
接收别人的聊天事件回调
- (void)onDidReceiveText:(TFChatData*_Nullable)result
当前用户进入房间触发回调
- (void)onMemberJoinMe:(TFMember*_Nullable)result
其它人进入房间触发回调
- (void)onMemberJoinOther:(TFMember*_Nullable)result
有人退出房间
- (void)onMemberLeave:(TFMember*_Nullable)result
同时在线人数 (真实人+虚拟人员 的总数)
- (void)onPeakConcurrentUsers:(NSInteger)total
摄像头开启
- (void)onCameraShow
摄像头关闭
- (void)onCameraHide
直播间状态
- (void)onLiveStatus:(TalkfunLiveStatus)status
接收滚动通知事件回调
- (void)onAnnounceRoll:(TFAnnounceRoll*_Nullable)result
当前用户被踢出房间的事件回调
- (void)onMemberKick
推送弹窗广告的事件回调
- (void)onPopupPut:(TFPopupPut*_Nullable)result
商品列表的事件回调
- 商品状态变更时会实时更新列表
- self.lifeConfig.store.goods 与当前goods 是同一个列表
- (void)onGoodsUpdate:(NSMutableArray <TFgoods *>* _Nullable)goodsList
推送公告的事件回调
- (void)onAnnouncement:(TFAnnouncement*_Nullable)result
接收主播发起签到的事件回调
- (void)onSignNew:(TFSignNew*_Nullable)result
接收主播结束签到的事件回调
- (void)onSignEnd:(TFSignEnd*_Nullable)result
投票开始的事件回调
- (void)onVoteNew:(TFVoteData*_Nullable)result
投票结束的事件回调
- (void)onVotePub:(TFVoteData*_Nullable)result
删除投票的事件回调
- (void)onVoteDel:(TFVoteData*_Nullable)result
接收别人私聊的回调
- (void)onChatPrivate:(TFChatData*_Nullable)result
在线客服列表变更时会实时更新列表
- (void)onCustomerServiceListUpdate:(NSMutableArray <TFMember *>* _Nullable)list
主播回答了问题
- (void)onQuestionReply:(TFQuestionData*_Nonnull)result
提问删除
- (void)onQuestionDelete:(TFQuestionData*_Nonnull)result
接收别人的提问
- (void)onQuestionAsk:(TFQuestionData*_Nonnull)result
提问审核通过
- (void)onQuestionAudit:(TFQuestionData*_Nonnull)result
抽奖开始
- (void)onLotteryStart:(TFLotteryStart*_Nonnull)result
抽奖结束
- (void)onLotteryStop:(TFLotteryStop*_Nonnull)result
单体禁言
- (void)onChatDisable:(BOOL)state
全体禁言
- (void)onChatDisableAll:(BOOL)state;
监听别人的点赞
- (void)onLikePut:(TFLikeData*_Nullable)likeData
-----------------------属性与方法------------------------
代理对象
@property (nonatomic, weak) id<TalkfunSDKLifeLiveDelegate> _Nullable delegate;
配置视频窗口容器
@property (nonatomic,strong) UIView * _Nullable cameraContainerView;
音量
@property (nonatomic,assign) CGFloat playVolume;
是否显示访客人数
- onEnterRoom:result:()回调后,visitors的值才准确
@property (nonatomic,assign)BOOL visitors;
主播数据
- onEnterRoom:result:()回调后,zhubo的值才准确
- 详见 TFZhubo.h 中的定义
@property (nonatomic,strong)TFZhubo * _Nullable zhubo;
摄像头开关
- onEnterRoom:result:()回调后, isCamera的值才准确
@property (nonatomic,assign)BOOL isCamera;
单体禁言
- onEnterRoom:result:()回调后, isChatDisable的值才准确
@property (nonatomic,assign)BOOL isChatDisable;
全体禁言
- onEnterRoom:result:()回调后, isDisableall的值才准确
@property (nonatomic,assign)BOOL isDisableall;
同时在线人数
- onEnterRoom:result:()回调后, peakConcurrentUsers的值才准确
@property (nonatomic,assign)NSInteger peakConcurrentUsers;
课程开始的时间戳
- onEnterRoom:result:()回调后, startTime的值才准确
@property (nonatomic,assign)NSInteger startTime;
获取生活直播相关配置
- onEnterRoom:result:()回调后, roomInfo的值才准确
@property (nonatomic,strong)TFLifeRoomInfo * _Nullable roomInfo;
课程开始的时间戳
- onEnterRoom:result:()回调后, liveStatus的值才准确
直播间状态
@property (nonatomic, assign)TalkfunLiveStatus liveStatus;
默认点赞数
- onEnterRoom:result:()回调后, LikeResult的值才准确
@property (nonatomic, strong)TFLikeData * _Nullable likeResult;
在线的客服列表
- onEnterRoom:result:()回调后, serviceList的值才准确
@property (nonatomic, strong)NSMutableArray<TFMember *>* _Nullable serviceList;
视频显示模式
- 默认 TalkfunMovieScalingModeAspectFit
@property (nonatomic,assign) TalkfunMovieScalingMode scalingMode;
创建 TalkfunSDKLifeLive 单例
+ (instancetype _Nullable )sharedInstance;
销毁 TalkfunSDKLifeLive 单例
- (void)destroySharedIntance;
进入房间
- 调用 enterRoom() 接口执行进房操作后,会收到来自 SDK 的 onEnterRoom:result:() 回调:
- @param param 进房参数,请参考 TFInitParams
- (void)enterRoom:(TFInitParams *_Nullable)param;
发送聊天
- result result = 0 成功),result != 0 时为错误码。
- (void)sendChat:(NSString *_Nullable)msg callback:(void (^__nullable) (NSInteger code, TFChatData*_Nullable model ,TFError *_Nullable error))callback;
发送私聊客服
- result result = 0 成功),result != 0 时为错误码。
- (void)sendChatPrivate:(NSString *_Nullable)xid msg:(NSString*_Nullable)msg callback:(void (^__nullable)(NSInteger code , TFChatData *_Nullable model,TFError *_Nullable error))callback;
发起提问
- (void)enterAskQuestions:(NSString *_Nullable)msg callback:(void (^__nullable) (NSInteger code, TFQuestionData*_Nullable model ,TFError *_Nullable error))callback;
获取提问列表
- (void)getAListOfQuestions:(void (^__nullable) (NSInteger code, NSMutableArray <TFQuestionData *>*_Nullable list ,TFError *_Nullable error))callback;
刷新SDK
- (void)refreshData;
获取网络线路组 2.0
- (void)getLineList:(void (^_Nullable)(TFLiveLineManager * _Nullable result))callback;
设置线路 2.0
- 例子
- "operatorID" : "telecom" 网络类型
- "selectedSegmentIndex" : 0, 组索引
- (void)setNetwork:(NSString *_Nonnull)operatorID selectedSegmentIndex:(NSInteger)selectedSegmentIndex callback:(void (^__nullable)(NSInteger code ,TFError *_Nullable error))callback;
点赞
- (void)likeClick:(void (^__nullable)(NSInteger code , TFLikeData *_Nullable model,TFError *_Nullable error))callback;
获取邀请榜单
- (void)getInvitationList:(void (^__nullable)(NSInteger code , TFInvitationListData *_Nullable model,TFError *_Nullable error))callback;
举报主播
- (void)reportingMembers:(NSString*_Nullable)msg callback:(void (^__nullable)(NSInteger code , TFError *_Nullable error))callback;
配置ppt容器(可用于重新设置ppt容器)
- (void)configurePPTContainerView:(UIView *_Nonnull)pptContainerView;
进入后台时是否暂停音频(默认暂停YES)
- (void)setPauseInBackground:(BOOL)pause;
签到
- (void)signIn:(NSString*_Nullable)signId callback:(void (^__nullable)(NSInteger code , TFError *_Nullable error))callback;
获取投票列表 2.0
- (void)getVotingList:(void (^__nullable)(NSInteger code ,NSMutableArray <TFVoteData *>*_Nullable list ,TFError *_Nullable error))callback;
获取投票ID详情 2.0
- (void)getVotingDetails:(NSString*_Nullable)vid callback:(void (^__nullable)(NSInteger code , TFVoteData *_Nullable model,TFError *_Nullable error))callback;
确认投票 2.0
- (void)voteSubmit:(TFSubmit*_Nullable)model callback:(void (^__nullable)(NSInteger code , TFError *_Nullable error))callback;
上传图片生成url链接
- 如果发送成功,code 会是0 error 等于nill imageUrl 会有值
- 如果发送失败,code 会是!=0 error会有值
- (void)uploadingpicImg:(UIImage*_Nonnull)image callback:(void (^__nullable)(NSInteger code , NSString *_Nullable imageUrl,TFError *_Nullable error))callback;