Commit 366c0b8f4eee104752797d3e10f4b4ccc8a45c10

Authored by 王军波
2 parents ebbe49c1 a8c70646

Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/LiveVideoCloud

LiveVideoCloud.xcodeproj/project.pbxproj
@@ -66,8 +66,6 @@ @@ -66,8 +66,6 @@
66 4BD856121EBAD2640082061D /* ProgramModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856111EBAD2640082061D /* ProgramModel.m */; }; 66 4BD856121EBAD2640082061D /* ProgramModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856111EBAD2640082061D /* ProgramModel.m */; };
67 4BD856151EBAD31A0082061D /* NSString+UrlEncode.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856141EBAD31A0082061D /* NSString+UrlEncode.m */; }; 67 4BD856151EBAD31A0082061D /* NSString+UrlEncode.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856141EBAD31A0082061D /* NSString+UrlEncode.m */; };
68 4BD856181EBAD35C0082061D /* NSDictionary+Safety.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856171EBAD35C0082061D /* NSDictionary+Safety.m */; }; 68 4BD856181EBAD35C0082061D /* NSDictionary+Safety.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856171EBAD35C0082061D /* NSDictionary+Safety.m */; };
69 - 4BD856191EBAD4E30082061D /* CNLiveUserSystemSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BD855D21EBAC8B20082061D /* CNLiveUserSystemSDK.framework */; };  
70 - 4BD8561A1EBAD4E30082061D /* CNLiveUserSystemSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BD855D21EBAC8B20082061D /* CNLiveUserSystemSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };  
71 4BD8561D1EBAD6490082061D /* ZXConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD8561C1EBAD6490082061D /* ZXConst.m */; }; 69 4BD8561D1EBAD6490082061D /* ZXConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD8561C1EBAD6490082061D /* ZXConst.m */; };
72 810B64E01E779AE900133E15 /* LVCPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64DF1E779AE900133E15 /* LVCPlayer.m */; }; 70 810B64E01E779AE900133E15 /* LVCPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64DF1E779AE900133E15 /* LVCPlayer.m */; };
73 810B64E31E779AFE00133E15 /* LVCLivePlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64E21E779AFE00133E15 /* LVCLivePlayerController.m */; }; 71 810B64E31E779AFE00133E15 /* LVCLivePlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64E21E779AFE00133E15 /* LVCLivePlayerController.m */; };
@@ -89,9 +87,8 @@ @@ -89,9 +87,8 @@
89 8128E2881E8A6A3600B40E75 /* CNBarrageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8128E2851E8A6A3600B40E75 /* CNBarrageManager.m */; }; 87 8128E2881E8A6A3600B40E75 /* CNBarrageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8128E2851E8A6A3600B40E75 /* CNBarrageManager.m */; };
90 8128E2891E8A6A3600B40E75 /* CNBarrageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8128E2871E8A6A3600B40E75 /* CNBarrageView.m */; }; 88 8128E2891E8A6A3600B40E75 /* CNBarrageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8128E2871E8A6A3600B40E75 /* CNBarrageView.m */; };
91 8130911E1E84C0F0005F0BFF /* LVCMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 8130911D1E84C0F0005F0BFF /* LVCMessage.m */; }; 89 8130911E1E84C0F0005F0BFF /* LVCMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 8130911D1E84C0F0005F0BFF /* LVCMessage.m */; };
92 - 8157A0181EE1451800ADD6B9 /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8157A0171EE1451800ADD6B9 /* CNLivePlayerSDK.framework */; };  
93 - 8157A0191EE1452800ADD6B9 /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8157A0171EE1451800ADD6B9 /* CNLivePlayerSDK.framework */; };  
94 - 8157A01A1EE1452800ADD6B9 /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8157A0171EE1451800ADD6B9 /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 90 + 8178D4171F01FA2900AA78A4 /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8178D4161F01FA2900AA78A4 /* CNLivePlayerSDK.framework */; };
  91 + 8178D4191F01FA3600AA78A4 /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8178D4161F01FA2900AA78A4 /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
95 81A1B9A91E8277410079FF5F /* LVCInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A1B9A81E8277410079FF5F /* LVCInputView.m */; }; 92 81A1B9A91E8277410079FF5F /* LVCInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A1B9A81E8277410079FF5F /* LVCInputView.m */; };
96 81A482F81E88AFA20097A80A /* LVCFirstHeaderReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A482F71E88AFA20097A80A /* LVCFirstHeaderReusableView.m */; }; 93 81A482F81E88AFA20097A80A /* LVCFirstHeaderReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A482F71E88AFA20097A80A /* LVCFirstHeaderReusableView.m */; };
97 81A483021E88B0130097A80A /* LVCChatRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A483001E88B0130097A80A /* LVCChatRoomModel.m */; }; 94 81A483021E88B0130097A80A /* LVCChatRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A483001E88B0130097A80A /* LVCChatRoomModel.m */; };
@@ -257,8 +254,6 @@ @@ -257,8 +254,6 @@
257 D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; }; 254 D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; };
258 D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB31E6EC154003A77C8 /* HomeViewController.m */; }; 255 D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB31E6EC154003A77C8 /* HomeViewController.m */; };
259 D28F5FFF1E8BC7EF00914142 /* LVCUGCLiveListView.m in Sources */ = {isa = PBXBuildFile; fileRef = D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */; }; 256 D28F5FFF1E8BC7EF00914142 /* LVCUGCLiveListView.m in Sources */ = {isa = PBXBuildFile; fileRef = D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */; };
260 - D2994BA61E8F48DE00E8D2CC /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */; };  
261 - D2994BA71E8F48DE00E8D2CC /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA51E8F48DE00E8D2CC /* CNLiveMsgTools.framework */; };  
262 D2994BA81E8F490400E8D2CC /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */; }; 257 D2994BA81E8F490400E8D2CC /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */; };
263 D2994BA91E8F490400E8D2CC /* CNLiveChatManager.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 258 D2994BA91E8F490400E8D2CC /* CNLiveChatManager.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
264 D2994BAA1E8F490700E8D2CC /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA51E8F48DE00E8D2CC /* CNLiveMsgTools.framework */; }; 259 D2994BAA1E8F490700E8D2CC /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA51E8F48DE00E8D2CC /* CNLiveMsgTools.framework */; };
@@ -303,8 +298,7 @@ @@ -303,8 +298,7 @@
303 dstPath = ""; 298 dstPath = "";
304 dstSubfolderSpec = 10; 299 dstSubfolderSpec = 10;
305 files = ( 300 files = (
306 - 4BD8561A1EBAD4E30082061D /* CNLiveUserSystemSDK.framework in Embed Frameworks */,  
307 - 8157A01A1EE1452800ADD6B9 /* CNLivePlayerSDK.framework in Embed Frameworks */, 301 + 8178D4191F01FA3600AA78A4 /* CNLivePlayerSDK.framework in Embed Frameworks */,
308 D2994BA91E8F490400E8D2CC /* CNLiveChatManager.framework in Embed Frameworks */, 302 D2994BA91E8F490400E8D2CC /* CNLiveChatManager.framework in Embed Frameworks */,
309 D2994BAB1E8F490700E8D2CC /* CNLiveMsgTools.framework in Embed Frameworks */, 303 D2994BAB1E8F490700E8D2CC /* CNLiveMsgTools.framework in Embed Frameworks */,
310 ); 304 );
@@ -482,7 +476,7 @@ @@ -482,7 +476,7 @@
482 8128E2871E8A6A3600B40E75 /* CNBarrageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNBarrageView.m; sourceTree = "<group>"; }; 476 8128E2871E8A6A3600B40E75 /* CNBarrageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNBarrageView.m; sourceTree = "<group>"; };
483 8130911C1E84C0F0005F0BFF /* LVCMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCMessage.h; sourceTree = "<group>"; }; 477 8130911C1E84C0F0005F0BFF /* LVCMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCMessage.h; sourceTree = "<group>"; };
484 8130911D1E84C0F0005F0BFF /* LVCMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMessage.m; sourceTree = "<group>"; }; 478 8130911D1E84C0F0005F0BFF /* LVCMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMessage.m; sourceTree = "<group>"; };
485 - 8157A0171EE1451800ADD6B9 /* CNLivePlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLivePlayerSDK.framework; sourceTree = "<group>"; }; 479 + 8178D4161F01FA2900AA78A4 /* CNLivePlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLivePlayerSDK.framework; sourceTree = "<group>"; };
486 81A1B9A71E8277410079FF5F /* LVCInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCInputView.h; sourceTree = "<group>"; }; 480 81A1B9A71E8277410079FF5F /* LVCInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCInputView.h; sourceTree = "<group>"; };
487 81A1B9A81E8277410079FF5F /* LVCInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCInputView.m; sourceTree = "<group>"; }; 481 81A1B9A81E8277410079FF5F /* LVCInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCInputView.m; sourceTree = "<group>"; };
488 81A482F61E88AFA20097A80A /* LVCFirstHeaderReusableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCFirstHeaderReusableView.h; sourceTree = "<group>"; }; 482 81A482F61E88AFA20097A80A /* LVCFirstHeaderReusableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCFirstHeaderReusableView.h; sourceTree = "<group>"; };
@@ -859,14 +853,10 @@ @@ -859,14 +853,10 @@
859 files = ( 853 files = (
860 4BD855D31EBAC8B20082061D /* CNLiveUserSystemSDK.framework in Frameworks */, 854 4BD855D31EBAC8B20082061D /* CNLiveUserSystemSDK.framework in Frameworks */,
861 D25BF8A31E80C4FC007FB138 /* Accelerate.framework in Frameworks */, 855 D25BF8A31E80C4FC007FB138 /* Accelerate.framework in Frameworks */,
862 - D2994BA71E8F48DE00E8D2CC /* CNLiveMsgTools.framework in Frameworks */,  
863 - 8157A0181EE1451800ADD6B9 /* CNLivePlayerSDK.framework in Frameworks */, 856 + 8178D4171F01FA2900AA78A4 /* CNLivePlayerSDK.framework in Frameworks */,
864 D2575C7D1E76A4F300E3A8FC /* NHGiftAnimtionSDK.a in Frameworks */, 857 D2575C7D1E76A4F300E3A8FC /* NHGiftAnimtionSDK.a in Frameworks */,
865 D2994BAA1E8F490700E8D2CC /* CNLiveMsgTools.framework in Frameworks */, 858 D2994BAA1E8F490700E8D2CC /* CNLiveMsgTools.framework in Frameworks */,
866 - 4BD856191EBAD4E30082061D /* CNLiveUserSystemSDK.framework in Frameworks */,  
867 - D2994BA61E8F48DE00E8D2CC /* CNLiveChatManager.framework in Frameworks */,  
868 D2994BA81E8F490400E8D2CC /* CNLiveChatManager.framework in Frameworks */, 859 D2994BA81E8F490400E8D2CC /* CNLiveChatManager.framework in Frameworks */,
869 - 8157A0191EE1452800ADD6B9 /* CNLivePlayerSDK.framework in Frameworks */,  
870 ); 860 );
871 runOnlyForDeploymentPostprocessing = 0; 861 runOnlyForDeploymentPostprocessing = 0;
872 }; 862 };
@@ -1153,7 +1143,7 @@ @@ -1153,7 +1143,7 @@
1153 812E504E1E7699B9004F5FCD /* CNLiveSDK */ = { 1143 812E504E1E7699B9004F5FCD /* CNLiveSDK */ = {
1154 isa = PBXGroup; 1144 isa = PBXGroup;
1155 children = ( 1145 children = (
1156 - 8157A0171EE1451800ADD6B9 /* CNLivePlayerSDK.framework */, 1146 + 8178D4161F01FA2900AA78A4 /* CNLivePlayerSDK.framework */,
1157 D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */, 1147 D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */,
1158 D2994BA51E8F48DE00E8D2CC /* CNLiveMsgTools.framework */, 1148 D2994BA51E8F48DE00E8D2CC /* CNLiveMsgTools.framework */,
1159 D25BF87C1E7B8C78007FB138 /* KSYGPUResource.bundle */, 1149 D25BF87C1E7B8C78007FB138 /* KSYGPUResource.bundle */,
LiveVideoCloud/Classes/CNLiveSDK/CNLivePlayerSDK.framework/CNLivePlayerSDK
No preview for this file type
LiveVideoCloud/Classes/CNLiveSDK/CNLivePlayerSDK.framework/Headers/CNLiveGPUStreamerKit.h
@@ -109,6 +109,17 @@ @@ -109,6 +109,17 @@
109 - (void)startStreamWithUrl:(NSString *)url activityId:(NSString *)activityId success:(void (^)(void))successBlock failure:(void (^)(NSDictionary *errorDic))failureBlock; 109 - (void)startStreamWithUrl:(NSString *)url activityId:(NSString *)activityId success:(void (^)(void))successBlock failure:(void (^)(NSDictionary *errorDic))failureBlock;
110 110
111 111
  112 +/**
  113 + @abstract 暂停推流
  114 + @warning 恢复推流时根据情况调用 startStream: 或 startStreamWithUrl:方法
  115 + */
  116 +- (void)pauseStreaming;
  117 +
  118 +/**
  119 + * 主播端未停止推流,但是服务端认为该视频不合法,断开推流,接收到该通知主播端应结束推流(视讯云平台有效)
  120 + */
  121 +FOUNDATION_EXPORT NSString *const CNLiveServiceConnectBreakNotification NS_AVAILABLE_IOS(7_0);
  122 +
112 #pragma mark - 普通推流 123 #pragma mark - 普通推流
113 124
114 /** 125 /**
LiveVideoCloud/Classes/CNLiveSDK/CNLivePlayerSDK.framework/Headers/CNLiveMoviePlayerController.h
@@ -25,11 +25,12 @@ @@ -25,11 +25,12 @@
25 authSuccess:(void(^)(void))authSuccessBlock 25 authSuccess:(void(^)(void))authSuccessBlock
26 authFailed:(void(^)(NSDictionary *errorInfo))authFailedBlock; 26 authFailed:(void(^)(NSDictionary *errorInfo))authFailedBlock;
27 27
28 -/* 初始化直播播放器 初始化成功后才能对播放器进行设置(如:自动播放、是否开启硬件解码等)和调用准备播放视频方法(prepareToPlay) 28 +/* 初始化直播播放器(* 以channelId播放) 初始化成功后才能对播放器进行设置(如:自动播放、是否开启硬件解码等)和调用准备播放视频方法(prepareToPlay)
29 * 29 *
30 * 当前版本只支持单实例的CNLiveMoviePlayerController对象,多实例将导致播放异常 30 * 当前版本只支持单实例的CNLiveMoviePlayerController对象,多实例将导致播放异常
31 * 31 *
32 * channelId 直播视频Id 32 * channelId 直播视频Id
  33 + * agree 是否允许获取主播状态 YES:获取 NO:不获取
33 * authSuccess 初始化成功block 34 * authSuccess 初始化成功block
34 * authFailed 初始化失败block 回调一个errorInfo的字典 35 * authFailed 初始化失败block 回调一个errorInfo的字典
35 * 36 *
@@ -38,6 +39,29 @@ @@ -38,6 +39,29 @@
38 * - (void)retryToGetAnchorStatusResult:(void(^)(BOOL result))result;方法重新获取 39 * - (void)retryToGetAnchorStatusResult:(void(^)(BOOL result))result;方法重新获取
39 */ 40 */
40 - (instancetype)initLivePlayWithChannelId:(NSString *)channelId 41 - (instancetype)initLivePlayWithChannelId:(NSString *)channelId
  42 + anchorStatus:(BOOL)agree
  43 + authSuccess:(void(^)(void))authSuccessBlock
  44 + authFailed:(void(^)(NSDictionary *errorInfo))authFailedBlock
  45 + getAnchorStatusResult:(void(^)(BOOL result))result;
  46 +
  47 +
  48 +/* 初始化直播播放器(* 以channelId播放) 初始化成功后才能对播放器进行设置(如:自动播放、是否开启硬件解码等)和调用准备播放视频方法(prepareToPlay)
  49 + *
  50 + * 当前版本只支持单实例的CNLiveMoviePlayerController对象,多实例将导致播放异常
  51 + *
  52 + * channelId 直播视频Id (注* 若agree为YES时,必传,用于获取主播状态; 若agree为NO,可不传)
  53 + * activityId 活动Id
  54 + * agree 是否允许获取主播状态 YES:获取 NO:不获取
  55 + * authSuccess 初始化成功block
  56 + * authFailed 初始化失败block 回调一个errorInfo的字典
  57 + *
  58 + * result 获取主播状态 YES:获取状态成功
  59 + * NO:获取失败,不影响视频播放,但是获取不到主播离开、回来、直播结束等通知。可通过
  60 + * - (void)retryToGetAnchorStatusResult:(void(^)(BOOL result))result;方法重新获取
  61 + */
  62 +- (instancetype)initLivePlayWithChannelId:(NSString *)channelId
  63 + activityId:(NSString *)activityId
  64 + anchorStatus:(BOOL)agree
41 authSuccess:(void(^)(void))authSuccessBlock 65 authSuccess:(void(^)(void))authSuccessBlock
42 authFailed:(void(^)(NSDictionary *errorInfo))authFailedBlock 66 authFailed:(void(^)(NSDictionary *errorInfo))authFailedBlock
43 getAnchorStatusResult:(void(^)(BOOL result))result; 67 getAnchorStatusResult:(void(^)(BOOL result))result;
@@ -268,6 +292,12 @@ MP_EXTERN NSString * const MPMoviePlayerFirstVideoFrameRenderedNotification; @@ -268,6 +292,12 @@ MP_EXTERN NSString * const MPMoviePlayerFirstVideoFrameRenderedNotification;
268 292
269 MP_EXTERN NSString * const MPMoviePlayerFirstAudioFrameRenderedNotification; 293 MP_EXTERN NSString * const MPMoviePlayerFirstAudioFrameRenderedNotification;
270 294
  295 +//Posted when the network status change
  296 +MP_EXTERN NSString * const MPMoviePlayerNetworkStatusChangeNotification;
  297 +MP_EXTERN NSString * const MPMoviePlayerCurrNetworkStatusUserInfoKey; // NSNumber (KSYNetworkStatus)
  298 +MP_EXTERN NSString * const MPMoviePlayerLastNetworkStatusUserInfoKey; // NSNumber (KSYNetworkStatus)
  299 +
  300 +
271 /* bufferTimeMax指定直播流播放时的最大缓冲时长,单位为秒 301 /* bufferTimeMax指定直播流播放时的最大缓冲时长,单位为秒
272 * 302 *
273 * 当buffer为负数时,关闭直播追赶 303 * 当buffer为负数时,关闭直播追赶
LiveVideoCloud/Classes/CNLiveSDK/CNLivePlayerSDK.framework/Headers/CNLiveTypeDef.h
@@ -237,4 +237,13 @@ typedef NS_ENUM(NSUInteger, CNLiveAnchorStatus) { @@ -237,4 +237,13 @@ typedef NS_ENUM(NSUInteger, CNLiveAnchorStatus) {
237 CNLiveAnchorStatusEnd, 237 CNLiveAnchorStatusEnd,
238 }; 238 };
239 239
  240 +/**
  241 + * 播放时网络状态
  242 + */
  243 +typedef NS_ENUM(NSInteger, CNLiveNetworkStatus) {
  244 + CNLiveNotReachable = 0,
  245 + CNLiveReachableViaWiFi = 2,
  246 + CNLiveReachableViaWWAN = 1
  247 +};
  248 +
240 #endif /* CNLiveTypeDef_h */ 249 #endif /* CNLiveTypeDef_h */
LiveVideoCloud/Classes/CNLiveSDK/CNLivePlayerSDK.framework/Headers/CNLiveWebcastManager.h
@@ -18,6 +18,8 @@ @@ -18,6 +18,8 @@
18 18
19 @interface CNLiveWebcastManager : NSObject 19 @interface CNLiveWebcastManager : NSObject
20 20
  21 ++ (CNLiveWebcastManager *)manager;
  22 +
21 /** 23 /**
22 * 应用ID(只读) 24 * 应用ID(只读)
23 */ 25 */
@@ -28,10 +30,13 @@ @@ -28,10 +30,13 @@
28 */ 30 */
29 @property (nonatomic, readonly) NSString *appKey; 31 @property (nonatomic, readonly) NSString *appKey;
30 32
31 -+ (CNLiveWebcastManager *)manager; 33 +/**
  34 + * 是否是测试环境
  35 + */
  36 +@property (nonatomic, readonly) BOOL isTestEnvironment;
32 37
33 /** 38 /**
34 - @abstract 初始化直播云SDK 39 + @abstract 初始化直播云SDK(该方法默认正式环境)
35 @param appId 在open.cnlive.com网站申请得到的appId 40 @param appId 在open.cnlive.com网站申请得到的appId
36 @param appKey 在open.cnlive.com网站申请得到的appKey 41 @param appKey 在open.cnlive.com网站申请得到的appKey
37 @warning 必传参数 42 @warning 必传参数
@@ -39,6 +44,15 @@ @@ -39,6 +44,15 @@
39 - (void)initWithAppId:(NSString *)appId appKey:(NSString *)appKey; 44 - (void)initWithAppId:(NSString *)appId appKey:(NSString *)appKey;
40 45
41 /** 46 /**
  47 + @abstract 初始化直播云SDK
  48 + @param appId 在open.cnlive.com网站申请得到的appId
  49 + @param appKey 在open.cnlive.com网站申请得到的appKey
  50 + @param isTestEnvironment YES:测试环境 NO:正式环境
  51 + @warning 必传参数
  52 + */
  53 +- (void)initWithAppId:(NSString *)appId appKey:(NSString *)appKey isTestEnvironment:(BOOL)isTestEnvironment;
  54 +
  55 +/**
42 @abstract 获取版本号 56 @abstract 获取版本号
43 */ 57 */
44 + (NSString *)getVersion; 58 + (NSString *)getVersion;
LiveVideoCloud/Classes/CNLiveSDK/CNLivePlayerSDK.framework/Info.plist
No preview for this file type
LiveVideoCloud/Classes/Sections/homeSections/ChatView/LVCChatView.h
@@ -24,4 +24,6 @@ @@ -24,4 +24,6 @@
24 24
25 - (void)sendMsgWithMessage:(NSString *)message; 25 - (void)sendMsgWithMessage:(NSString *)message;
26 26
  27 +- (void)quitChatroom;
  28 +
27 @end 29 @end
LiveVideoCloud/Classes/Sections/homeSections/ChatView/LVCChatView.m
@@ -88,7 +88,7 @@ @@ -88,7 +88,7 @@
88 } 88 }
89 89
90 //退出聊天室 90 //退出聊天室
91 -- (void)quit 91 +- (void)quitChatroom
92 { 92 {
93 if (!_roomId) return; //如果聊天室不存在,不作处理 93 if (!_roomId) return; //如果聊天室不存在,不作处理
94 94
LiveVideoCloud/Classes/Sections/homeSections/Controller/HomeViewController.m
@@ -31,8 +31,7 @@ @@ -31,8 +31,7 @@
31 31
32 - (void)viewDidLoad { 32 - (void)viewDidLoad {
33 [super viewDidLoad]; 33 [super viewDidLoad];
34 -  
35 - self.navigationItem.title = @"直播"; 34 + self.view.backgroundColor = [UIColor whiteColor];
36 35
37 _titleArr = @[@"直播",@"电视台",@"点播"]; 36 _titleArr = @[@"直播",@"电视台",@"点播"];
38 CGFloat width = 0; 37 CGFloat width = 0;
@@ -48,10 +47,9 @@ @@ -48,10 +47,9 @@
48 47
49 self.navigationItem.titleView = self.titleView; 48 self.navigationItem.titleView = self.titleView;
50 49
51 - [self.view addSubview:self.pageView];  
52 [_pageView reloadPages]; 50 [_pageView reloadPages];
53 [_titleView reloadData]; 51 [_titleView reloadData];
54 - [self.titleView scrollToElement:0 animated:NO]; 52 + [self.view addSubview:self.pageView];
55 53
56 } 54 }
57 55
@@ -167,7 +165,6 @@ @@ -167,7 +165,6 @@
167 _pageView.pagingDelegate = self; 165 _pageView.pagingDelegate = self;
168 _pageView.delegate = self; 166 _pageView.delegate = self;
169 _pageView.scrollsToTop = NO; 167 _pageView.scrollsToTop = NO;
170 - _pageView.bounces = NO;  
171 } 168 }
172 return _pageView; 169 return _pageView;
173 } 170 }
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCLivePlayerController.m
@@ -30,9 +30,6 @@ @@ -30,9 +30,6 @@
30 @property (nonatomic, strong) LVCInputView *inputView; 30 @property (nonatomic, strong) LVCInputView *inputView;
31 @property (nonatomic, strong) LVCChatView *chatView; 31 @property (nonatomic, strong) LVCChatView *chatView;
32 32
33 -@property (nonatomic, strong) NSTimer *timer;  
34 -@property (nonatomic, assign) NSTimeInterval countTime;  
35 -  
36 @property (nonatomic, strong) CNBarrageManager *barrageManager; //弹幕管理者 33 @property (nonatomic, strong) CNBarrageManager *barrageManager; //弹幕管理者
37 @property (nonatomic ,strong) UIView *barrageBaseView; //弹幕总View 34 @property (nonatomic ,strong) UIView *barrageBaseView; //弹幕总View
38 @property (nonatomic, strong) UITapGestureRecognizer *tap; 35 @property (nonatomic, strong) UITapGestureRecognizer *tap;
@@ -263,8 +260,7 @@ @@ -263,8 +260,7 @@
263 [_player stopPlaying]; 260 [_player stopPlaying];
264 261
265 //退出聊天室 262 //退出聊天室
266 - [[CNLiveChatManager sharedCNLiveChatManager] quitChatRoom:_roomId success:NULL error:NULL];  
267 - 263 + [_chatView quitChatroom];
268 [self removeViews]; 264 [self removeViews];
269 265
270 self.navigationController.navigationBar.hidden = NO; 266 self.navigationController.navigationBar.hidden = NO;
@@ -317,10 +313,16 @@ @@ -317,10 +313,16 @@
317 [_player removeFromSuperview]; 313 [_player removeFromSuperview];
318 [_chatView removeFromSuperview]; 314 [_chatView removeFromSuperview];
319 [_inputView removeFromSuperview]; 315 [_inputView removeFromSuperview];
  316 +
320 _player = nil; 317 _player = nil;
  318 + _player.delegate = nil;
  319 +
  320 + _chatView.delegate = nil;
321 _chatView = nil; 321 _chatView = nil;
  322 +
  323 + _inputView.delegate = nil;
322 _inputView = nil; 324 _inputView = nil;
323 - _player.delegate = nil; 325 +
324 [[NSNotificationCenter defaultCenter] removeObserver:self]; 326 [[NSNotificationCenter defaultCenter] removeObserver:self];
325 } 327 }
326 328
@@ -436,6 +438,11 @@ @@ -436,6 +438,11 @@
436 // Dispose of any resources that can be recreated. 438 // Dispose of any resources that can be recreated.
437 } 439 }
438 440
  441 +- (void)dealloc
  442 +{
  443 + NSLog(@"LVCLivePlayerController dealloc");
  444 +}
  445 +
439 /* 446 /*
440 #pragma mark - Navigation 447 #pragma mark - Navigation
441 448
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLivePlayerController.m
@@ -137,8 +137,7 @@ @@ -137,8 +137,7 @@
137 137
138 if ([model.activityStatus isEqualToString:@"1"]) { 138 if ([model.activityStatus isEqualToString:@"1"]) {
139 139
140 - _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:model.channelId  
141 - authSuccess:^{ 140 + _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:model.channelId anchorStatus:YES authSuccess:^{
142 141
143 _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO; 142 _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO;
144 _player.view.frame = self.view.bounds; 143 _player.view.frame = self.view.bounds;
@@ -274,8 +273,7 @@ @@ -274,8 +273,7 @@
274 273
275 [self addLiveBaseView]; 274 [self addLiveBaseView];
276 275
277 - _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId  
278 - authSuccess:^{ 276 + _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId anchorStatus:YES authSuccess:^{
279 277
280 _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO; 278 _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO;
281 _player.view.frame = self.view.bounds; 279 _player.view.frame = self.view.bounds;
@@ -379,8 +377,7 @@ @@ -379,8 +377,7 @@
379 } else if ([_playArray[_index].activityStatus isEqualToString:@"1"]) { 377 } else if ([_playArray[_index].activityStatus isEqualToString:@"1"]) {
380 [self addLiveBaseView]; 378 [self addLiveBaseView];
381 379
382 - _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId  
383 - authSuccess:^{ 380 + _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:_playArray[_index].channelId anchorStatus:YES authSuccess:^{
384 381
385 _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO; 382 _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO;
386 _player.view.frame = self.view.bounds; 383 _player.view.frame = self.view.bounds;
LiveVideoCloud/Classes/Sections/homeSections/View/LVCPlayer.m
@@ -30,6 +30,11 @@ @@ -30,6 +30,11 @@
30 30
31 @implementation LVCPlayer 31 @implementation LVCPlayer
32 32
  33 +- (void)dealloc
  34 +{
  35 + NSLog(@"LVCPlayer dealloc");
  36 +}
  37 +
33 - (instancetype)initWithFrame:(CGRect)frame playerModel:(LVCChannelDetailsModel *)model 38 - (instancetype)initWithFrame:(CGRect)frame playerModel:(LVCChannelDetailsModel *)model
34 { 39 {
35 self = [super initWithFrame:frame]; 40 self = [super initWithFrame:frame];
@@ -62,7 +67,7 @@ @@ -62,7 +67,7 @@
62 /* 67 /*
63 */ 68 */
64 NSString *channelId = [NSString stringWithFormat:@"82_%@",model.mediaId]; 69 NSString *channelId = [NSString stringWithFormat:@"82_%@",model.mediaId];
65 - _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:channelId authSuccess:^{ 70 + _player = [[CNLiveMoviePlayerController alloc] initLivePlayWithChannelId:channelId anchorStatus:NO authSuccess:^{
66 [self addObservers]; 71 [self addObservers];
67 _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO; 72 _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO;
68 _player.shouldAutoplay = YES; 73 _player.shouldAutoplay = YES;
@@ -512,6 +517,21 @@ @@ -512,6 +517,21 @@
512 } 517 }
513 } 518 }
514 519
  520 +- (void)exitPlayer {
  521 + if (_player.isPlaying) {
  522 + [_player stop];
  523 + }
  524 +
  525 + [_player destroyPlayer];
  526 + _player = nil;
  527 + [self removeMovieNotificationObservers];
  528 +
  529 + if (_timer) {
  530 + [_timer invalidate];
  531 + _timer = nil;
  532 + }
  533 +}
  534 +
515 #pragma mark - 535 #pragma mark -
516 #pragma mark - getter 536 #pragma mark - getter
517 537
LiveVideoCloud/Classes/Sections/homeSections/View/LVCTelevisionView.m
@@ -22,8 +22,8 @@ static NSString *otherHeaderId = @&quot;LVCOtherHeaderReusableView&quot;; @@ -22,8 +22,8 @@ static NSString *otherHeaderId = @&quot;LVCOtherHeaderReusableView&quot;;
22 22
23 @property (nonatomic, strong) UICollectionView *collectionView; 23 @property (nonatomic, strong) UICollectionView *collectionView;
24 @property (nonatomic, strong) NSArray *bannerModelArray; //banner数据源 24 @property (nonatomic, strong) NSArray *bannerModelArray; //banner数据源
25 -@property (nonatomic, strong) NSArray *marqueeModelArray; //  
26 -@property (nonatomic, strong) NSArray *channelsModelArray; // 25 +@property (nonatomic, strong) NSArray *marqueeModelArray;
  26 +@property (nonatomic, strong) NSArray *channelsModelArray;
27 27
28 @end 28 @end
29 29
@@ -35,6 +35,7 @@ static NSString *otherHeaderId = @&quot;LVCOtherHeaderReusableView&quot;; @@ -35,6 +35,7 @@ static NSString *otherHeaderId = @&quot;LVCOtherHeaderReusableView&quot;;
35 if (self) { 35 if (self) {
36 36
37 self.backgroundColor = [UIColor whiteColor]; 37 self.backgroundColor = [UIColor whiteColor];
  38 +
38 [self addSubview:self.collectionView]; 39 [self addSubview:self.collectionView];
39 [self loadData]; 40 [self loadData];
40 41
@@ -188,7 +189,7 @@ static NSString *otherHeaderId = @&quot;LVCOtherHeaderReusableView&quot;; @@ -188,7 +189,7 @@ static NSString *otherHeaderId = @&quot;LVCOtherHeaderReusableView&quot;;
188 [_collectionView registerClass:[LVCLiveListCollectionViewCell class] forCellWithReuseIdentifier:cellId]; 189 [_collectionView registerClass:[LVCLiveListCollectionViewCell class] forCellWithReuseIdentifier:cellId];
189 [_collectionView registerClass:[LVCFirstHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:firstHeaderId]; 190 [_collectionView registerClass:[LVCFirstHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:firstHeaderId];
190 [_collectionView registerClass:[LVCOtherHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:otherHeaderId]; 191 [_collectionView registerClass:[LVCOtherHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:otherHeaderId];
191 - 192 + _collectionView.scrollsToTop = NO;
192 _collectionView.dataSource = self; 193 _collectionView.dataSource = self;
193 _collectionView.delegate = self; 194 _collectionView.delegate = self;
194 } 195 }