Commit ab87f31c30209ab5d877c32eae33aa01d45e11e0

Authored by zhangxiaowen
1 parent b778150f

no message

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