Commit eeaa06227b564421d3d30e57e7152e7d64f7ba09
1 parent
03210814
修改
Showing
7 changed files
with
65 additions
and
30 deletions
LiveVideoCloud.xcodeproj/project.pbxproj
| @@ -252,7 +252,7 @@ | @@ -252,7 +252,7 @@ | ||
| 252 | D29E81ED1E88DC5B008C9906 /* PriChatCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D29E81EC1E88DC5B008C9906 /* PriChatCell.m */; }; | 252 | D29E81ED1E88DC5B008C9906 /* PriChatCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D29E81EC1E88DC5B008C9906 /* PriChatCell.m */; }; |
| 253 | D2A089E81E89FA720071412C /* LVCUGCLivePlayerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089E71E89FA720071412C /* LVCUGCLivePlayerCell.m */; }; | 253 | D2A089E81E89FA720071412C /* LVCUGCLivePlayerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089E71E89FA720071412C /* LVCUGCLivePlayerCell.m */; }; |
| 254 | D2A089EB1E8A09CB0071412C /* LVCUGCLivePlayerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089EA1E8A09CB0071412C /* LVCUGCLivePlayerModel.m */; }; | 254 | D2A089EB1E8A09CB0071412C /* LVCUGCLivePlayerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089EA1E8A09CB0071412C /* LVCUGCLivePlayerModel.m */; }; |
| 255 | - D2A089EE1E8A336A0071412C /* LiveLIstService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089ED1E8A336A0071412C /* LiveLIstService.m */; }; | 255 | + D2A089EE1E8A336A0071412C /* LiveListService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089ED1E8A336A0071412C /* LiveListService.m */; }; |
| 256 | D2A089F11E8A41120071412C /* LVCUGCLiveListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089F01E8A41120071412C /* LVCUGCLiveListModel.m */; }; | 256 | D2A089F11E8A41120071412C /* LVCUGCLiveListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089F01E8A41120071412C /* LVCUGCLiveListModel.m */; }; |
| 257 | D2A803081E80BD6F009D6F1C /* TopToolView.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A803071E80BD6F009D6F1C /* TopToolView.m */; }; | 257 | D2A803081E80BD6F009D6F1C /* TopToolView.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A803071E80BD6F009D6F1C /* TopToolView.m */; }; |
| 258 | D2B2ED801E88FC5200F7538A /* LVCUGCLiveEndView.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B2ED7F1E88FC5200F7538A /* LVCUGCLiveEndView.m */; }; | 258 | D2B2ED801E88FC5200F7538A /* LVCUGCLiveEndView.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B2ED7F1E88FC5200F7538A /* LVCUGCLiveEndView.m */; }; |
| @@ -261,6 +261,7 @@ | @@ -261,6 +261,7 @@ | ||
| 261 | D2B7B2571E8261EF00ED084E /* ChatBarrOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B7B2561E8261EF00ED084E /* ChatBarrOperation.m */; }; | 261 | D2B7B2571E8261EF00ED084E /* ChatBarrOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B7B2561E8261EF00ED084E /* ChatBarrOperation.m */; }; |
| 262 | D2CBC13B1ECC157A00E00279 /* LVCVerifyLiveAuthService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */; }; | 262 | D2CBC13B1ECC157A00E00279 /* LVCVerifyLiveAuthService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */; }; |
| 263 | D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2D7D18C1E8A581000217771 /* timg.jpeg */; }; | 263 | D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2D7D18C1E8A581000217771 /* timg.jpeg */; }; |
| 264 | + D2F0486A1EE54E860011E39C /* LVCLiveActivityInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */; }; | ||
| 264 | /* End PBXBuildFile section */ | 265 | /* End PBXBuildFile section */ |
| 265 | 266 | ||
| 266 | /* Begin PBXContainerItemProxy section */ | 267 | /* Begin PBXContainerItemProxy section */ |
| @@ -786,8 +787,8 @@ | @@ -786,8 +787,8 @@ | ||
| 786 | D2A089E71E89FA720071412C /* LVCUGCLivePlayerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLivePlayerCell.m; sourceTree = "<group>"; }; | 787 | D2A089E71E89FA720071412C /* LVCUGCLivePlayerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLivePlayerCell.m; sourceTree = "<group>"; }; |
| 787 | D2A089E91E8A09CB0071412C /* LVCUGCLivePlayerModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCUGCLivePlayerModel.h; sourceTree = "<group>"; }; | 788 | D2A089E91E8A09CB0071412C /* LVCUGCLivePlayerModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCUGCLivePlayerModel.h; sourceTree = "<group>"; }; |
| 788 | D2A089EA1E8A09CB0071412C /* LVCUGCLivePlayerModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLivePlayerModel.m; sourceTree = "<group>"; }; | 789 | D2A089EA1E8A09CB0071412C /* LVCUGCLivePlayerModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLivePlayerModel.m; sourceTree = "<group>"; }; |
| 789 | - D2A089EC1E8A336A0071412C /* LiveLIstService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveLIstService.h; sourceTree = "<group>"; }; | ||
| 790 | - D2A089ED1E8A336A0071412C /* LiveLIstService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiveLIstService.m; sourceTree = "<group>"; }; | 790 | + D2A089EC1E8A336A0071412C /* LiveListService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiveListService.h; sourceTree = "<group>"; }; |
| 791 | + D2A089ED1E8A336A0071412C /* LiveListService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiveListService.m; sourceTree = "<group>"; }; | ||
| 791 | D2A089EF1E8A41120071412C /* LVCUGCLiveListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCUGCLiveListModel.h; sourceTree = "<group>"; }; | 792 | D2A089EF1E8A41120071412C /* LVCUGCLiveListModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCUGCLiveListModel.h; sourceTree = "<group>"; }; |
| 792 | D2A089F01E8A41120071412C /* LVCUGCLiveListModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLiveListModel.m; sourceTree = "<group>"; }; | 793 | D2A089F01E8A41120071412C /* LVCUGCLiveListModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLiveListModel.m; sourceTree = "<group>"; }; |
| 793 | D2A803061E80BD6F009D6F1C /* TopToolView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopToolView.h; sourceTree = "<group>"; }; | 794 | D2A803061E80BD6F009D6F1C /* TopToolView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopToolView.h; sourceTree = "<group>"; }; |
| @@ -803,6 +804,8 @@ | @@ -803,6 +804,8 @@ | ||
| 803 | D2CBC1391ECC157A00E00279 /* LVCVerifyLiveAuthService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LVCVerifyLiveAuthService.h; path = ../LVCVerifyLiveAuthService.h; sourceTree = "<group>"; }; | 804 | D2CBC1391ECC157A00E00279 /* LVCVerifyLiveAuthService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LVCVerifyLiveAuthService.h; path = ../LVCVerifyLiveAuthService.h; sourceTree = "<group>"; }; |
| 804 | D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LVCVerifyLiveAuthService.m; path = ../LVCVerifyLiveAuthService.m; sourceTree = "<group>"; }; | 805 | D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LVCVerifyLiveAuthService.m; path = ../LVCVerifyLiveAuthService.m; sourceTree = "<group>"; }; |
| 805 | D2D7D18C1E8A581000217771 /* timg.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = timg.jpeg; sourceTree = "<group>"; }; | 806 | D2D7D18C1E8A581000217771 /* timg.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = timg.jpeg; sourceTree = "<group>"; }; |
| 807 | + D2F048681EE54E860011E39C /* LVCLiveActivityInfoService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveActivityInfoService.h; sourceTree = "<group>"; }; | ||
| 808 | + D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCLiveActivityInfoService.m; sourceTree = "<group>"; }; | ||
| 806 | /* End PBXFileReference section */ | 809 | /* End PBXFileReference section */ |
| 807 | 810 | ||
| 808 | /* Begin PBXFrameworksBuildPhase section */ | 811 | /* Begin PBXFrameworksBuildPhase section */ |
| @@ -2019,8 +2022,10 @@ | @@ -2019,8 +2022,10 @@ | ||
| 2019 | 81A483161E88BED00097A80A /* LVCTVLiveViewController.m */, | 2022 | 81A483161E88BED00097A80A /* LVCTVLiveViewController.m */, |
| 2020 | 81A483181E88E19C0097A80A /* LVCMoreProgramViewController.h */, | 2023 | 81A483181E88E19C0097A80A /* LVCMoreProgramViewController.h */, |
| 2021 | 81A483191E88E19C0097A80A /* LVCMoreProgramViewController.m */, | 2024 | 81A483191E88E19C0097A80A /* LVCMoreProgramViewController.m */, |
| 2022 | - D2A089EC1E8A336A0071412C /* LiveLIstService.h */, | ||
| 2023 | - D2A089ED1E8A336A0071412C /* LiveLIstService.m */, | 2025 | + D2A089EC1E8A336A0071412C /* LiveListService.h */, |
| 2026 | + D2A089ED1E8A336A0071412C /* LiveListService.m */, | ||
| 2027 | + D2F048681EE54E860011E39C /* LVCLiveActivityInfoService.h */, | ||
| 2028 | + D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */, | ||
| 2024 | ); | 2029 | ); |
| 2025 | path = Controller; | 2030 | path = Controller; |
| 2026 | sourceTree = "<group>"; | 2031 | sourceTree = "<group>"; |
| @@ -2258,7 +2263,7 @@ | @@ -2258,7 +2263,7 @@ | ||
| 2258 | D2029CAF1E6EADE10027CD92 /* MJRefreshStateHeader.m in Sources */, | 2263 | D2029CAF1E6EADE10027CD92 /* MJRefreshStateHeader.m in Sources */, |
| 2259 | 4BD856091EBACD530082061D /* UIRefreshControl+AFNetworking.m in Sources */, | 2264 | 4BD856091EBACD530082061D /* UIRefreshControl+AFNetworking.m in Sources */, |
| 2260 | 81F1C8401E8BC5CC0085C2B8 /* NSArray+Safety.m in Sources */, | 2265 | 81F1C8401E8BC5CC0085C2B8 /* NSArray+Safety.m in Sources */, |
| 2261 | - D2A089EE1E8A336A0071412C /* LiveLIstService.m in Sources */, | 2266 | + D2A089EE1E8A336A0071412C /* LiveListService.m in Sources */, |
| 2262 | D2A089E81E89FA720071412C /* LVCUGCLivePlayerCell.m in Sources */, | 2267 | D2A089E81E89FA720071412C /* LVCUGCLivePlayerCell.m in Sources */, |
| 2263 | 81A483111E88B8630097A80A /* LVCChannelDetailsModel.m in Sources */, | 2268 | 81A483111E88B8630097A80A /* LVCChannelDetailsModel.m in Sources */, |
| 2264 | D2029D011E6EAE2E0027CD92 /* UIColor+HexString.m in Sources */, | 2269 | D2029D011E6EAE2E0027CD92 /* UIColor+HexString.m in Sources */, |
| @@ -2305,6 +2310,7 @@ | @@ -2305,6 +2310,7 @@ | ||
| 2305 | 810B65031E779B1F00133E15 /* MASViewConstraint.m in Sources */, | 2310 | 810B65031E779B1F00133E15 /* MASViewConstraint.m in Sources */, |
| 2306 | D2029BCE1E6EADD70027CD92 /* ZXNavigationController.m in Sources */, | 2311 | D2029BCE1E6EADD70027CD92 /* ZXNavigationController.m in Sources */, |
| 2307 | 81A482F51E88ACC80097A80A /* LVCTelevisionView.m in Sources */, | 2312 | 81A482F51E88ACC80097A80A /* LVCTelevisionView.m in Sources */, |
| 2313 | + D2F0486A1EE54E860011E39C /* LVCLiveActivityInfoService.m in Sources */, | ||
| 2308 | D2029CA21E6EADE10027CD92 /* MJRefreshAutoFooter.m in Sources */, | 2314 | D2029CA21E6EADE10027CD92 /* MJRefreshAutoFooter.m in Sources */, |
| 2309 | D2029CC71E6EADE10027CD92 /* SVIndefiniteAnimatedView.m in Sources */, | 2315 | D2029CC71E6EADE10027CD92 /* SVIndefiniteAnimatedView.m in Sources */, |
| 2310 | D2029CA31E6EADE10027CD92 /* MJRefreshBackFooter.m in Sources */, | 2316 | D2029CA31E6EADE10027CD92 /* MJRefreshBackFooter.m in Sources */, |
LiveVideoCloud/Classes/Sections/homeSections/Controller/LiveLIstService.h renamed to LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCLiveActivityInfoService.h
| 1 | // | 1 | // |
| 2 | -// LiveLIstService.h | 2 | +// LVCLiveActivityInfoService.h |
| 3 | // LiveVideoCloud | 3 | // LiveVideoCloud |
| 4 | // | 4 | // |
| 5 | -// Created by cnliveJunBo on 17/3/28. | 5 | +// Created by cnliveJunBo on 17/6/5. |
| 6 | // Copyright © 2017年 cnlive. All rights reserved. | 6 | // Copyright © 2017年 cnlive. All rights reserved. |
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | -#import "HttpService.h" | 9 | +#import <Foundation/Foundation.h> |
| 10 | 10 | ||
| 11 | -@interface LiveLIstService : HttpService | ||
| 12 | -+ (NSURLSessionDataTask *)getLiveListWithHandler:(completionHandler)handler; | 11 | +@interface LVCLiveActivityInfoService : HttpService |
| 13 | 12 | ||
| 14 | -+ (NSString*)sha1:(NSString *)string; | 13 | ++ (NSURLSessionDataTask *)getLiveActivityInfoWithActivityId:(NSString *)activityId Handler:(completionHandler)handler; |
| 15 | 14 | ||
| 15 | ++ (NSString*)sha1:(NSString *)string; | ||
| 16 | 16 | ||
| 17 | + (NSString *)sortParameters:(NSDictionary*)parameters; | 17 | + (NSString *)sortParameters:(NSDictionary*)parameters; |
| 18 | 18 |
LiveVideoCloud/Classes/Sections/homeSections/Controller/LiveLIstService.m renamed to LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCLiveActivityInfoService.m
| 1 | // | 1 | // |
| 2 | -// LiveLIstService.m | 2 | +// LVCLiveActivityInfoService.m |
| 3 | // LiveVideoCloud | 3 | // LiveVideoCloud |
| 4 | // | 4 | // |
| 5 | -// Created by cnliveJunBo on 17/3/28. | 5 | +// Created by cnliveJunBo on 17/6/5. |
| 6 | // Copyright © 2017年 cnlive. All rights reserved. | 6 | // Copyright © 2017年 cnlive. All rights reserved. |
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | -#import "LiveLIstService.h" | 9 | +#import "LVCLiveActivityInfoService.h" |
| 10 | #import "CommonCrypto/CommonDigest.h" | 10 | #import "CommonCrypto/CommonDigest.h" |
| 11 | 11 | ||
| 12 | -@implementation LiveLIstService | 12 | +@implementation LVCLiveActivityInfoService |
| 13 | 13 | ||
| 14 | -+ (NSURLSessionDataTask *)getLiveListWithHandler:(completionHandler)handler | 14 | +// 获取直播活动信息 |
| 15 | ++ (NSURLSessionDataTask *)getLiveActivityInfoWithActivityId:(NSString *)activityId Handler:(completionHandler)handler | ||
| 15 | { | 16 | { |
| 16 | NSInteger time = [[NSDate date] timeIntervalSince1970]; | 17 | NSInteger time = [[NSDate date] timeIntervalSince1970]; |
| 17 | NSString *timeString = [NSString stringWithFormat:@"%ld", (long)time]; | 18 | NSString *timeString = [NSString stringWithFormat:@"%ld", (long)time]; |
| 18 | NSMutableDictionary *parameter=[@{@"platform_id": [NSBundle mainBundle].bundleIdentifier, | 19 | NSMutableDictionary *parameter=[@{@"platform_id": [NSBundle mainBundle].bundleIdentifier, |
| 20 | + @"activityId":activityId, | ||
| 19 | @"timestamp": timeString, | 21 | @"timestamp": timeString, |
| 20 | @"appId": UserAppId} mutableCopy]; | 22 | @"appId": UserAppId} mutableCopy]; |
| 21 | NSString *string = [NSString stringWithFormat:@"%@&key=%@", [self sortParameters:parameter], UserAppKey]; | 23 | NSString *string = [NSString stringWithFormat:@"%@&key=%@", [self sortParameters:parameter], UserAppKey]; |
| @@ -26,7 +28,7 @@ | @@ -26,7 +28,7 @@ | ||
| 26 | completionHandler compleionHandler = ^(id data,NSError *error) { | 28 | completionHandler compleionHandler = ^(id data,NSError *error) { |
| 27 | handler(data,error); | 29 | handler(data,error); |
| 28 | }; | 30 | }; |
| 29 | - return [[HttpService service] sendRequestWithHttpMethod:E_HTTP_REQUEST_METHOD_GET URLPath:[ZXServerUrl getLiveListURL] parameters:params completionHandler:compleionHandler]; | 31 | + return [[HttpService service] sendRequestWithHttpMethod:E_HTTP_REQUEST_METHOD_GET URLPath:[ZXServerUrl getLiveActivityInfoURL] parameters:params completionHandler:compleionHandler]; |
| 30 | } | 32 | } |
| 31 | 33 | ||
| 32 | //sha1加密 | 34 | //sha1加密 |
| @@ -49,6 +51,7 @@ | @@ -49,6 +51,7 @@ | ||
| 49 | 51 | ||
| 50 | return output; | 52 | return output; |
| 51 | } | 53 | } |
| 54 | + | ||
| 52 | //参数排序 | 55 | //参数排序 |
| 53 | + (NSString *)sortParameters:(NSDictionary*)parameters | 56 | + (NSString *)sortParameters:(NSDictionary*)parameters |
| 54 | { | 57 | { |
| @@ -72,5 +75,4 @@ | @@ -72,5 +75,4 @@ | ||
| 72 | return string1; | 75 | return string1; |
| 73 | } | 76 | } |
| 74 | 77 | ||
| 75 | - | ||
| 76 | @end | 78 | @end |
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLiveListView.m
| @@ -7,12 +7,13 @@ | @@ -7,12 +7,13 @@ | ||
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import "LVCUGCLiveListView.h" | 9 | #import "LVCUGCLiveListView.h" |
| 10 | -#import "LiveLIstService.h" | 10 | +#import "LiveListService.h" |
| 11 | #import "LVCUGCLivePlayerCell.h" | 11 | #import "LVCUGCLivePlayerCell.h" |
| 12 | #import "LVCUGCLiveListModel.h" | 12 | #import "LVCUGCLiveListModel.h" |
| 13 | #import "LVCUGCLivePlayerModel.h" | 13 | #import "LVCUGCLivePlayerModel.h" |
| 14 | #import "LVCUGCLivePlayerController.h" | 14 | #import "LVCUGCLivePlayerController.h" |
| 15 | #import "LVCRequestFailedView.h" | 15 | #import "LVCRequestFailedView.h" |
| 16 | +#import "LVCLiveActivityInfoService.h" | ||
| 16 | 17 | ||
| 17 | static NSString *cellId = @"cellId"; | 18 | static NSString *cellId = @"cellId"; |
| 18 | 19 | ||
| @@ -50,7 +51,7 @@ static NSString *cellId = @"cellId"; | @@ -50,7 +51,7 @@ static NSString *cellId = @"cellId"; | ||
| 50 | 51 | ||
| 51 | _failedView.hidden = YES; | 52 | _failedView.hidden = YES; |
| 52 | 53 | ||
| 53 | - [LiveLIstService getLiveListWithHandler:^(id data, NSError *error) { | 54 | + [LiveListService getLiveListWithHandler:^(id data, NSError *error) { |
| 54 | 55 | ||
| 55 | if (error) { | 56 | if (error) { |
| 56 | NSLog(@"失败===>error:%@",error); | 57 | NSLog(@"失败===>error:%@",error); |
| @@ -99,11 +100,25 @@ static NSString *cellId = @"cellId"; | @@ -99,11 +100,25 @@ static NSString *cellId = @"cellId"; | ||
| 99 | 100 | ||
| 100 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { | 101 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { |
| 101 | 102 | ||
| 102 | - LVCUGCLivePlayerController *player = [[LVCUGCLivePlayerController alloc] init]; | ||
| 103 | - player.index = indexPath.row; | ||
| 104 | - player.playArray = _arrayM; | ||
| 105 | - player.model = _arrayM[indexPath.row]; | ||
| 106 | - [self.viewController.navigationController pushViewController:player animated:YES]; | 103 | + LVCUGCLivePlayerModel *model = _arrayM[indexPath.row]; |
| 104 | + // 判断此时直播状态 | ||
| 105 | + [LVCLiveActivityInfoService getLiveActivityInfoWithActivityId:model.activityId Handler:^(id data, NSError *error) { | ||
| 106 | + | ||
| 107 | + if (error) { | ||
| 108 | + | ||
| 109 | + [Tools showHUDInView:self withString:@"跳转出错" autoHide:YES]; | ||
| 110 | + return ; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + NSString *activityStatus = [NSString stringWithFormat:@"%@",data[@"activityStatus"]]; | ||
| 114 | + model.activityStatus = activityStatus ? activityStatus : @"0"; | ||
| 115 | + | ||
| 116 | + LVCUGCLivePlayerController *player = [[LVCUGCLivePlayerController alloc] init]; | ||
| 117 | + player.index = indexPath.row; | ||
| 118 | + player.playArray = _arrayM; | ||
| 119 | + player.model = model; | ||
| 120 | + [self.viewController.navigationController pushViewController:player animated:YES]; | ||
| 121 | + }]; | ||
| 107 | } | 122 | } |
| 108 | 123 | ||
| 109 | #pragma mark - LVCRequestFailedViewDelegate | 124 | #pragma mark - LVCRequestFailedViewDelegate |
LiveVideoCloud/UtilKits/ServerUrl/ZXServerUrl.h
| @@ -30,6 +30,9 @@ | @@ -30,6 +30,9 @@ | ||
| 30 | /** 直播列表 */ | 30 | /** 直播列表 */ |
| 31 | + (NSString *)getLiveListURL; | 31 | + (NSString *)getLiveListURL; |
| 32 | 32 | ||
| 33 | +/** 直播活动详情 */ | ||
| 34 | ++ (NSString *)getLiveActivityInfoURL; | ||
| 35 | + | ||
| 33 | /** 验证主播是否有直播权限 */ | 36 | /** 验证主播是否有直播权限 */ |
| 34 | + (NSString *)verifyLiveAuthURL; | 37 | + (NSString *)verifyLiveAuthURL; |
| 35 | @end | 38 | @end |
LiveVideoCloud/UtilKits/ServerUrl/ZXServerUrl.m
| @@ -26,6 +26,9 @@ static NSString *g_SearchContentURL = @"/from/huntKeyWordApi/huntKeyWords.do";// | @@ -26,6 +26,9 @@ static NSString *g_SearchContentURL = @"/from/huntKeyWordApi/huntKeyWords.do";// | ||
| 26 | /** 直播列表 */ | 26 | /** 直播列表 */ |
| 27 | static NSString *g_LiveListURL = @"/open/api2/live_epg/sp/activityList4App"; | 27 | static NSString *g_LiveListURL = @"/open/api2/live_epg/sp/activityList4App"; |
| 28 | 28 | ||
| 29 | +/** 直播活动详情 */ | ||
| 30 | +static NSString *g_LiveActivityInfoURL = @"/open/api2/live_epg/getLiveActivityPlayInfo4App"; | ||
| 31 | + | ||
| 29 | /** 验证主播是否有直播权限 */ | 32 | /** 验证主播是否有直播权限 */ |
| 30 | static NSString *g_VerifyLiveAuthURL = @"/open/api2/live_epg/channel/info4App"; | 33 | static NSString *g_VerifyLiveAuthURL = @"/open/api2/live_epg/channel/info4App"; |
| 31 | 34 | ||
| @@ -63,6 +66,12 @@ static NSString *g_VerifyLiveAuthURL = @"/open/api2/live_epg/channel/info4App"; | @@ -63,6 +66,12 @@ static NSString *g_VerifyLiveAuthURL = @"/open/api2/live_epg/channel/info4App"; | ||
| 63 | return [NSString stringWithFormat:@"%@%@", serverBaseURL, g_LiveListURL]; | 66 | return [NSString stringWithFormat:@"%@%@", serverBaseURL, g_LiveListURL]; |
| 64 | } | 67 | } |
| 65 | 68 | ||
| 69 | +/** 直播活动详情 */ | ||
| 70 | ++ (NSString *)getLiveActivityInfoURL | ||
| 71 | +{ | ||
| 72 | + return [NSString stringWithFormat:@"%@%@", serverBaseURL, g_LiveActivityInfoURL]; | ||
| 73 | +} | ||
| 74 | + | ||
| 66 | /** 验证主播是否有直播权限 */ | 75 | /** 验证主播是否有直播权限 */ |
| 67 | + (NSString *)verifyLiveAuthURL | 76 | + (NSString *)verifyLiveAuthURL |
| 68 | { | 77 | { |
LiveVideoCloud/UtilKits/UserTools/UserTools.m
| @@ -249,8 +249,8 @@ | @@ -249,8 +249,8 @@ | ||
| 249 | parms[@"platform_id"] = [NSBundle mainBundle].bundleIdentifier; | 249 | parms[@"platform_id"] = [NSBundle mainBundle].bundleIdentifier; |
| 250 | parms[@"channelId"] = [UserInformationModel manager].uid; | 250 | parms[@"channelId"] = [UserInformationModel manager].uid; |
| 251 | 251 | ||
| 252 | - NSString *string = [NSString stringWithFormat:@"%@&key=%@", [LiveLIstService sortParameters:parms], UserAppKey]; | ||
| 253 | - NSString *signString = [[LiveLIstService sha1:string] uppercaseString]; | 252 | + NSString *string = [NSString stringWithFormat:@"%@&key=%@", [LiveListService sortParameters:parms], UserAppKey]; |
| 253 | + NSString *signString = [[LiveListService sha1:string] uppercaseString]; | ||
| 254 | parms[@"sign"] = signString ; | 254 | parms[@"sign"] = signString ; |
| 255 | 255 | ||
| 256 | 256 | ||
| @@ -280,8 +280,8 @@ | @@ -280,8 +280,8 @@ | ||
| 280 | parms[@"channelId"] = [UserInformationModel manager].uid; //@"295606"; // | 280 | parms[@"channelId"] = [UserInformationModel manager].uid; //@"295606"; // |
| 281 | //parms[@"activityStatus"] = @2; | 281 | //parms[@"activityStatus"] = @2; |
| 282 | 282 | ||
| 283 | - NSString *string = [NSString stringWithFormat:@"%@&key=%@", [LiveLIstService sortParameters:parms], UserAppKey]; | ||
| 284 | - NSString *signString = [[LiveLIstService sha1:string] uppercaseString]; | 283 | + NSString *string = [NSString stringWithFormat:@"%@&key=%@", [LiveListService sortParameters:parms], UserAppKey]; |
| 284 | + NSString *signString = [[LiveListService sha1:string] uppercaseString]; | ||
| 285 | parms[@"sign"] = signString ; | 285 | parms[@"sign"] = signString ; |
| 286 | // activityList4App | 286 | // activityList4App |
| 287 | NSString *host = [@"http://api.cnlive.com/open/api2/live_epg/channel/activityList4App" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; | 287 | NSString *host = [@"http://api.cnlive.com/open/api2/live_epg/channel/activityList4App" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; |