Commit ab87f31c30209ab5d877c32eae33aa01d45e11e0

Authored by zhangxiaowen
1 parent b778150f

no message

CNLivePlayer/Classes/Player/CNLivePlayer.m
@@ -273,7 +273,10 @@ NSString * const CNLiveHostStatusChangedNotification = @"CNLiveAnchorStatusChang @@ -273,7 +273,10 @@ NSString * const CNLiveHostStatusChangedNotification = @"CNLiveAnchorStatusChang
273 * rate 码率 1-流畅,2-标清,3-高清,4-超清,默认为2 273 * rate 码率 1-流畅,2-标清,3-高清,4-超清,默认为2
274 */ 274 */
275 - (void)setPlayerWithContentId:(NSString *)contentId rate:(NSString *)rate authSuccess:(AuthSuccessBlock)authSuccessBlock authFailure:(AuthFailureBlock)authFailureBlock { 275 - (void)setPlayerWithContentId:(NSString *)contentId rate:(NSString *)rate authSuccess:(AuthSuccessBlock)authSuccessBlock authFailure:(AuthFailureBlock)authFailureBlock {
276 - if([_rate isEqualToString:rate]){ 276 + if(!_contentId&&[_rate isEqualToString:rate]){
  277 + return;
  278 + }
  279 + if([_contentId isEqualToString:contentId]&&[_rate isEqualToString:rate]){
277 return; 280 return;
278 } 281 }
279 if(contentId && ![contentId isEqualToString:@""]){ 282 if(contentId && ![contentId isEqualToString:@""]){
CNLivePlayer/Classes/Player/CNLivePlayerManager.h
@@ -22,42 +22,42 @@ NS_ASSUME_NONNULL_BEGIN @@ -22,42 +22,42 @@ NS_ASSUME_NONNULL_BEGIN
22 + (CNLivePlayerManager *)manager; 22 + (CNLivePlayerManager *)manager;
23 23
24 /** 24 /**
25 - * 应用ID(只读) 25 + * 应用ID(只读)
26 */ 26 */
27 @property (nonatomic, copy, readonly) NSString *appId; 27 @property (nonatomic, copy, readonly) NSString *appId;
28 28
29 /** 29 /**
30 - * 应用KEY(只读) 30 + * 应用KEY(只读)
31 */ 31 */
32 @property (nonatomic, copy, readonly) NSString *appKey; 32 @property (nonatomic, copy, readonly) NSString *appKey;
33 33
34 /** 34 /**
35 - * 是否是测试环境 35 + * 是否是测试环境
36 */ 36 */
37 @property (nonatomic, assign, readonly) BOOL isTestEnvironment; 37 @property (nonatomic, assign, readonly) BOOL isTestEnvironment;
38 38
39 -/* 39 +/**
40 * 是否开启边播放边缓存 40 * 是否开启边播放边缓存
41 */ 41 */
42 @property (nonatomic, assign) BOOL openCache; 42 @property (nonatomic, assign) BOOL openCache;
43 43
44 /** 44 /**
45 - * 用户ID 45 + * 用户ID
46 */ 46 */
47 @property (nonatomic, copy) NSString *userId; 47 @property (nonatomic, copy) NSString *userId;
48 48
49 /** 49 /**
50 - * channelName 网++定制 50 + * channelName 网++定制
51 */ 51 */
52 @property (nonatomic, copy) NSString *channelName; 52 @property (nonatomic, copy) NSString *channelName;
53 53
54 /** 54 /**
55 - * tag 网++定制 55 + * tag 网++定制
56 */ 56 */
57 @property (nonatomic, copy) NSString *tag; 57 @property (nonatomic, copy) NSString *tag;
58 58
59 /** 59 /**
60 - * from 网++定制 60 + * from 网++定制
61 */ 61 */
62 @property (nonatomic, copy) NSString *from; 62 @property (nonatomic, copy) NSString *from;
63 63
CNLivePlayer/Classes/Player/CNLivePlayerManager.m
@@ -65,8 +65,8 @@ static CNLivePlayerManager * _instance = nil; @@ -65,8 +65,8 @@ static CNLivePlayerManager * _instance = nil;
65 65
66 #pragma mark - 私有方法 66 #pragma mark - 私有方法
67 - (void)setAppId:(NSString *)appId appKey:(NSString *)appKey isTestEnvironment:(BOOL)isTestEnvironment openCache:(BOOL)openCache{ 67 - (void)setAppId:(NSString *)appId appKey:(NSString *)appKey isTestEnvironment:(BOOL)isTestEnvironment openCache:(BOOL)openCache{
68 - [CNLivePlayerManager manager].appId = appId ? [NSString stringWithFormat:@"%@",appId] : @"";  
69 - [CNLivePlayerManager manager].appKey = appKey ? [NSString stringWithFormat:@"%@",appKey] : @""; 68 + [CNLivePlayerManager manager].appId = appId ? appId : @"";
  69 + [CNLivePlayerManager manager].appKey = appKey ? appKey : @"";
70 [CNLivePlayerManager manager].isTestEnvironment = isTestEnvironment; 70 [CNLivePlayerManager manager].isTestEnvironment = isTestEnvironment;
71 [CNLivePlayerManager manager].openCache = openCache; 71 [CNLivePlayerManager manager].openCache = openCache;
72 if(openCache){ 72 if(openCache){
@@ -97,7 +97,6 @@ static CNLivePlayerManager * _instance = nil; @@ -97,7 +97,6 @@ static CNLivePlayerManager * _instance = nil;
97 [[CNLiveHTTPProxyService manager] startServer]; 97 [[CNLiveHTTPProxyService manager] startServer];
98 98
99 } 99 }
100 -  
101 } 100 }
102 101
103 - (void)applicationDidEnterBackground{ 102 - (void)applicationDidEnterBackground{