JLChen
2021-11-04 1443556e9ccb1a19ed8e6710c16c8adc4d4f4fb3
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//
//  LiveVideoViewController.h
//  LCOpenSDKDemo
//
//  Created by mac318340418 on 16/7/13.
//  Copyright © 2016年 lechange. All rights reserved.
//
 
#import "LCOpenSDK_AudioTalk.h"
#import "LCOpenSDK_PlayWindow.h"
#import "LCOpenSDK_EventListener.h"
#import "LCOpenSDK_TalkerListener.h"
#import "LCBasicViewController.h"
//#import "VideoPlay.h"
#import <UIKit/UIKit.h>
 
#define RTSP_Result_String(enum) [@[ @"0", @"1", @"2", @"3", @"4", @"5", @"6", @"7", @"99", @"100" ] objectAtIndex:enum]
 
typedef NS_ENUM(NSInteger, PlayerResultCode) {
    STATE_RTSP_PACKET_FRAME_ERROR = 0, // 组帧失败,错误状态
    STATE_RTSP_TEARDOWN_ERROR,         // 内部要求关闭,如连接断开等,错误状态
    STATE_RTSP_DESCRIBE_READY,         // 会话已经收到Describe响应,连接建立中
    STATE_RTSP_AUTHORIZATION_FAIL,     // RTSP鉴权失败,错误状态
    STATE_RTSP_PLAY_READY,             // 收到PLAY响应,连接成功
    STATE_RTSP_FILE_PLAY_OVER,         // 录像文件回放正常结束
    STATE_RTSP_PLAY_PAUSE,             // 收到PAUSE响应
    STATE_RTSP_ERROR_KEY,              // 密钥错误
    STATE_RTSP_SERVICE_UNAVAILABEL,    // 基于503错误吗的连接最大数错误,错误状态
    STATE_RTSP_USER_INFO_BASE_STAT,     // 用户信息起始码,服务端上层传过来的信息码会在该起始码基础上累加,错误状态
    STATE_HTTP_PRIVATE_PLAY = 1000
};
 
typedef NS_ENUM(NSInteger, ProgressIndType) {
    VIDEO_PROGRESS_IND = 0,
    TALK_PROGRESS_IND = 1
};
 
@interface LiveVideoViewController : LCBasicViewController <LCOpenSDK_EventListener> {
    LCOpenSDK_PlayWindow* m_play;
    LCOpenSDK_AudioTalk* m_talker;
    UIImageView* m_screenImg;
    UIButton* m_replayBtn;
    UIView* livePlayBarView;
    UIButton* m_HDBtn;
    UIButton* m_PTZBtn;
    UIButton* m_fullScreenBtn;
    UIButton* m_soundBtn;
    UIButton* m_snapBtn;
    UIButton* m_talkBtn;
    UIButton* m_recordBtn;
    UILabel* m_tipLab;
 
    NSString* m_accessToken;
    NSString* m_strDevSelected;
    NSString* m_encryptKey;
    NSInteger m_devChnSelected;
    UIImage* m_imgPicSelected;
    NSString* m_devAbilitySelected;
 
    UIActivityIndicatorView* m_videoProgressInd;
    UIActivityIndicatorView* m_talkProgressInd;
}
 
- (void)setInfo:(NSString*)token Dev:(NSString*)deviceId Key:(NSString*)key Chn:(NSInteger)chn Img:(UIImage*)img Abl:(NSString*)abl;
- (void)onPlayerResult:(NSString*)code Type:(NSInteger)type Index:(NSInteger)index;
- (void)onPlayBegan:(NSInteger)index;
- (void)onReceiveData:(NSInteger)len Index:(NSInteger)index;
- (void)onStreamCallback:(NSData*)data Index:(NSInteger)index;
- (void)onTalkResult:(NSString*)error TYPE:(NSInteger)type;
- (void)onControlClick:(CGFloat)currentX dy:(CGFloat)currentY Index:(NSInteger)index;
- (void)onWindowDBClick:(CGFloat)currentX dy:(CGFloat)currentY Index:(NSInteger)index;
- (void)onWindowLongPressBegin:(Direction)dir dx:(CGFloat)currentX dy:(CGFloat)currentY Index:(NSInteger)index;
- (void)onWindowLongPressEnd:(NSInteger)index;
- (void)onSlipBegin:(Direction)dir dx:(CGFloat)dx dy:(CGFloat)dy Index:(NSInteger)index;
- (void)onSlipping:(Direction)dir preX:(CGFloat)preX preY:(CGFloat)preY dx:(CGFloat)currentX dy:(CGFloat)currentY Index:(NSInteger)index;
- (void)onSlipEnd:(Direction)dir dx:(CGFloat)currentX dy:(CGFloat)currentY Index:(NSInteger)index;
- (void)onZooming:(CGFloat)scale Index:(NSInteger)index;
- (void)onZoomEnd:(ZoomType)zoom Index:(NSInteger)index;
 
- (void)onActive:(id)sender;
- (void)onResignActive:(id)sender;
 
@end