YH_SocketService.h
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// YH_SocketService.h
// Yoho
//
// Created by Arthur on 16/6/16.
// Copyright © 2016年 YOHO. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "YH_BarrageViewController.h"
#import "M16HttpClient.h"
#import "YHL_Enums.h"
@protocol YH_SocketServiceDelegate <NSObject>
@optional
- (void)userPraised:(NSString *)currentTotalNum isSelfPraise:(BOOL)isSelf;
- (void)currentPeopleNumber:(NSString *)peopleNumber;
- (void)livePalyEnd:(NSString *)audienceNums likeNums:(NSString *)likeNums videoLen:(NSString *)videoLen;
- (void)liveOnlineNums:(NSString *)onlineNums likes:(NSString *)likes;
- (void)liveNotifyEndSuccess;
@end
@interface YH_SocketService : NSObject
@property (nonatomic, strong) YH_BarrageViewController *barrageViewController;
@property (nonatomic, strong) NSString *uid;
@property (nonatomic, strong) NSString *userName;
@property (nonatomic, strong) NSString *avartar;
@property (nonatomic, strong) NSString *room;
@property (nonatomic, strong) NSString *socketLiveHost;
@property (nonatomic, assign) NSInteger socketLivePort;
@property (nonatomic, weak) id<YH_SocketServiceDelegate> delegate;
@property (nonatomic, strong) NSArray *addressList;
- (BOOL)connect;
- (BOOL)writeDataWithParams:(NSDictionary *)params tag:(long)tag;
//登录
- (void)loginToServer;
//发消息
- (void)sendMessage:(NSString *)msg;
//用户点赞
- (void)userPraise;
//结束播放 //只有推流能调用
- (void)endPaly:(NSString *)videoLen;
//登出
-(void)logout;
//手动释放timer
//- (void)reset;
- (void)reConnect;
@end