Commit 697ba82d4f3c5f5305e7ab2b1cb847617e7c4b9a
1 parent
1c6383c0
no message
Showing
31 changed files
with
305 additions
and
1374 deletions
LiveVideoCloud.xcodeproj/project.pbxproj
| ... | ... | @@ -82,28 +82,21 @@ |
| 82 | 82 | 8178D4191F01FA3600AA78A4 /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8178D4161F01FA2900AA78A4 /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; |
| 83 | 83 | 8178D4241F02043500AA78A4 /* LVCFullScreenPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D41F1F02043500AA78A4 /* LVCFullScreenPlayerController.m */; }; |
| 84 | 84 | 8178D4251F02043500AA78A4 /* LVCLivePlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4211F02043500AA78A4 /* LVCLivePlayerController.m */; }; |
| 85 | - 8178D42F1F02044300AA78A4 /* LVCChannelDetailsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4281F02044300AA78A4 /* LVCChannelDetailsModel.m */; }; | |
| 86 | - 8178D4301F02044300AA78A4 /* LVCChannelsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D42A1F02044300AA78A4 /* LVCChannelsModel.m */; }; | |
| 87 | 85 | 8178D4311F02044300AA78A4 /* LVCChatRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D42C1F02044300AA78A4 /* LVCChatRoomModel.m */; }; |
| 88 | - 8178D4321F02044300AA78A4 /* LVCProgramModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D42E1F02044300AA78A4 /* LVCProgramModel.m */; }; | |
| 89 | 86 | 8178D44A1F02045500AA78A4 /* CNBarrageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4351F02045500AA78A4 /* CNBarrageManager.m */; }; |
| 90 | 87 | 8178D44B1F02045500AA78A4 /* CNBarrageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4371F02045500AA78A4 /* CNBarrageView.m */; }; |
| 91 | - 8178D44C1F02045500AA78A4 /* LVCFirstHeaderReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4391F02045500AA78A4 /* LVCFirstHeaderReusableView.m */; }; | |
| 92 | - 8178D44D1F02045500AA78A4 /* LVCHeaderRollCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D43B1F02045500AA78A4 /* LVCHeaderRollCollectionViewCell.m */; }; | |
| 93 | - 8178D44E1F02045500AA78A4 /* LVCLiveListCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D43D1F02045500AA78A4 /* LVCLiveListCollectionViewCell.m */; }; | |
| 94 | - 8178D44F1F02045500AA78A4 /* LVCMoreSortTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D43F1F02045500AA78A4 /* LVCMoreSortTableViewCell.m */; }; | |
| 95 | - 8178D4501F02045500AA78A4 /* LVCOtherHeaderReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4411F02045500AA78A4 /* LVCOtherHeaderReusableView.m */; }; | |
| 96 | 88 | 8178D4511F02045500AA78A4 /* LVCPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4431F02045500AA78A4 /* LVCPlayer.m */; }; |
| 97 | 89 | 8178D4521F02045500AA78A4 /* LVCPlayerLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4451F02045500AA78A4 /* LVCPlayerLoadingView.m */; }; |
| 98 | 90 | 8178D4531F02045500AA78A4 /* LVCRequestFailedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4471F02045500AA78A4 /* LVCRequestFailedView.m */; }; |
| 99 | - 8178D4541F02045500AA78A4 /* LVCTelevisionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4491F02045500AA78A4 /* LVCTelevisionView.m */; }; | |
| 100 | 91 | 8178D4571F0204D600AA78A4 /* LVCTelevisioController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4561F0204D600AA78A4 /* LVCTelevisioController.m */; }; |
| 101 | 92 | 8178D4611F02060B00AA78A4 /* LVCChatView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D45A1F02060B00AA78A4 /* LVCChatView.m */; }; |
| 102 | 93 | 8178D4621F02060B00AA78A4 /* LVCChatViewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D45C1F02060B00AA78A4 /* LVCChatViewTableViewCell.m */; }; |
| 103 | 94 | 8178D4631F02060B00AA78A4 /* LVCInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D45E1F02060B00AA78A4 /* LVCInputView.m */; }; |
| 104 | 95 | 8178D4641F02060B00AA78A4 /* LVCMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D4601F02060B00AA78A4 /* LVCMessage.m */; }; |
| 96 | + 8178D4681F021C4500AA78A4 /* TelevisionData.json in Resources */ = {isa = PBXBuildFile; fileRef = 8178D4671F021C4500AA78A4 /* TelevisionData.json */; }; | |
| 97 | + 8178D46B1F021ED800AA78A4 /* LVCTelevisionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D46A1F021ED800AA78A4 /* LVCTelevisionModel.m */; }; | |
| 98 | + 8178D46E1F0225E500AA78A4 /* LVCTelevisionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8178D46D1F0225E500AA78A4 /* LVCTelevisionCell.m */; }; | |
| 105 | 99 | 81A483081E88B6140097A80A /* UIView+ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A483071E88B6140097A80A /* UIView+ViewController.m */; }; |
| 106 | - 81A483171E88BED00097A80A /* LVCTVLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A483161E88BED00097A80A /* LVCTVLiveViewController.m */; }; | |
| 107 | 100 | 81DFC4261F0113B40029BCB3 /* JsonFile.json in Resources */ = {isa = PBXBuildFile; fileRef = 81DFC4251F0113B40029BCB3 /* JsonFile.json */; }; |
| 108 | 101 | 81F1C8381E8BBDDA0085C2B8 /* MHPagingScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F1C8371E8BBDDA0085C2B8 /* MHPagingScrollView.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; |
| 109 | 102 | 81F1C8401E8BC5CC0085C2B8 /* NSArray+Safety.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F1C83F1E8BC5CC0085C2B8 /* NSArray+Safety.m */; }; |
| ... | ... | @@ -466,36 +459,18 @@ |
| 466 | 459 | 8178D41F1F02043500AA78A4 /* LVCFullScreenPlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCFullScreenPlayerController.m; sourceTree = "<group>"; }; |
| 467 | 460 | 8178D4201F02043500AA78A4 /* LVCLivePlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLivePlayerController.h; sourceTree = "<group>"; }; |
| 468 | 461 | 8178D4211F02043500AA78A4 /* LVCLivePlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCLivePlayerController.m; sourceTree = "<group>"; }; |
| 469 | - 8178D4271F02044300AA78A4 /* LVCChannelDetailsModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCChannelDetailsModel.h; sourceTree = "<group>"; }; | |
| 470 | - 8178D4281F02044300AA78A4 /* LVCChannelDetailsModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCChannelDetailsModel.m; sourceTree = "<group>"; }; | |
| 471 | - 8178D4291F02044300AA78A4 /* LVCChannelsModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCChannelsModel.h; sourceTree = "<group>"; }; | |
| 472 | - 8178D42A1F02044300AA78A4 /* LVCChannelsModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCChannelsModel.m; sourceTree = "<group>"; }; | |
| 473 | 462 | 8178D42B1F02044300AA78A4 /* LVCChatRoomModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCChatRoomModel.h; sourceTree = "<group>"; }; |
| 474 | 463 | 8178D42C1F02044300AA78A4 /* LVCChatRoomModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCChatRoomModel.m; sourceTree = "<group>"; }; |
| 475 | - 8178D42D1F02044300AA78A4 /* LVCProgramModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCProgramModel.h; sourceTree = "<group>"; }; | |
| 476 | - 8178D42E1F02044300AA78A4 /* LVCProgramModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCProgramModel.m; sourceTree = "<group>"; }; | |
| 477 | 464 | 8178D4341F02045500AA78A4 /* CNBarrageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNBarrageManager.h; sourceTree = "<group>"; }; |
| 478 | 465 | 8178D4351F02045500AA78A4 /* CNBarrageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNBarrageManager.m; sourceTree = "<group>"; }; |
| 479 | 466 | 8178D4361F02045500AA78A4 /* CNBarrageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNBarrageView.h; sourceTree = "<group>"; }; |
| 480 | 467 | 8178D4371F02045500AA78A4 /* CNBarrageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNBarrageView.m; sourceTree = "<group>"; }; |
| 481 | - 8178D4381F02045500AA78A4 /* LVCFirstHeaderReusableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCFirstHeaderReusableView.h; sourceTree = "<group>"; }; | |
| 482 | - 8178D4391F02045500AA78A4 /* LVCFirstHeaderReusableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCFirstHeaderReusableView.m; sourceTree = "<group>"; }; | |
| 483 | - 8178D43A1F02045500AA78A4 /* LVCHeaderRollCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCHeaderRollCollectionViewCell.h; sourceTree = "<group>"; }; | |
| 484 | - 8178D43B1F02045500AA78A4 /* LVCHeaderRollCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCHeaderRollCollectionViewCell.m; sourceTree = "<group>"; }; | |
| 485 | - 8178D43C1F02045500AA78A4 /* LVCLiveListCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveListCollectionViewCell.h; sourceTree = "<group>"; }; | |
| 486 | - 8178D43D1F02045500AA78A4 /* LVCLiveListCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCLiveListCollectionViewCell.m; sourceTree = "<group>"; }; | |
| 487 | - 8178D43E1F02045500AA78A4 /* LVCMoreSortTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCMoreSortTableViewCell.h; sourceTree = "<group>"; }; | |
| 488 | - 8178D43F1F02045500AA78A4 /* LVCMoreSortTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMoreSortTableViewCell.m; sourceTree = "<group>"; }; | |
| 489 | - 8178D4401F02045500AA78A4 /* LVCOtherHeaderReusableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCOtherHeaderReusableView.h; sourceTree = "<group>"; }; | |
| 490 | - 8178D4411F02045500AA78A4 /* LVCOtherHeaderReusableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCOtherHeaderReusableView.m; sourceTree = "<group>"; }; | |
| 491 | 468 | 8178D4421F02045500AA78A4 /* LVCPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPlayer.h; sourceTree = "<group>"; }; |
| 492 | 469 | 8178D4431F02045500AA78A4 /* LVCPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPlayer.m; sourceTree = "<group>"; }; |
| 493 | 470 | 8178D4441F02045500AA78A4 /* LVCPlayerLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPlayerLoadingView.h; sourceTree = "<group>"; }; |
| 494 | 471 | 8178D4451F02045500AA78A4 /* LVCPlayerLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPlayerLoadingView.m; sourceTree = "<group>"; }; |
| 495 | 472 | 8178D4461F02045500AA78A4 /* LVCRequestFailedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCRequestFailedView.h; sourceTree = "<group>"; }; |
| 496 | 473 | 8178D4471F02045500AA78A4 /* LVCRequestFailedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCRequestFailedView.m; sourceTree = "<group>"; }; |
| 497 | - 8178D4481F02045500AA78A4 /* LVCTelevisionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTelevisionView.h; sourceTree = "<group>"; }; | |
| 498 | - 8178D4491F02045500AA78A4 /* LVCTelevisionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTelevisionView.m; sourceTree = "<group>"; }; | |
| 499 | 474 | 8178D4551F0204D600AA78A4 /* LVCTelevisioController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTelevisioController.h; sourceTree = "<group>"; }; |
| 500 | 475 | 8178D4561F0204D600AA78A4 /* LVCTelevisioController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTelevisioController.m; sourceTree = "<group>"; }; |
| 501 | 476 | 8178D4591F02060B00AA78A4 /* LVCChatView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCChatView.h; sourceTree = "<group>"; }; |
| ... | ... | @@ -506,10 +481,13 @@ |
| 506 | 481 | 8178D45E1F02060B00AA78A4 /* LVCInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCInputView.m; sourceTree = "<group>"; }; |
| 507 | 482 | 8178D45F1F02060B00AA78A4 /* LVCMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCMessage.h; sourceTree = "<group>"; }; |
| 508 | 483 | 8178D4601F02060B00AA78A4 /* LVCMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMessage.m; sourceTree = "<group>"; }; |
| 484 | + 8178D4671F021C4500AA78A4 /* TelevisionData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = TelevisionData.json; sourceTree = "<group>"; }; | |
| 485 | + 8178D4691F021ED800AA78A4 /* LVCTelevisionModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTelevisionModel.h; sourceTree = "<group>"; }; | |
| 486 | + 8178D46A1F021ED800AA78A4 /* LVCTelevisionModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTelevisionModel.m; sourceTree = "<group>"; }; | |
| 487 | + 8178D46C1F0225E500AA78A4 /* LVCTelevisionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTelevisionCell.h; sourceTree = "<group>"; }; | |
| 488 | + 8178D46D1F0225E500AA78A4 /* LVCTelevisionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTelevisionCell.m; sourceTree = "<group>"; }; | |
| 509 | 489 | 81A483061E88B6140097A80A /* UIView+ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+ViewController.h"; sourceTree = "<group>"; }; |
| 510 | 490 | 81A483071E88B6140097A80A /* UIView+ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ViewController.m"; sourceTree = "<group>"; }; |
| 511 | - 81A483151E88BED00097A80A /* LVCTVLiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCTVLiveViewController.h; sourceTree = "<group>"; }; | |
| 512 | - 81A483161E88BED00097A80A /* LVCTVLiveViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCTVLiveViewController.m; sourceTree = "<group>"; }; | |
| 513 | 491 | 81DFC4251F0113B40029BCB3 /* JsonFile.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = JsonFile.json; sourceTree = "<group>"; }; |
| 514 | 492 | 81F1C8361E8BBDDA0085C2B8 /* MHPagingScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MHPagingScrollView.h; sourceTree = "<group>"; }; |
| 515 | 493 | 81F1C8371E8BBDDA0085C2B8 /* MHPagingScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MHPagingScrollView.m; sourceTree = "<group>"; }; |
| ... | ... | @@ -1159,14 +1137,10 @@ |
| 1159 | 1137 | 8178D41C1F02036200AA78A4 /* Model */ = { |
| 1160 | 1138 | isa = PBXGroup; |
| 1161 | 1139 | children = ( |
| 1162 | - 8178D4271F02044300AA78A4 /* LVCChannelDetailsModel.h */, | |
| 1163 | - 8178D4281F02044300AA78A4 /* LVCChannelDetailsModel.m */, | |
| 1164 | - 8178D4291F02044300AA78A4 /* LVCChannelsModel.h */, | |
| 1165 | - 8178D42A1F02044300AA78A4 /* LVCChannelsModel.m */, | |
| 1166 | 1140 | 8178D42B1F02044300AA78A4 /* LVCChatRoomModel.h */, |
| 1167 | 1141 | 8178D42C1F02044300AA78A4 /* LVCChatRoomModel.m */, |
| 1168 | - 8178D42D1F02044300AA78A4 /* LVCProgramModel.h */, | |
| 1169 | - 8178D42E1F02044300AA78A4 /* LVCProgramModel.m */, | |
| 1142 | + 8178D4691F021ED800AA78A4 /* LVCTelevisionModel.h */, | |
| 1143 | + 8178D46A1F021ED800AA78A4 /* LVCTelevisionModel.m */, | |
| 1170 | 1144 | ); |
| 1171 | 1145 | path = Model; |
| 1172 | 1146 | sourceTree = "<group>"; |
| ... | ... | @@ -1178,22 +1152,12 @@ |
| 1178 | 1152 | 8178D4331F02045500AA78A4 /* Barrage */, |
| 1179 | 1153 | 8178D4421F02045500AA78A4 /* LVCPlayer.h */, |
| 1180 | 1154 | 8178D4431F02045500AA78A4 /* LVCPlayer.m */, |
| 1181 | - 8178D4381F02045500AA78A4 /* LVCFirstHeaderReusableView.h */, | |
| 1182 | - 8178D4391F02045500AA78A4 /* LVCFirstHeaderReusableView.m */, | |
| 1183 | - 8178D43A1F02045500AA78A4 /* LVCHeaderRollCollectionViewCell.h */, | |
| 1184 | - 8178D43B1F02045500AA78A4 /* LVCHeaderRollCollectionViewCell.m */, | |
| 1185 | - 8178D43C1F02045500AA78A4 /* LVCLiveListCollectionViewCell.h */, | |
| 1186 | - 8178D43D1F02045500AA78A4 /* LVCLiveListCollectionViewCell.m */, | |
| 1187 | - 8178D43E1F02045500AA78A4 /* LVCMoreSortTableViewCell.h */, | |
| 1188 | - 8178D43F1F02045500AA78A4 /* LVCMoreSortTableViewCell.m */, | |
| 1189 | - 8178D4401F02045500AA78A4 /* LVCOtherHeaderReusableView.h */, | |
| 1190 | - 8178D4411F02045500AA78A4 /* LVCOtherHeaderReusableView.m */, | |
| 1155 | + 8178D46C1F0225E500AA78A4 /* LVCTelevisionCell.h */, | |
| 1156 | + 8178D46D1F0225E500AA78A4 /* LVCTelevisionCell.m */, | |
| 1191 | 1157 | 8178D4441F02045500AA78A4 /* LVCPlayerLoadingView.h */, |
| 1192 | 1158 | 8178D4451F02045500AA78A4 /* LVCPlayerLoadingView.m */, |
| 1193 | 1159 | 8178D4461F02045500AA78A4 /* LVCRequestFailedView.h */, |
| 1194 | 1160 | 8178D4471F02045500AA78A4 /* LVCRequestFailedView.m */, |
| 1195 | - 8178D4481F02045500AA78A4 /* LVCTelevisionView.h */, | |
| 1196 | - 8178D4491F02045500AA78A4 /* LVCTelevisionView.m */, | |
| 1197 | 1161 | ); |
| 1198 | 1162 | path = View; |
| 1199 | 1163 | sourceTree = "<group>"; |
| ... | ... | @@ -2077,6 +2041,7 @@ |
| 2077 | 2041 | D25BF88A1E7F7F77007FB138 /* Resource */ = { |
| 2078 | 2042 | isa = PBXGroup; |
| 2079 | 2043 | children = ( |
| 2044 | + 8178D4671F021C4500AA78A4 /* TelevisionData.json */, | |
| 2080 | 2045 | 81DFC4251F0113B40029BCB3 /* JsonFile.json */, |
| 2081 | 2046 | D25BF88C1E7F7F77007FB138 /* Images */, |
| 2082 | 2047 | D25BF88B1E7F7F77007FB138 /* Fonts */, |
| ... | ... | @@ -2173,16 +2138,10 @@ |
| 2173 | 2138 | children = ( |
| 2174 | 2139 | D2888DB21E6EC154003A77C8 /* HomeViewController.h */, |
| 2175 | 2140 | D2888DB31E6EC154003A77C8 /* HomeViewController.m */, |
| 2176 | - 810B64E11E779AFE00133E15 /* LVCLivePlayerController.h */, | |
| 2177 | - 810B64E21E779AFE00133E15 /* LVCLivePlayerController.m */, | |
| 2178 | - 810B65081E77B39D00133E15 /* LVCFullScreenPlayerController.h */, | |
| 2179 | - 810B65091E77B39D00133E15 /* LVCFullScreenPlayerController.m */, | |
| 2180 | 2141 | D2EBC85B1F02031400F198FB /* LVCUGCLiveListController.h */, |
| 2181 | 2142 | D2EBC85C1F02031400F198FB /* LVCUGCLiveListController.m */, |
| 2182 | 2143 | D25BF87E1E7BD266007FB138 /* LVCUGCLivePlayerController.h */, |
| 2183 | 2144 | D25BF87F1E7BD266007FB138 /* LVCUGCLivePlayerController.m */, |
| 2184 | - 81A483151E88BED00097A80A /* LVCTVLiveViewController.h */, | |
| 2185 | - 81A483161E88BED00097A80A /* LVCTVLiveViewController.m */, | |
| 2186 | 2145 | D2A089EC1E8A336A0071412C /* LiveListService.h */, |
| 2187 | 2146 | D2A089ED1E8A336A0071412C /* LiveListService.m */, |
| 2188 | 2147 | D2F048681EE54E860011E39C /* LVCLiveActivityInfoService.h */, |
| ... | ... | @@ -2342,6 +2301,7 @@ |
| 2342 | 2301 | D25BF8A51E80EC76007FB138 /* 头像.jpg in Resources */, |
| 2343 | 2302 | D2029CC91E6EADE10027CD92 /* SVProgressHUD.bundle in Resources */, |
| 2344 | 2303 | D2575C801E76A4F300E3A8FC /* resource.bundle in Resources */, |
| 2304 | + 8178D4681F021C4500AA78A4 /* TelevisionData.json in Resources */, | |
| 2345 | 2305 | D2029B941E6EAAA50027CD92 /* LaunchScreen.storyboard in Resources */, |
| 2346 | 2306 | D2029B911E6EAAA50027CD92 /* animation.xcassets in Resources */, |
| 2347 | 2307 | D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */, |
| ... | ... | @@ -2390,7 +2350,6 @@ |
| 2390 | 2350 | 8178D4241F02043500AA78A4 /* LVCFullScreenPlayerController.m in Sources */, |
| 2391 | 2351 | D2029C861E6EADE10027CD92 /* Tools.m in Sources */, |
| 2392 | 2352 | 4B42A6C41EC00CC800DA09D7 /* UIAlertView+Blocks.m in Sources */, |
| 2393 | - 8178D44E1F02045500AA78A4 /* LVCLiveListCollectionViewCell.m in Sources */, | |
| 2394 | 2353 | D25BF8931E7FBAEA007FB138 /* LVCUGCBackgroundView.m in Sources */, |
| 2395 | 2354 | D214CB521EF7CB310014EEBA /* LVCChannelPagingView.m in Sources */, |
| 2396 | 2355 | 4B45CE861EB86A590079AFB7 /* LVCLoginShowView.m in Sources */, |
| ... | ... | @@ -2406,7 +2365,6 @@ |
| 2406 | 2365 | 4BD8560F1EBACEF80082061D /* CNLiveWebView.m in Sources */, |
| 2407 | 2366 | 810B65051E779B1F00133E15 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */, |
| 2408 | 2367 | D2029CCB1E6EADE10027CD92 /* SVRadialGradientLayer.m in Sources */, |
| 2409 | - 8178D4541F02045500AA78A4 /* LVCTelevisionView.m in Sources */, | |
| 2410 | 2368 | D23696841E7FC6A900E4BF71 /* chatListCell.m in Sources */, |
| 2411 | 2369 | 4B45CE7B1EB86A590079AFB7 /* MinePersonalDataController.m in Sources */, |
| 2412 | 2370 | D2029CAF1E6EADE10027CD92 /* MJRefreshStateHeader.m in Sources */, |
| ... | ... | @@ -2418,7 +2376,6 @@ |
| 2418 | 2376 | 4B45CE7D1EB86A590079AFB7 /* ModifyInfomationController.m in Sources */, |
| 2419 | 2377 | D23BBDBB1EF8E8B2002FE0B8 /* LVCBannerAndMarqueeModel.m in Sources */, |
| 2420 | 2378 | D2029CA41E6EADE10027CD92 /* MJRefreshComponent.m in Sources */, |
| 2421 | - 8178D42F1F02044300AA78A4 /* LVCChannelDetailsModel.m in Sources */, | |
| 2422 | 2379 | D2575C7A1E76A4F300E3A8FC /* NHCarViews.m in Sources */, |
| 2423 | 2380 | 8178D44A1F02045500AA78A4 /* CNBarrageManager.m in Sources */, |
| 2424 | 2381 | D209AD711EC583D100D82E3B /* MineAccountController.m in Sources */, |
| ... | ... | @@ -2471,7 +2428,6 @@ |
| 2471 | 2428 | 4BD856181EBAD35C0082061D /* NSDictionary+Safety.m in Sources */, |
| 2472 | 2429 | 4BD856011EBACD530082061D /* AFURLResponseSerialization.m in Sources */, |
| 2473 | 2430 | D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */, |
| 2474 | - 8178D4301F02044300AA78A4 /* LVCChannelsModel.m in Sources */, | |
| 2475 | 2431 | D2EBC8571F01FF9200F198FB /* LVCCommentModel.m in Sources */, |
| 2476 | 2432 | D23BBDB81EF8D15D002FE0B8 /* LVCMainHeaderCollectionReusableView.m in Sources */, |
| 2477 | 2433 | D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */, |
| ... | ... | @@ -2495,7 +2451,6 @@ |
| 2495 | 2451 | 810B65071E779B1F00133E15 /* ViewController+MASAdditions.m in Sources */, |
| 2496 | 2452 | D2029C9A1E6EADE10027CD92 /* MJProperty.m in Sources */, |
| 2497 | 2453 | 4BD856031EBACD530082061D /* AFNetworkActivityIndicatorManager.m in Sources */, |
| 2498 | - 8178D44D1F02045500AA78A4 /* LVCHeaderRollCollectionViewCell.m in Sources */, | |
| 2499 | 2454 | 4BD855CD1EBAC4B70082061D /* CNLiveKeychainWrapper.m in Sources */, |
| 2500 | 2455 | D2029CB91E6EADE10027CD92 /* SDWebImageCompat.m in Sources */, |
| 2501 | 2456 | D2029CB61E6EADE10027CD92 /* MKAnnotationView+WebCache.m in Sources */, |
| ... | ... | @@ -2520,7 +2475,6 @@ |
| 2520 | 2475 | 4B45CE8B1EB86A590079AFB7 /* LVCTextField.m in Sources */, |
| 2521 | 2476 | D2575C461E76857100E3A8FC /* LVCAnimationManager.m in Sources */, |
| 2522 | 2477 | D2A089F11E8A41120071412C /* LVCUGCLiveListModel.m in Sources */, |
| 2523 | - 8178D4321F02044300AA78A4 /* LVCProgramModel.m in Sources */, | |
| 2524 | 2478 | D2CBC13B1ECC157A00E00279 /* LVCVerifyLiveAuthService.m in Sources */, |
| 2525 | 2479 | D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */, |
| 2526 | 2480 | 4B45CE7C1EB86A590079AFB7 /* MineSettingViewController.m in Sources */, |
| ... | ... | @@ -2532,9 +2486,9 @@ |
| 2532 | 2486 | D2029C9F1E6EADE10027CD92 /* NSObject+MJKeyValue.m in Sources */, |
| 2533 | 2487 | D209AD6E1EC583B700D82E3B /* MineMessageController.m in Sources */, |
| 2534 | 2488 | D25BF8A01E80C4BD007FB138 /* UIImage+LVCVagueImage.m in Sources */, |
| 2535 | - 8178D44C1F02045500AA78A4 /* LVCFirstHeaderReusableView.m in Sources */, | |
| 2536 | 2489 | D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */, |
| 2537 | 2490 | 810B65021E779B1F00133E15 /* MASViewAttribute.m in Sources */, |
| 2491 | + 8178D46B1F021ED800AA78A4 /* LVCTelevisionModel.m in Sources */, | |
| 2538 | 2492 | D2B7B2511E8247D400ED084E /* ChatBarrageManager.m in Sources */, |
| 2539 | 2493 | D2029CAC1E6EADE10027CD92 /* MJRefreshBackStateFooter.m in Sources */, |
| 2540 | 2494 | D2029CB11E6EADE10027CD92 /* MJRefreshConst.m in Sources */, |
| ... | ... | @@ -2553,7 +2507,6 @@ |
| 2553 | 2507 | D25BF87B1E7B8A82007FB138 /* SliderView.m in Sources */, |
| 2554 | 2508 | 810B65041E779B1F00133E15 /* NSArray+MASAdditions.m in Sources */, |
| 2555 | 2509 | D25BF8801E7BD266007FB138 /* LVCUGCLivePlayerController.m in Sources */, |
| 2556 | - 8178D4501F02045500AA78A4 /* LVCOtherHeaderReusableView.m in Sources */, | |
| 2557 | 2510 | D2029D031E6EAE2E0027CD92 /* UIImage+ZXExtension.m in Sources */, |
| 2558 | 2511 | 4BD855FC1EBACD530082061D /* AFHTTPSessionManager.m in Sources */, |
| 2559 | 2512 | 4B45CE841EB86A590079AFB7 /* ModifyCommonView.m in Sources */, |
| ... | ... | @@ -2591,7 +2544,6 @@ |
| 2591 | 2544 | 4B42A6C71EC0171800DA09D7 /* PlayRecordCell.m in Sources */, |
| 2592 | 2545 | D217A24E1E7B77C7003B44CB /* ComboCell.m in Sources */, |
| 2593 | 2546 | D24CFC201EFA092300AA6ADB /* JBBannerView.m in Sources */, |
| 2594 | - 8178D44F1F02045500AA78A4 /* LVCMoreSortTableViewCell.m in Sources */, | |
| 2595 | 2547 | D2029CBD1E6EADE10027CD92 /* SDWebImageManager.m in Sources */, |
| 2596 | 2548 | D2029CB41E6EADE10027CD92 /* UIView+MJExtension.m in Sources */, |
| 2597 | 2549 | 81FB5B3C1E7A6FFC00F98E1D /* SevenSwitch.m in Sources */, |
| ... | ... | @@ -2609,10 +2561,10 @@ |
| 2609 | 2561 | D2888D941E6EB8B4003A77C8 /* LVCTabBar.m in Sources */, |
| 2610 | 2562 | 4B45CE771EB86A590079AFB7 /* IDViewController.m in Sources */, |
| 2611 | 2563 | 4BD855FF1EBACD530082061D /* AFURLConnectionOperation.m in Sources */, |
| 2564 | + 8178D46E1F0225E500AA78A4 /* LVCTelevisionCell.m in Sources */, | |
| 2612 | 2565 | D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */, |
| 2613 | 2566 | D2B7B2541E824B2D00ED084E /* ChatBarrageView.m in Sources */, |
| 2614 | 2567 | D25530061E7911A800DF38A5 /* GiftAnimationAction.m in Sources */, |
| 2615 | - 81A483171E88BED00097A80A /* LVCTVLiveViewController.m in Sources */, | |
| 2616 | 2568 | 4B45CE881EB86A590079AFB7 /* LVCMineShowCell.m in Sources */, |
| 2617 | 2569 | D2029CD41E6EADE70027CD92 /* HttpService.m in Sources */, |
| 2618 | 2570 | ); | ... | ... |
LiveVideoCloud.xcodeproj/xcuserdata/iOS.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<Bucket | |
| 3 | + type = "1" | |
| 4 | + version = "2.0"> | |
| 5 | + <Breakpoints> | |
| 6 | + <BreakpointProxy | |
| 7 | + BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
| 8 | + <BreakpointContent | |
| 9 | + shouldBeEnabled = "Yes" | |
| 10 | + ignoreCount = "0" | |
| 11 | + continueAfterRunningActions = "No" | |
| 12 | + scope = "0" | |
| 13 | + stopOnStyle = "0"> | |
| 14 | + </BreakpointContent> | |
| 15 | + </BreakpointProxy> | |
| 16 | + </Breakpoints> | |
| 17 | +</Bucket> | ... | ... |
LiveVideoCloud/AppCustoms/Main/ZXTabBarController.m
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | #import "LVCHomePageViewController.h" |
| 17 | 17 | #import "LVCMineViewController.h"// |
| 18 | 18 | #import "LVCUGCLiveListController.h" |
| 19 | +#import "LVCTelevisioController.h" | |
| 19 | 20 | |
| 20 | 21 | @interface ZXTabBarController ()<LVCTabBarDelegate> |
| 21 | 22 | |
| ... | ... | @@ -53,7 +54,7 @@ |
| 53 | 54 | - (void)createUI |
| 54 | 55 | { |
| 55 | 56 | [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[HomeViewController alloc]init]] title:@"" image:@"home page" selectedImage:@"home page-click on"]; |
| 56 | - [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[HomeViewController alloc]init]] title:@"" image:@"live_default" selectedImage:@"live_focused"]; | |
| 57 | + [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[LVCTelevisioController alloc]init]] title:@"" image:@"live_default" selectedImage:@"live_focused"]; | |
| 57 | 58 | [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[LVCUGCLiveListController alloc]init]] title:@"" image:@"news_default" selectedImage:@"news_focused"]; |
| 58 | 59 | [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[LVCMineViewController alloc]init]] title:@"" image:@"my" selectedImage:@"my-click on"]; |
| 59 | 60 | } | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/Controller/LVCLivePlayerController.h
| ... | ... | @@ -7,10 +7,10 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "BaseViewController.h" |
| 10 | -#import "LVCChannelDetailsModel.h" | |
| 10 | +#import "LVCTelevisionModel.h" | |
| 11 | 11 | |
| 12 | 12 | @interface LVCLivePlayerController : BaseViewController |
| 13 | 13 | |
| 14 | -@property (nonatomic, strong) LVCChannelDetailsModel *model; | |
| 14 | +@property (nonatomic, strong) LVCTelevisionModel *model; | |
| 15 | 15 | |
| 16 | 16 | @end | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/Controller/LVCTelevisioController.m
| ... | ... | @@ -7,23 +7,15 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "LVCTelevisioController.h" |
| 10 | -#import "LVCLiveListCollectionViewCell.h" | |
| 11 | -#import "LVCFirstHeaderReusableView.h" | |
| 12 | -#import "LVCOtherHeaderReusableView.h" | |
| 13 | -#import "LVCChannelDetailsModel.h" | |
| 14 | -#import "LVCChannelsModel.h" | |
| 15 | -#import "LVCLivePlayerController.h" | |
| 10 | +#import "LVCTelevisionModel.h" | |
| 11 | +#import "LVCTelevisionCell.h" | |
| 16 | 12 | |
| 17 | -static NSString *cellId = @"LVCLiveListCollectionViewCell"; | |
| 18 | -static NSString *firstHeaderId = @"LVCFirstHeaderReusableView"; | |
| 19 | -static NSString *otherHeaderId = @"LVCOtherHeaderReusableView"; | |
| 20 | - | |
| 21 | -@interface LVCTelevisioController () | |
| 13 | +@interface LVCTelevisioController ()<UITableViewDelegate, UITableViewDataSource> | |
| 14 | +{ | |
| 15 | + NSMutableArray *_channelsModelArray; | |
| 16 | +} | |
| 22 | 17 | |
| 23 | -@property (nonatomic, strong) UICollectionView *collectionView; | |
| 24 | -@property (nonatomic, strong) NSArray *bannerModelArray; //banner数据源 | |
| 25 | -@property (nonatomic, strong) NSArray *marqueeModelArray; | |
| 26 | -@property (nonatomic, strong) NSArray *channelsModelArray; | |
| 18 | +@property (nonatomic, strong) UITableView *tableView; | |
| 27 | 19 | |
| 28 | 20 | @end |
| 29 | 21 | |
| ... | ... | @@ -33,166 +25,70 @@ static NSString *otherHeaderId = @"LVCOtherHeaderReusableView"; |
| 33 | 25 | [super viewDidLoad]; |
| 34 | 26 | // Do any additional setup after loading the view. |
| 35 | 27 | self.view.backgroundColor = [UIColor whiteColor]; |
| 28 | + self.navigationItem.title = @"直播"; | |
| 29 | + _channelsModelArray = [[NSMutableArray alloc] init]; | |
| 36 | 30 | |
| 37 | - [self.view addSubview:self.collectionView]; | |
| 31 | + [self.view addSubview:self.tableView]; | |
| 38 | 32 | [self loadData]; |
| 39 | 33 | |
| 40 | 34 | } |
| 41 | 35 | |
| 42 | -#pragma mark - | |
| 43 | -#pragma mark - UICollectionViewDataSource | |
| 44 | -- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { | |
| 45 | - if (self.channelsModelArray.count > 0) { | |
| 46 | - return self.channelsModelArray.count + 1; | |
| 47 | - } | |
| 48 | - return self.channelsModelArray.count; | |
| 49 | -} | |
| 36 | +- (void)loadData { | |
| 50 | 37 | |
| 51 | -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { | |
| 38 | + NSString *path = [[NSBundle mainBundle] pathForResource:@"TelevisionData" ofType:@"json"]; | |
| 39 | + NSData *data=[NSData dataWithContentsOfFile:path]; | |
| 40 | + NSError *error; | |
| 41 | + id responseObject=[NSJSONSerialization JSONObjectWithData:data | |
| 42 | + options:NSJSONReadingAllowFragments | |
| 43 | + error:&error]; | |
| 52 | 44 | |
| 53 | - if (section == 0) { | |
| 54 | - return 0; | |
| 45 | + for (NSDictionary *dataDic in responseObject) { | |
| 46 | + LVCTelevisionModel *model = [LVCTelevisionModel mj_objectWithKeyValues:dataDic]; | |
| 47 | + [_channelsModelArray addObject:model]; | |
| 55 | 48 | } |
| 56 | - LVCChannelsModel *model = self.channelsModelArray[section - 1]; | |
| 57 | - | |
| 58 | - NSArray *array = model.programs; | |
| 59 | - | |
| 60 | - return array.count; | |
| 61 | -} | |
| 62 | 49 | |
| 63 | -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { | |
| 64 | - | |
| 65 | - LVCLiveListCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellId forIndexPath:indexPath]; | |
| 66 | - LVCChannelsModel *model = _channelsModelArray[indexPath.section - 1]; | |
| 67 | - | |
| 68 | - LVCChannelDetailsModel *details = model.programs[indexPath.item]; | |
| 69 | - | |
| 70 | - cell.details = details; | |
| 71 | - | |
| 72 | - return cell; | |
| 50 | + [_tableView reloadData]; | |
| 73 | 51 | } |
| 74 | 52 | |
| 75 | -- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath { | |
| 76 | - | |
| 77 | - if (kind == UICollectionElementKindSectionHeader) { | |
| 78 | - | |
| 79 | - if (indexPath.section == 0) { | |
| 80 | - | |
| 81 | - LVCFirstHeaderReusableView *firstHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:firstHeaderId forIndexPath:indexPath]; | |
| 82 | - | |
| 83 | - firstHeaderView.imageUrls = [self bannerImage]; | |
| 84 | - firstHeaderView.modelArray = self.bannerModelArray; | |
| 85 | - | |
| 86 | - return firstHeaderView; | |
| 87 | - } else { | |
| 88 | - | |
| 89 | - LVCOtherHeaderReusableView *otherHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:otherHeaderId forIndexPath:indexPath]; | |
| 90 | - | |
| 91 | - LVCChannelsModel *model = _channelsModelArray[indexPath.section - 1]; | |
| 92 | - | |
| 93 | - otherHeaderView.model = model; | |
| 94 | - | |
| 95 | - return otherHeaderView; | |
| 96 | - } | |
| 97 | - } | |
| 98 | - return nil; | |
| 53 | +#pragma mark - | |
| 54 | +#pragma mark - UITableviewDelegate | |
| 55 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 56 | + return _channelsModelArray.count; | |
| 99 | 57 | } |
| 100 | 58 | |
| 101 | -- (NSArray <NSURL *>*)bannerImage { | |
| 102 | - | |
| 103 | - NSMutableArray *arrayM = [NSMutableArray array]; | |
| 104 | - for (LVCChannelDetailsModel *model in _bannerModelArray) { | |
| 105 | - NSString *imgStr = model.img; | |
| 106 | - NSURL *url = [NSURL URLWithString:imgStr]; | |
| 107 | - [arrayM addObject:url]; | |
| 108 | - } | |
| 109 | - return arrayM.copy; | |
| 59 | +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 60 | + return SCREEN_WIDTH*9/16+40; | |
| 110 | 61 | } |
| 111 | 62 | |
| 112 | -- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section { | |
| 63 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 113 | 64 | |
| 114 | - if (section == 0) { | |
| 115 | - return CGSizeMake(SCREEN_WIDTH, SCREEN_WIDTH * 0.5); | |
| 116 | - }else { | |
| 117 | - return CGSizeMake(SCREEN_WIDTH, 47); | |
| 65 | + static NSString *cellId = @"LVCTelevisionCell"; | |
| 66 | + LVCTelevisionCell *cell = [[LVCTelevisionCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; | |
| 67 | + if (!cell) { | |
| 68 | + cell = [tableView dequeueReusableCellWithIdentifier:cellId]; | |
| 118 | 69 | } |
| 119 | -} | |
| 120 | - | |
| 121 | -#pragma mark - | |
| 122 | -#pragma mark - UICollectionViewDelegate | |
| 123 | -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { | |
| 124 | - | |
| 125 | - LVCChannelsModel *model = _channelsModelArray[indexPath.section - 1]; | |
| 126 | - LVCChannelDetailsModel *details = model.programs[indexPath.item]; | |
| 70 | + LVCTelevisionModel *model = [_channelsModelArray objectAtIndex:indexPath.row]; | |
| 71 | + cell.model = model; | |
| 72 | + return cell; | |
| 127 | 73 | |
| 128 | - LVCLivePlayerController *playVC = [[LVCLivePlayerController alloc] init]; | |
| 129 | - playVC.model = details; | |
| 130 | - self.navigationController.navigationBar.hidden = YES; | |
| 131 | - [self.navigationController pushViewController:playVC animated:YES]; | |
| 132 | - self.hidesBottomBarWhenPushed = NO; | |
| 133 | 74 | } |
| 134 | 75 | |
| 135 | -#pragma mark - | |
| 136 | -#pragma mark - 加载数据 | |
| 137 | -- (void)loadData { | |
| 138 | - | |
| 139 | - NSString *path = [[NSBundle mainBundle] pathForResource:@"JsonFile" ofType:@"json"]; | |
| 140 | - NSData *data=[NSData dataWithContentsOfFile:path]; | |
| 141 | - NSError *error; | |
| 142 | - id responseObject=[NSJSONSerialization JSONObjectWithData:data | |
| 143 | - options:NSJSONReadingAllowFragments | |
| 144 | - error:&error]; | |
| 145 | - // NSLog(@"%@",responseObject); | |
| 146 | - | |
| 147 | - if (responseObject[@"channels"] && [responseObject[@"channels"] isKindOfClass:[NSArray class]]) { | |
| 148 | - | |
| 149 | - NSMutableArray *arrayM = [[NSMutableArray alloc]init]; | |
| 150 | - for (NSDictionary *dict in responseObject[@"channels"]) { | |
| 151 | - LVCChannelsModel *model = [LVCChannelsModel mj_objectWithKeyValues:dict]; | |
| 152 | - [arrayM addObject:model]; | |
| 153 | - } | |
| 154 | - self.channelsModelArray = arrayM; | |
| 155 | - } | |
| 156 | - if (responseObject[@"banner"] && [responseObject[@"banner"] isKindOfClass:[NSArray class]]) { | |
| 157 | - | |
| 158 | - NSMutableArray *arrayM = [NSMutableArray array]; | |
| 159 | - for (NSDictionary *dict in responseObject[@"banner"]) { | |
| 160 | - LVCChannelDetailsModel *rollModel = [LVCChannelDetailsModel mj_objectWithKeyValues:dict]; | |
| 161 | - [arrayM addObject:rollModel]; | |
| 162 | - } | |
| 163 | - self.bannerModelArray = arrayM; | |
| 164 | - } | |
| 165 | - [self.collectionView reloadData]; | |
| 76 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 166 | 77 | |
| 167 | 78 | } |
| 168 | 79 | |
| 169 | 80 | #pragma mark - |
| 170 | 81 | #pragma mark - getter |
| 171 | -- (UICollectionView *)collectionView { | |
| 172 | - | |
| 173 | - if (!_collectionView) { | |
| 174 | - | |
| 175 | - UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init]; | |
| 176 | - layout.itemSize = CGSizeMake((SCREEN_WIDTH-30)/2, (SCREEN_WIDTH-30)/2*9/16+65); | |
| 177 | - layout.minimumLineSpacing = 0; | |
| 178 | - layout.minimumInteritemSpacing = 0; | |
| 179 | - layout.sectionInset = UIEdgeInsetsMake(6, 10, 0, 10); | |
| 180 | - _collectionView.showsHorizontalScrollIndicator = NO; | |
| 181 | - | |
| 182 | - _collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-64-49) collectionViewLayout:layout]; | |
| 183 | - _collectionView.backgroundColor = [UIColor whiteColor]; | |
| 184 | - | |
| 185 | - [_collectionView registerClass:[LVCLiveListCollectionViewCell class] forCellWithReuseIdentifier:cellId]; | |
| 186 | - [_collectionView registerClass:[LVCFirstHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:firstHeaderId]; | |
| 187 | - [_collectionView registerClass:[LVCOtherHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:otherHeaderId]; | |
| 188 | - _collectionView.scrollsToTop = NO; | |
| 189 | - _collectionView.dataSource = self; | |
| 190 | - _collectionView.delegate = self; | |
| 82 | +- (UITableView *)tableView | |
| 83 | +{ | |
| 84 | + if (!_tableView) { | |
| 85 | + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-49) style:UITableViewStylePlain]; | |
| 86 | + _tableView.delegate = self; | |
| 87 | + _tableView.dataSource = self; | |
| 191 | 88 | } |
| 192 | - return _collectionView; | |
| 89 | + return _tableView; | |
| 193 | 90 | } |
| 194 | 91 | |
| 195 | - | |
| 196 | 92 | - (void)didReceiveMemoryWarning { |
| 197 | 93 | [super didReceiveMemoryWarning]; |
| 198 | 94 | // Dispose of any resources that can be recreated. | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/Model/LVCChannelDetailsModel.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCChannelDetailsModel.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <Foundation/Foundation.h> | |
| 10 | - | |
| 11 | -@interface LVCChannelDetailsModel : NSObject | |
| 12 | - | |
| 13 | - | |
| 14 | -// 直播播放 channelId | |
| 15 | -@property (nonatomic, copy) NSString *mediaId; | |
| 16 | -// 播放类型 live直播 | |
| 17 | -@property (nonatomic, copy) NSString *type; | |
| 18 | -// 节目名称 | |
| 19 | -@property (nonatomic, copy) NSString *title; | |
| 20 | -// 节目详情 | |
| 21 | -@property (nonatomic, copy) NSString *subTitle; | |
| 22 | -// 节目图片 | |
| 23 | -@property (nonatomic, copy) NSString *img; | |
| 24 | -// 正在直播 | |
| 25 | -@property (nonatomic, copy) NSString *currentPlay; | |
| 26 | -// 即将直播 | |
| 27 | -@property (nonatomic, copy) NSString *nextPlay; | |
| 28 | -// 活动id (???) | |
| 29 | -@property (nonatomic, copy) NSString *activityId; | |
| 30 | -@property (nonatomic, copy) NSString *docID; | |
| 31 | -@property (nonatomic, copy) NSString *desc; | |
| 32 | - | |
| 33 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/Model/LVCChannelDetailsModel.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCChannelDetailsModel.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCChannelDetailsModel.h" | |
| 10 | - | |
| 11 | -@implementation LVCChannelDetailsModel | |
| 12 | - | |
| 13 | -- (void)setValue:(id)value forUndefinedKey:(NSString *)key { | |
| 14 | - | |
| 15 | -} | |
| 16 | - | |
| 17 | -- (NSString *)description { | |
| 18 | - | |
| 19 | - return [NSString stringWithFormat:@"mediaId:%@, type:%@, title:%@, img:%@",_mediaId,_type,_title,_img]; | |
| 20 | -} | |
| 21 | - | |
| 22 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/Model/LVCChannelsModel.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCChannelsModel.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <Foundation/Foundation.h> | |
| 10 | -#import "LVCChannelDetailsModel.h" | |
| 11 | - | |
| 12 | -@interface LVCChannelsModel : NSObject | |
| 13 | - | |
| 14 | -@property (nonatomic, copy) NSString *title; | |
| 15 | -// 列表详情模型数组 | |
| 16 | -@property (nonatomic, strong) NSArray <LVCChannelDetailsModel *> *programs; | |
| 17 | -@property (nonatomic, copy) NSString *cid; | |
| 18 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/Model/LVCChannelsModel.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCChannelsModel.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCChannelsModel.h" | |
| 10 | - | |
| 11 | -@implementation LVCChannelsModel | |
| 12 | - | |
| 13 | -- (void)setValue:(id)value forKey:(NSString *)key { | |
| 14 | - | |
| 15 | - if ([key isEqualToString:@"programs"]) { | |
| 16 | - | |
| 17 | - NSArray *array = value; | |
| 18 | - | |
| 19 | - NSMutableArray *arrayM = [NSMutableArray array]; | |
| 20 | - | |
| 21 | - for (NSDictionary *dict in array) { | |
| 22 | - | |
| 23 | - LVCChannelDetailsModel *model = [[LVCChannelDetailsModel alloc] init]; | |
| 24 | - | |
| 25 | - [model setValuesForKeysWithDictionary:dict]; | |
| 26 | - | |
| 27 | - [arrayM addObject:model]; | |
| 28 | - } | |
| 29 | - | |
| 30 | - _programs = arrayM.copy; | |
| 31 | - | |
| 32 | - return; | |
| 33 | - } | |
| 34 | - | |
| 35 | - [super setValue:value forKey:key]; | |
| 36 | -} | |
| 37 | - | |
| 38 | -- (void)setValue:(id)value forUndefinedKey:(NSString *)key { | |
| 39 | - | |
| 40 | -} | |
| 41 | - | |
| 42 | -- (NSString *)description { | |
| 43 | - return [NSString stringWithFormat:@"title:%@, programs:%@",_title,_programs]; | |
| 44 | -} | |
| 45 | - | |
| 46 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/Model/LVCProgramModel.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCProgramModel.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <Foundation/Foundation.h> | |
| 10 | - | |
| 11 | -@interface LVCProgramModel : NSObject | |
| 12 | - | |
| 13 | -@property (nonatomic, strong)NSString *currentPlay; | |
| 14 | -@property (nonatomic, strong)NSString *desc; | |
| 15 | -@property (nonatomic, strong)NSString *docID; | |
| 16 | -@property (nonatomic, strong)NSString *img; | |
| 17 | -@property (nonatomic, strong)NSString *mediaId; | |
| 18 | -@property (nonatomic, strong)NSString *nextPlay; | |
| 19 | -@property (nonatomic, strong)NSString *subTitle; | |
| 20 | -@property (nonatomic, strong)NSString *title; | |
| 21 | -@property (nonatomic, strong)NSString *type; | |
| 22 | -@property (nonatomic, strong)NSString *vipFlag; | |
| 23 | - | |
| 24 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/Model/LVCTelevisionModel.h
0 → 100644
| 1 | +// | |
| 2 | +// LVCTelevisionModel.h | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by iOS on 2017/6/27. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <Foundation/Foundation.h> | |
| 10 | + | |
| 11 | +@interface LVCTelevisionModel : NSObject | |
| 12 | + | |
| 13 | +@property (nonatomic, strong) NSString *docID; | |
| 14 | +@property (nonatomic, strong) NSString *title; | |
| 15 | +@property (nonatomic, strong) NSString *img; | |
| 16 | +@property (nonatomic, strong) NSString *type; | |
| 17 | +@property (nonatomic, strong) NSString *mediaId; | |
| 18 | + | |
| 19 | +@end | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/Model/LVCProgramModel.m renamed to LiveVideoCloud/Classes/Sections/PGCSections/Model/LVCTelevisionModel.m
| 1 | 1 | // |
| 2 | -// LVCProgramModel.m | |
| 2 | +// LVCTelevisionModel.m | |
| 3 | 3 | // LiveVideoCloud |
| 4 | 4 | // |
| 5 | -// Created by iOS on 17/3/27. | |
| 5 | +// Created by iOS on 2017/6/27. | |
| 6 | 6 | // Copyright © 2017年 cnlive. All rights reserved. |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | -#import "LVCProgramModel.h" | |
| 9 | +#import "LVCTelevisionModel.h" | |
| 10 | 10 | |
| 11 | -@implementation LVCProgramModel | |
| 11 | +@implementation LVCTelevisionModel | |
| 12 | 12 | |
| 13 | 13 | @end | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCFirstHeaderReusableView.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCFirstHeaderReusableView.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <UIKit/UIKit.h> | |
| 10 | -#import "LVCChannelDetailsModel.h" | |
| 11 | - | |
| 12 | -@interface LVCFirstHeaderReusableView : UICollectionReusableView | |
| 13 | - | |
| 14 | -@property (nonatomic, strong) NSArray <NSURL *> *imageUrls; | |
| 15 | -@property (nonatomic, strong) NSArray <LVCChannelDetailsModel *> *modelArray; | |
| 16 | - | |
| 17 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCFirstHeaderReusableView.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCFirstHeaderReusableView.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCFirstHeaderReusableView.h" | |
| 10 | -#import "LVCHeaderRollCollectionViewCell.h" | |
| 11 | -#import "LVCLivePlayerController.h" | |
| 12 | - | |
| 13 | -#define kDataScaleSeed 100 | |
| 14 | -static NSString *cellId = @"cellId"; | |
| 15 | - | |
| 16 | -@interface CZSlideLayout: UICollectionViewFlowLayout | |
| 17 | - | |
| 18 | -@end | |
| 19 | -@implementation CZSlideLayout | |
| 20 | - | |
| 21 | -- (void)prepareLayout { | |
| 22 | - [super prepareLayout]; | |
| 23 | - self.itemSize = self.collectionView.bounds.size; | |
| 24 | - self.minimumLineSpacing = 0; | |
| 25 | - self.minimumInteritemSpacing = 0; | |
| 26 | - self.scrollDirection = UICollectionViewScrollDirectionHorizontal; | |
| 27 | -} | |
| 28 | -@end | |
| 29 | - | |
| 30 | -@interface LVCFirstHeaderReusableView ()<UICollectionViewDelegate,UICollectionViewDataSource> | |
| 31 | -{ | |
| 32 | - // 定时器 | |
| 33 | - NSTimer *_timer; | |
| 34 | - // 定时器触发时间 | |
| 35 | - NSTimeInterval _timerDuration; | |
| 36 | -} | |
| 37 | - | |
| 38 | -@property (nonatomic, weak) UICollectionView *collectionView; | |
| 39 | -@property (nonatomic, weak) UIPageControl *pageControl; | |
| 40 | -@property (nonatomic, strong)UIButton *button; | |
| 41 | -@property (nonatomic, strong)UILabel *cycleViewTitle; //轮播下方标题 | |
| 42 | - | |
| 43 | -@end | |
| 44 | - | |
| 45 | -@implementation LVCFirstHeaderReusableView | |
| 46 | - | |
| 47 | -#pragma mark - 构造函数 | |
| 48 | -- (instancetype)initWithFrame:(CGRect)frame | |
| 49 | -{ | |
| 50 | - self = [super initWithFrame:frame]; | |
| 51 | - if (self) { | |
| 52 | - [self setupUI]; | |
| 53 | - } | |
| 54 | - return self; | |
| 55 | -} | |
| 56 | - | |
| 57 | -#pragma mark - 设置数据 | |
| 58 | -- (void)setImageUrls:(NSArray<NSURL *> *)imageUrls { | |
| 59 | - _imageUrls = imageUrls; | |
| 60 | - | |
| 61 | - if (_timer != nil) { | |
| 62 | - [_timer invalidate]; | |
| 63 | - } | |
| 64 | - [_collectionView reloadData]; | |
| 65 | - [self addSubview:self.cycleViewTitle]; | |
| 66 | - | |
| 67 | - NSIndexPath *indexPath = [NSIndexPath indexPathForItem:_imageUrls.count * kDataScaleSeed inSection:0]; | |
| 68 | - | |
| 69 | - [_collectionView scrollToItemAtIndexPath:indexPath atScrollPosition:UICollectionViewScrollPositionLeft animated:NO]; | |
| 70 | - | |
| 71 | - // _pageControl.currentPage = 0; | |
| 72 | - // _pageControl.numberOfPages = _imageUrls.count; | |
| 73 | - | |
| 74 | - _timerDuration = 4.0; | |
| 75 | - _timer = [NSTimer timerWithTimeInterval:_timerDuration target:self selector:@selector(updateTimer) userInfo:nil repeats:YES]; | |
| 76 | - | |
| 77 | - [[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes]; | |
| 78 | -} | |
| 79 | - | |
| 80 | -- (void)setModelArray:(NSArray<LVCChannelDetailsModel *> *)modelArray { | |
| 81 | - _modelArray = modelArray; | |
| 82 | - self.cycleViewTitle.text = [NSString stringWithFormat:@" %@",_modelArray[0].title]; | |
| 83 | -} | |
| 84 | - | |
| 85 | -#pragma mark - 子视图 | |
| 86 | -- (UILabel *)cycleViewTitle | |
| 87 | -{ | |
| 88 | - if (!_cycleViewTitle) { | |
| 89 | - | |
| 90 | - _cycleViewTitle = [[UILabel alloc] initWithFrame:CGRectMake(10, self.collectionView.bottom-35, self.collectionView.width, 35)]; | |
| 91 | - _cycleViewTitle.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; | |
| 92 | - _cycleViewTitle.textColor = [UIColor whiteColor]; | |
| 93 | - _cycleViewTitle.font = [UIFont systemFontOfSize:19]; | |
| 94 | - } | |
| 95 | - return _cycleViewTitle; | |
| 96 | -} | |
| 97 | - | |
| 98 | -#pragma mark - 时钟方法 | |
| 99 | -- (void)updateTimer { | |
| 100 | - | |
| 101 | - NSIndexPath *indexPath = [_collectionView indexPathsForVisibleItems].lastObject; | |
| 102 | - NSIndexPath *newIndexPath = [NSIndexPath indexPathForItem:indexPath.item + 1 inSection:indexPath.section]; | |
| 103 | - | |
| 104 | - [_collectionView scrollToItemAtIndexPath:newIndexPath atScrollPosition:UICollectionViewScrollPositionLeft animated:YES]; | |
| 105 | -} | |
| 106 | - | |
| 107 | -#pragma mark - UICollectionViewDataSource 数据源协议方法! | |
| 108 | -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { | |
| 109 | - | |
| 110 | - return _imageUrls.count * kDataScaleSeed * 2; | |
| 111 | -} | |
| 112 | - | |
| 113 | -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { | |
| 114 | - | |
| 115 | - LVCHeaderRollCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellId forIndexPath:indexPath]; | |
| 116 | - NSInteger index = indexPath.item % _imageUrls.count; | |
| 117 | - cell.imageUrl = _imageUrls[index]; | |
| 118 | - return cell; | |
| 119 | -} | |
| 120 | - | |
| 121 | -#pragma mark - UICollectionViewDelegate | |
| 122 | -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
| 123 | - | |
| 124 | - if (_imageUrls.count == 0) { | |
| 125 | - return; | |
| 126 | - } | |
| 127 | - | |
| 128 | - CGFloat offsetX = scrollView.contentOffset.x / scrollView.bounds.size.width; | |
| 129 | - | |
| 130 | - // 2. 根据 offsetX 四舍五入计算页数 | |
| 131 | - NSInteger page = (NSInteger)(offsetX + 0.5); | |
| 132 | - | |
| 133 | - // 3. 根据数组数量,取余数 | |
| 134 | - page = page % _imageUrls.count; | |
| 135 | - | |
| 136 | - // NSLog(@"%zd!!!", page); | |
| 137 | - | |
| 138 | - _pageControl.currentPage = page; | |
| 139 | - | |
| 140 | - self.cycleViewTitle.text = [NSString stringWithFormat:@" %@",_modelArray[page].title]; | |
| 141 | -} | |
| 142 | - | |
| 143 | -/** | |
| 144 | - * 通过设置 contentOffset 动画滚动完成之后调用 | |
| 145 | - */ | |
| 146 | -- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { | |
| 147 | - // 主动调用动画停止代理方法 | |
| 148 | - [self scrollViewDidEndDecelerating:scrollView]; | |
| 149 | -} | |
| 150 | - | |
| 151 | -/** | |
| 152 | - * 滚动视图停止滚动会调用 | |
| 153 | - */ | |
| 154 | -- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { | |
| 155 | - | |
| 156 | - // 根据 contentOffset.x 判断页数 | |
| 157 | - NSInteger page = scrollView.contentOffset.x / scrollView.bounds.size.width; | |
| 158 | - | |
| 159 | - // lastItem = _imageUrl.count * 2 | |
| 160 | - NSInteger lastItem = [_collectionView numberOfItemsInSection:0]; | |
| 161 | - | |
| 162 | - // NSLog(@"第 %zd 页 - lastItem %zd", page, lastItem); | |
| 163 | - // 只处理第 0 页,和最后一页 | |
| 164 | - if (page == 0 || page == (lastItem - 1)) { | |
| 165 | - // 如果是 0 页,跳转到 _imageUrl.count | |
| 166 | - // 如果是最后一页,跳转到 _imageUrl.count - 1 | |
| 167 | - NSInteger offset = _imageUrls.count * kDataScaleSeed; | |
| 168 | - | |
| 169 | - // 判断最后一页 | |
| 170 | - if (page == (lastItem - 1)) { | |
| 171 | - offset = offset - 1; // (5 - 1) * 10 = 40 // 5 * 10 - 1 | |
| 172 | - } | |
| 173 | - | |
| 174 | - // 设置 contentOffset | |
| 175 | - // NSLog(@"我要跳转到 %zd", offset); | |
| 176 | - | |
| 177 | - CGFloat width = scrollView.bounds.size.width; | |
| 178 | - | |
| 179 | - scrollView.contentOffset = CGPointMake(offset * width, 0); | |
| 180 | - } | |
| 181 | -} | |
| 182 | - | |
| 183 | -// 开始拖,暂停时钟! | |
| 184 | -- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { | |
| 185 | - | |
| 186 | - _timer.fireDate = [NSDate distantFuture]; | |
| 187 | -} | |
| 188 | - | |
| 189 | -// 结束拖,继续时钟! | |
| 190 | -- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { | |
| 191 | - | |
| 192 | - _timer.fireDate = [NSDate dateWithTimeIntervalSinceNow:_timerDuration]; | |
| 193 | -} | |
| 194 | - | |
| 195 | -// 选择 | |
| 196 | -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath | |
| 197 | -{ | |
| 198 | - | |
| 199 | - LVCChannelDetailsModel *details = [_modelArray safetyObjectAtIndex:indexPath.row % 5]; | |
| 200 | - self.viewController.tabBarController.tabBar.hidden = YES; | |
| 201 | - LVCLivePlayerController *playVC = [[LVCLivePlayerController alloc] init]; | |
| 202 | - playVC.model = details; | |
| 203 | - self.viewController.navigationController.navigationBar.hidden = YES; | |
| 204 | - self.viewController.hidesBottomBarWhenPushed = YES; | |
| 205 | - [self.viewController.navigationController pushViewController:playVC animated:YES]; | |
| 206 | - self.viewController.hidesBottomBarWhenPushed = NO; | |
| 207 | -} | |
| 208 | - | |
| 209 | -#pragma mark - 第一个组头设置界面 | |
| 210 | -- (void)setupUI { | |
| 211 | - | |
| 212 | - CZSlideLayout *layout = [[CZSlideLayout alloc] init]; | |
| 213 | - UICollectionView *cv = [[UICollectionView alloc] initWithFrame:CGRectMake(10, 7, SCREEN_WIDTH-20, (SCREEN_WIDTH-20)/2) collectionViewLayout:layout]; | |
| 214 | - cv.backgroundColor = [UIColor whiteColor]; | |
| 215 | - | |
| 216 | - [self addSubview:cv]; | |
| 217 | - | |
| 218 | - [cv registerClass:[LVCHeaderRollCollectionViewCell class] forCellWithReuseIdentifier:cellId]; | |
| 219 | - | |
| 220 | - cv.dataSource = self; | |
| 221 | - cv.delegate = self; | |
| 222 | - | |
| 223 | - cv.pagingEnabled = YES; | |
| 224 | - cv.showsVerticalScrollIndicator = NO; | |
| 225 | - cv.showsHorizontalScrollIndicator = NO; | |
| 226 | - cv.bounces = NO; | |
| 227 | - | |
| 228 | - UIPageControl *pager = [[UIPageControl alloc] init]; | |
| 229 | - pager.numberOfPages = 0; | |
| 230 | - pager.currentPage = 0; | |
| 231 | - pager.currentPageIndicatorTintColor = [UIColor yellowColor]; | |
| 232 | - pager.pageIndicatorTintColor = [UIColor redColor]; | |
| 233 | - pager.userInteractionEnabled = NO; | |
| 234 | - | |
| 235 | - _collectionView = cv; | |
| 236 | - _pageControl = pager; | |
| 237 | -} | |
| 238 | - | |
| 239 | -- (void)removeFromSuperview { | |
| 240 | - [super removeFromSuperview]; | |
| 241 | - | |
| 242 | - [_timer invalidate]; | |
| 243 | -} | |
| 244 | - | |
| 245 | -// 添加了时钟 & 运行循环,dealloc 方法不会被调用! | |
| 246 | -- (void)dealloc { | |
| 247 | - | |
| 248 | -} | |
| 249 | - | |
| 250 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCHeaderRollCollectionViewCell.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCHeaderRollCollectionViewCell.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <UIKit/UIKit.h> | |
| 10 | - | |
| 11 | -@interface LVCHeaderRollCollectionViewCell : UICollectionViewCell | |
| 12 | - | |
| 13 | -@property (nonatomic, strong) NSURL *imageUrl; | |
| 14 | - | |
| 15 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCHeaderRollCollectionViewCell.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCHeaderRollCollectionViewCell.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCHeaderRollCollectionViewCell.h" | |
| 10 | - | |
| 11 | -@interface LVCHeaderRollCollectionViewCell () | |
| 12 | - | |
| 13 | -@property (nonatomic, strong) UIImageView *imageView; | |
| 14 | - | |
| 15 | -@end | |
| 16 | - | |
| 17 | -@implementation LVCHeaderRollCollectionViewCell | |
| 18 | - | |
| 19 | -- (instancetype)initWithFrame:(CGRect)frame | |
| 20 | -{ | |
| 21 | - self = [super initWithFrame:frame]; | |
| 22 | - if (self) { | |
| 23 | - | |
| 24 | - [self.contentView addSubview:self.imageView]; | |
| 25 | - | |
| 26 | - } | |
| 27 | - return self; | |
| 28 | -} | |
| 29 | - | |
| 30 | -#pragma mark - | |
| 31 | -#pragma mark - setter | |
| 32 | -- (void)setImageUrl:(NSURL *)imageUrl { | |
| 33 | - _imageUrl = imageUrl; | |
| 34 | - [_imageView sd_setImageWithURL:imageUrl placeholderImage:[UIImage imageNamed:@"load_03"]]; | |
| 35 | -} | |
| 36 | - | |
| 37 | -#pragma mark - | |
| 38 | -#pragma mark - gstter | |
| 39 | -- (UIImageView *)imageView | |
| 40 | -{ | |
| 41 | - if (!_imageView) { | |
| 42 | - _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-20, (SCREEN_WIDTH-20)/2)]; | |
| 43 | - _imageView.backgroundColor = [UIColor whiteColor]; | |
| 44 | - _imageView.contentMode = UIViewContentModeScaleToFill; | |
| 45 | - } | |
| 46 | - return _imageView; | |
| 47 | -} | |
| 48 | - | |
| 49 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCLiveListCollectionViewCell.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCLiveListCollectionViewCell.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <UIKit/UIKit.h> | |
| 10 | -#import "LVCChannelDetailsModel.h" | |
| 11 | - | |
| 12 | -@interface LVCLiveListCollectionViewCell : UICollectionViewCell | |
| 13 | - | |
| 14 | -@property (nonatomic, strong) LVCChannelDetailsModel *details; | |
| 15 | - | |
| 16 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCLiveListCollectionViewCell.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCLiveListCollectionViewCell.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCLiveListCollectionViewCell.h" | |
| 10 | - | |
| 11 | -// 首页横版cell比例 | |
| 12 | -#define H_Cell_Ratio (196.0/300) | |
| 13 | - | |
| 14 | -@interface LVCLiveListCollectionViewCell () | |
| 15 | - | |
| 16 | -@property (nonatomic, strong)UIImageView *image; | |
| 17 | -@property (nonatomic, strong)UILabel *title; | |
| 18 | -@property (nonatomic, strong)UILabel *detail; | |
| 19 | - | |
| 20 | -@end | |
| 21 | - | |
| 22 | -@implementation LVCLiveListCollectionViewCell | |
| 23 | - | |
| 24 | -- (instancetype)initWithFrame:(CGRect)frame | |
| 25 | -{ | |
| 26 | - self = [super initWithFrame:frame]; | |
| 27 | - if (self) { | |
| 28 | - | |
| 29 | - self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 30 | - [self.contentView addSubview:self.image]; | |
| 31 | - [self.contentView addSubview:self.title]; | |
| 32 | - [self.contentView addSubview:self.detail]; | |
| 33 | - | |
| 34 | - } | |
| 35 | - return self; | |
| 36 | -} | |
| 37 | - | |
| 38 | -- (void)setDetails:(LVCChannelDetailsModel *)details { | |
| 39 | - | |
| 40 | - self.title.font = [UIFont systemFontOfSize:13]; | |
| 41 | - self.detail.font = [UIFont systemFontOfSize:12]; | |
| 42 | - self.title.text = [NSString stringWithFormat:@"正在直播:%@", details.currentPlay]; | |
| 43 | - self.detail.text = [NSString stringWithFormat:@"即将直播:%@", details.nextPlay]; | |
| 44 | - [self.image sd_setImageWithURL:[NSURL URLWithString:details.img] placeholderImage:[UIImage imageNamed:@"load_03"]]; | |
| 45 | - | |
| 46 | -} | |
| 47 | - | |
| 48 | -#pragma mark - | |
| 49 | -#pragma mark - getter | |
| 50 | -- (UIImageView *)image | |
| 51 | -{ | |
| 52 | - if (!_image) { | |
| 53 | - _image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.width, (self.contentView.width)*H_Cell_Ratio)]; | |
| 54 | - _image.backgroundColor = [UIColor grayColor]; | |
| 55 | - _image.contentMode = UIViewContentModeScaleAspectFill; | |
| 56 | - _image.clipsToBounds = YES; | |
| 57 | - } | |
| 58 | - return _image; | |
| 59 | -} | |
| 60 | - | |
| 61 | -- (UILabel *)title | |
| 62 | -{ | |
| 63 | - if (!_title) { | |
| 64 | - _title = [[UILabel alloc] initWithFrame:CGRectMake(0, self.image.bottom+7, self.contentView.width, 12)]; | |
| 65 | - _title.font = [UIFont systemFontOfSize:14]; | |
| 66 | - _title.textColor = [UIColor blackColorZX]; | |
| 67 | - } | |
| 68 | - return _title; | |
| 69 | -} | |
| 70 | - | |
| 71 | -- (UILabel *)detail | |
| 72 | -{ | |
| 73 | - if (!_detail) { | |
| 74 | - _detail = [[UILabel alloc] initWithFrame:CGRectMake(0, self.title.bottom+7, self.contentView.width, 11)]; | |
| 75 | - _detail.font = [UIFont systemFontOfSize:12]; | |
| 76 | - _detail.textColor = [UIColor grayColorZX]; | |
| 77 | - } | |
| 78 | - return _detail; | |
| 79 | -} | |
| 80 | - | |
| 81 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCMoreSortTableViewCell.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCMoreSortTableViewCell.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <UIKit/UIKit.h> | |
| 10 | -#import "LVCProgramModel.h" | |
| 11 | - | |
| 12 | -@interface LVCMoreSortTableViewCell : UITableViewCell | |
| 13 | - | |
| 14 | -@property (nonatomic, strong) LVCProgramModel *model; | |
| 15 | - | |
| 16 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCMoreSortTableViewCell.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCMoreSortTableViewCell.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCMoreSortTableViewCell.h" | |
| 10 | - | |
| 11 | -@interface LVCMoreSortTableViewCell () | |
| 12 | - | |
| 13 | -@property(nonatomic,strong)UIImageView *imgView; | |
| 14 | -@property(nonatomic,strong)UILabel *titleLab; | |
| 15 | -@property(nonatomic,strong)UILabel *desLab; | |
| 16 | - | |
| 17 | -@end | |
| 18 | - | |
| 19 | -@implementation LVCMoreSortTableViewCell | |
| 20 | - | |
| 21 | -#pragma mark - Calculate Size Specs | |
| 22 | - | |
| 23 | -- (CGFloat)imageWidth { | |
| 24 | - | |
| 25 | - if (SCREEN_WIDTH == 320.0) { | |
| 26 | - return 96.0; | |
| 27 | - } else if (SCREEN_WIDTH == 375.0) { | |
| 28 | - return 112.0; | |
| 29 | - } else if (SCREEN_WIDTH == 414.0) { | |
| 30 | - return 124.0; | |
| 31 | - } | |
| 32 | - | |
| 33 | - return SCREEN_WIDTH*0.3; | |
| 34 | -} | |
| 35 | - | |
| 36 | -- (CGFloat)imageHeight { | |
| 37 | - if (SCREEN_WIDTH == 320.0) { | |
| 38 | - return 62.5; | |
| 39 | - } else if (SCREEN_WIDTH == 375.0) { | |
| 40 | - return 73.0; | |
| 41 | - } else if (SCREEN_WIDTH == 414.0) { | |
| 42 | - return 81.0; | |
| 43 | - } | |
| 44 | - | |
| 45 | - return SCREEN_WIDTH*0.3*146/224; | |
| 46 | -} | |
| 47 | - | |
| 48 | -- (CGFloat)imageMargin { | |
| 49 | - if (SCREEN_WIDTH == 320.0) { | |
| 50 | - return 8.0; | |
| 51 | - } else if (SCREEN_WIDTH == 375.0) { | |
| 52 | - return 10.0; | |
| 53 | - } else if (SCREEN_WIDTH == 414.0) { | |
| 54 | - return 11.0; | |
| 55 | - } | |
| 56 | - | |
| 57 | - return 10.0; | |
| 58 | -} | |
| 59 | - | |
| 60 | -- (CGFloat)titleMargin { | |
| 61 | - if (SCREEN_WIDTH == 320.0) { | |
| 62 | - return 24.0; | |
| 63 | - } else if (SCREEN_WIDTH == 375.0) { | |
| 64 | - return 28.0; | |
| 65 | - } else if (SCREEN_WIDTH == 414.0) { | |
| 66 | - return 31.0; | |
| 67 | - } | |
| 68 | - | |
| 69 | - return 28.0; | |
| 70 | -} | |
| 71 | - | |
| 72 | -- (CGFloat)subtitleMargin | |
| 73 | -{ | |
| 74 | - if (SCREEN_WIDTH == 320.0) { | |
| 75 | - return 48.0; | |
| 76 | - } else if (SCREEN_WIDTH == 375.0) { | |
| 77 | - return 55.0; | |
| 78 | - } else if (SCREEN_WIDTH == 414.0) { | |
| 79 | - return 60.0; | |
| 80 | - } | |
| 81 | - | |
| 82 | - return 53.0; | |
| 83 | -} | |
| 84 | - | |
| 85 | -- (CGFloat)titleFontSize | |
| 86 | -{ | |
| 87 | - if (SCREEN_WIDTH == 320.0) { | |
| 88 | - return 14.0; | |
| 89 | - } else if (SCREEN_WIDTH == 375.0) { | |
| 90 | - return 17.0; | |
| 91 | - } else if (SCREEN_WIDTH == 414.0) { | |
| 92 | - return 19.0; | |
| 93 | - } | |
| 94 | - | |
| 95 | - return 17.0; | |
| 96 | -} | |
| 97 | - | |
| 98 | -- (CGFloat)subtitleFontSize | |
| 99 | -{ | |
| 100 | - if (SCREEN_WIDTH == 320.0) { | |
| 101 | - return 12.0; | |
| 102 | - } else if (SCREEN_WIDTH == 375.0) { | |
| 103 | - return 14.0; | |
| 104 | - } else if (SCREEN_WIDTH == 414.0) { | |
| 105 | - return 15.0; | |
| 106 | - } | |
| 107 | - | |
| 108 | - return 14.0; | |
| 109 | -} | |
| 110 | - | |
| 111 | -- (CGFloat)cellHeight | |
| 112 | -{ | |
| 113 | - if (SCREEN_WIDTH == 320.0) { | |
| 114 | - return 80.0; | |
| 115 | - } else if (SCREEN_WIDTH == 375.0) { | |
| 116 | - return 93.0; | |
| 117 | - } else if (SCREEN_WIDTH == 414.0) { | |
| 118 | - return 103.0; | |
| 119 | - } | |
| 120 | - return 93.0; | |
| 121 | -} | |
| 122 | - | |
| 123 | -#pragma mark | |
| 124 | -- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
| 125 | -{ | |
| 126 | - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 127 | - if (self) { | |
| 128 | - self.selectionStyle = UITableViewCellSelectionStyleNone; | |
| 129 | - [self.contentView addSubview:self.imgView]; | |
| 130 | - [self.contentView addSubview:self.titleLab]; | |
| 131 | - [self.contentView addSubview:self.desLab]; | |
| 132 | - } | |
| 133 | - return self; | |
| 134 | -} | |
| 135 | - | |
| 136 | --(UIImageView*)imgView | |
| 137 | -{ | |
| 138 | - if (!_imgView) { | |
| 139 | - | |
| 140 | - _imgView=[[UIImageView alloc] initWithFrame:CGRectMake(10, [self imageMargin], [self imageWidth], [self imageHeight])]; | |
| 141 | - } | |
| 142 | - return _imgView; | |
| 143 | -} | |
| 144 | - | |
| 145 | --(UILabel*)titleLab | |
| 146 | -{ | |
| 147 | - if (!_titleLab) { | |
| 148 | - _titleLab=[[UILabel alloc] initWithFrame:CGRectMake([self imageWidth]+20.0, [self titleMargin], SCREEN_WIDTH-[self imageWidth]-30, [self titleFontSize])]; | |
| 149 | - _titleLab.textColor=[UIColor blackColorZX]; | |
| 150 | - _titleLab.font=[UIFont systemFontOfSize:[self titleFontSize]]; | |
| 151 | - } | |
| 152 | - return _titleLab; | |
| 153 | -} | |
| 154 | - | |
| 155 | --(UILabel*)desLab | |
| 156 | -{ | |
| 157 | - if (!_desLab) { | |
| 158 | - _desLab=[[UILabel alloc] initWithFrame:CGRectMake([self imageWidth]+20.0, [self subtitleMargin], SCREEN_WIDTH-[self imageWidth]-30, [self subtitleFontSize])]; | |
| 159 | - _desLab.textColor=[UIColor colorWithHexString:@"#969797"]; | |
| 160 | - _desLab.font=[UIFont systemFontOfSize:[self subtitleFontSize]]; | |
| 161 | - _desLab.numberOfLines=0; | |
| 162 | - } | |
| 163 | - return _desLab; | |
| 164 | -} | |
| 165 | - | |
| 166 | -- (void)setModel:(LVCProgramModel *)model | |
| 167 | -{ | |
| 168 | - self.titleLab.text=model.title; | |
| 169 | - self.desLab.text=model.subTitle; | |
| 170 | - if (model.img) { | |
| 171 | - | |
| 172 | - [self.imgView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"load_03"]]; | |
| 173 | - } | |
| 174 | -} | |
| 175 | - | |
| 176 | -- (void)awakeFromNib { | |
| 177 | - [super awakeFromNib]; | |
| 178 | - // Initialization code | |
| 179 | -} | |
| 180 | - | |
| 181 | -- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 182 | - [super setSelected:selected animated:animated]; | |
| 183 | - | |
| 184 | - // Configure the view for the selected state | |
| 185 | -} | |
| 186 | - | |
| 187 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCOtherHeaderReusableView.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCOtherHeaderCollectionReusableView.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <UIKit/UIKit.h> | |
| 10 | -#import "LVCChannelDetailsModel.h" | |
| 11 | -#import "LVCChannelsModel.h" | |
| 12 | - | |
| 13 | -@interface LVCOtherHeaderReusableView : UICollectionReusableView | |
| 14 | - | |
| 15 | -@property (nonatomic, strong) LVCChannelsModel *model; | |
| 16 | - | |
| 17 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCOtherHeaderReusableView.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCOtherHeaderCollectionReusableView.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCOtherHeaderReusableView.h" | |
| 10 | - | |
| 11 | -@interface LVCOtherHeaderReusableView () | |
| 12 | - | |
| 13 | -@property (nonatomic, strong)UIButton *button; | |
| 14 | -@property (nonatomic, strong)UIView *intervalView; | |
| 15 | - | |
| 16 | -@end | |
| 17 | - | |
| 18 | -@implementation LVCOtherHeaderReusableView | |
| 19 | - | |
| 20 | -- (instancetype)initWithFrame:(CGRect)frame | |
| 21 | -{ | |
| 22 | - self = [super initWithFrame:frame]; | |
| 23 | - if (self) { | |
| 24 | - | |
| 25 | - self.backgroundColor = [UIColor whiteColor]; | |
| 26 | - | |
| 27 | - UIView *intervalView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 6)]; | |
| 28 | - intervalView.backgroundColor = [UIColor backgroundColorZX]; | |
| 29 | - [self addSubview:intervalView]; | |
| 30 | - [self addSubview:self.button]; | |
| 31 | - | |
| 32 | - } | |
| 33 | - return self; | |
| 34 | -} | |
| 35 | - | |
| 36 | -#pragma mark - | |
| 37 | -#pragma mark - setter | |
| 38 | -- (void)setModel:(LVCChannelsModel *)model { | |
| 39 | - | |
| 40 | - _model = model; | |
| 41 | - [self.button setTitle:[NSString stringWithFormat:@" %@", model.title] forState:UIControlStateNormal]; | |
| 42 | -} | |
| 43 | - | |
| 44 | -#pragma mark - | |
| 45 | -#pragma mark - gatter | |
| 46 | -- (UIButton *)button | |
| 47 | -{ | |
| 48 | - if (!_button) { | |
| 49 | - _button = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 50 | - _button.frame = CGRectMake(0, 6, self.frame.size.width, 47); | |
| 51 | - [_button setTitleColor:[UIColor blackColorZX] forState:UIControlStateNormal]; | |
| 52 | - _button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; | |
| 53 | - _button.titleLabel.font = [UIFont boldSystemFontOfSize:18]; | |
| 54 | - } | |
| 55 | - return _button; | |
| 56 | -} | |
| 57 | - | |
| 58 | -@end |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCPlayer.h
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import <UIKit/UIKit.h> |
| 10 | -#import "LVCChannelDetailsModel.h" | |
| 10 | +#import "LVCTelevisionModel.h" | |
| 11 | 11 | |
| 12 | 12 | @class LVCPlayer; |
| 13 | 13 | |
| ... | ... | @@ -29,13 +29,13 @@ typedef void(^HideInputViewBlock)(BOOL hide); |
| 29 | 29 | @property (nonatomic, strong) UIImageView *topBgView; //顶部蒙版 |
| 30 | 30 | @property (nonatomic, strong) UIImageView *bottomBgView; //底部蒙版 |
| 31 | 31 | @property (nonatomic, strong) UIImageView *contentView; //所有空间统一管理在这个view中 |
| 32 | -@property (nonatomic, strong) LVCChannelDetailsModel *model; //所有空间统一管理在这个view中 | |
| 32 | +@property (nonatomic, strong) LVCTelevisionModel *model; //所有空间统一管理在这个view中 | |
| 33 | 33 | @property (nonatomic, readwrite, assign) BOOL isFullScreen; //是否是全屏 |
| 34 | 34 | @property (nonatomic, copy) HideInputViewBlock hideBlock; //全屏模式下是否隐藏输入框 |
| 35 | 35 | @property (nonatomic, assign, readonly) BOOL displayBarrage; //是否显示弹幕 |
| 36 | 36 | @property (nonatomic, assign) id<LVCPlayerDelegate> delegate; |
| 37 | 37 | |
| 38 | -- (instancetype)initWithFrame:(CGRect)frame playerModel:(LVCChannelDetailsModel *)model; | |
| 38 | +- (instancetype)initWithFrame:(CGRect)frame playerModel:(LVCTelevisionModel *)model; | |
| 39 | 39 | |
| 40 | 40 | - (void)autoHideControlView; //自动隐藏上下功能条 |
| 41 | 41 | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCPlayer.m
| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | |
| 13 | 13 | @interface LVCPlayer ()<UIGestureRecognizerDelegate,LVCPlayerLoadingViewDelegate> |
| 14 | 14 | { |
| 15 | - LVCChannelDetailsModel *_model; | |
| 15 | + LVCTelevisionModel *_model; | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | @property (nonatomic, strong) CNLiveMoviePlayerController *player; |
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | NSLog(@"LVCPlayer dealloc"); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -- (instancetype)initWithFrame:(CGRect)frame playerModel:(LVCChannelDetailsModel *)model | |
| 38 | +- (instancetype)initWithFrame:(CGRect)frame playerModel:(LVCTelevisionModel *)model | |
| 39 | 39 | { |
| 40 | 40 | self = [super initWithFrame:frame]; |
| 41 | 41 | if (self) { |
| ... | ... | @@ -62,7 +62,7 @@ |
| 62 | 62 | } |
| 63 | 63 | #pragma mark - |
| 64 | 64 | #pragma mark - initPlayer |
| 65 | -- (void)initPlayerWithModel:(LVCChannelDetailsModel *)model | |
| 65 | +- (void)initPlayerWithModel:(LVCTelevisionModel *)model | |
| 66 | 66 | { |
| 67 | 67 | /* |
| 68 | 68 | */ | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCTelevisionView.h renamed to LiveVideoCloud/Classes/Sections/PGCSections/View/LVCTelevisionCell.h
| 1 | 1 | // |
| 2 | -// LVCTelevisionView.h | |
| 2 | +// LVCTelevisionCell.h | |
| 3 | 3 | // LiveVideoCloud |
| 4 | 4 | // |
| 5 | -// Created by iOS on 17/3/27. | |
| 5 | +// Created by iOS on 2017/6/27. | |
| 6 | 6 | // Copyright © 2017年 cnlive. All rights reserved. |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import <UIKit/UIKit.h> |
| 10 | +#import "LVCTelevisionModel.h" | |
| 10 | 11 | |
| 11 | -@interface LVCTelevisionView : UIView | |
| 12 | +@interface LVCTelevisionCell : UITableViewCell | |
| 13 | + | |
| 14 | +@property (nonatomic, strong) LVCTelevisionModel *model; | |
| 12 | 15 | |
| 13 | 16 | @end | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCTelevisionCell.m
0 → 100644
| 1 | +// | |
| 2 | +// LVCTelevisionCell.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by iOS on 2017/6/27. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "LVCTelevisionCell.h" | |
| 10 | + | |
| 11 | +@interface LVCTelevisionCell () | |
| 12 | + | |
| 13 | +@property (nonatomic, strong) UIImageView *imgView; | |
| 14 | +@property (nonatomic, strong) UILabel *titleLab; | |
| 15 | + | |
| 16 | +@end | |
| 17 | + | |
| 18 | +@implementation LVCTelevisionCell | |
| 19 | + | |
| 20 | +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
| 21 | +{ | |
| 22 | + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
| 23 | + if (self) { | |
| 24 | + self.contentView.backgroundColor = [UIColor whiteColor]; | |
| 25 | + | |
| 26 | + [self.contentView addSubview:self.imgView]; | |
| 27 | + [self.contentView addSubview:self.titleLab]; | |
| 28 | + } | |
| 29 | + return self; | |
| 30 | +} | |
| 31 | + | |
| 32 | +- (void)setModel:(LVCTelevisionModel *)model { | |
| 33 | + [_imgView sd_setImageWithURL:[NSURL URLWithString:model.img] placeholderImage:[UIImage imageNamed:@"load_03"]]; | |
| 34 | + _titleLab.text = model.title; | |
| 35 | + | |
| 36 | +} | |
| 37 | + | |
| 38 | +#pragma mark - | |
| 39 | +#pragma mark - getter | |
| 40 | +- (UIImageView *)imgView | |
| 41 | +{ | |
| 42 | + if (!_imgView) { | |
| 43 | + _imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH*9/16)]; | |
| 44 | + } | |
| 45 | + return _imgView; | |
| 46 | +} | |
| 47 | + | |
| 48 | +- (UILabel *)titleLab | |
| 49 | +{ | |
| 50 | + if (!_titleLab) { | |
| 51 | + _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(10, SCREEN_WIDTH*9/16, SCREEN_WIDTH-20, 40)]; | |
| 52 | + } | |
| 53 | + return _titleLab; | |
| 54 | +} | |
| 55 | + | |
| 56 | +- (void)awakeFromNib { | |
| 57 | + [super awakeFromNib]; | |
| 58 | + // Initialization code | |
| 59 | +} | |
| 60 | + | |
| 61 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 62 | + [super setSelected:selected animated:animated]; | |
| 63 | + | |
| 64 | + // Configure the view for the selected state | |
| 65 | +} | |
| 66 | + | |
| 67 | +@end | ... | ... |
LiveVideoCloud/Classes/Sections/PGCSections/View/LVCTelevisionView.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCTelevisionView.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCTelevisionView.h" | |
| 10 | -#import "LVCLiveListCollectionViewCell.h" | |
| 11 | -#import "LVCFirstHeaderReusableView.h" | |
| 12 | -#import "LVCOtherHeaderReusableView.h" | |
| 13 | -#import "LVCChannelDetailsModel.h" | |
| 14 | -#import "LVCChannelsModel.h" | |
| 15 | -#import "LVCLivePlayerController.h" | |
| 16 | - | |
| 17 | -static NSString *cellId = @"LVCLiveListCollectionViewCell"; | |
| 18 | -static NSString *firstHeaderId = @"LVCFirstHeaderReusableView"; | |
| 19 | -static NSString *otherHeaderId = @"LVCOtherHeaderReusableView"; | |
| 20 | - | |
| 21 | -@interface LVCTelevisionView ()<UICollectionViewDelegate,UICollectionViewDataSource> | |
| 22 | - | |
| 23 | -@property (nonatomic, strong) UICollectionView *collectionView; | |
| 24 | -@property (nonatomic, strong) NSArray *bannerModelArray; //banner数据源 | |
| 25 | -@property (nonatomic, strong) NSArray *marqueeModelArray; | |
| 26 | -@property (nonatomic, strong) NSArray *channelsModelArray; | |
| 27 | - | |
| 28 | -@end | |
| 29 | - | |
| 30 | -@implementation LVCTelevisionView | |
| 31 | - | |
| 32 | -- (instancetype)initWithFrame:(CGRect)frame | |
| 33 | -{ | |
| 34 | - self = [super initWithFrame:frame]; | |
| 35 | - if (self) { | |
| 36 | - | |
| 37 | - self.backgroundColor = [UIColor whiteColor]; | |
| 38 | - | |
| 39 | - [self addSubview:self.collectionView]; | |
| 40 | - [self loadData]; | |
| 41 | - | |
| 42 | - } | |
| 43 | - return self; | |
| 44 | -} | |
| 45 | - | |
| 46 | -#pragma mark - | |
| 47 | -#pragma mark - UICollectionViewDataSource | |
| 48 | -- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { | |
| 49 | - if (self.channelsModelArray.count > 0) { | |
| 50 | - return self.channelsModelArray.count + 1; | |
| 51 | - } | |
| 52 | - return self.channelsModelArray.count; | |
| 53 | -} | |
| 54 | - | |
| 55 | -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { | |
| 56 | - | |
| 57 | - if (section == 0) { | |
| 58 | - return 0; | |
| 59 | - } | |
| 60 | - LVCChannelsModel *model = self.channelsModelArray[section - 1]; | |
| 61 | - | |
| 62 | - NSArray *array = model.programs; | |
| 63 | - | |
| 64 | - return array.count; | |
| 65 | -} | |
| 66 | - | |
| 67 | -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { | |
| 68 | - | |
| 69 | - LVCLiveListCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellId forIndexPath:indexPath]; | |
| 70 | - LVCChannelsModel *model = _channelsModelArray[indexPath.section - 1]; | |
| 71 | - | |
| 72 | - LVCChannelDetailsModel *details = model.programs[indexPath.item]; | |
| 73 | - | |
| 74 | - cell.details = details; | |
| 75 | - | |
| 76 | - return cell; | |
| 77 | -} | |
| 78 | - | |
| 79 | -- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath { | |
| 80 | - | |
| 81 | - if (kind == UICollectionElementKindSectionHeader) { | |
| 82 | - | |
| 83 | - if (indexPath.section == 0) { | |
| 84 | - | |
| 85 | - LVCFirstHeaderReusableView *firstHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:firstHeaderId forIndexPath:indexPath]; | |
| 86 | - | |
| 87 | - firstHeaderView.imageUrls = [self bannerImage]; | |
| 88 | - firstHeaderView.modelArray = self.bannerModelArray; | |
| 89 | - | |
| 90 | - return firstHeaderView; | |
| 91 | - } else { | |
| 92 | - | |
| 93 | - LVCOtherHeaderReusableView *otherHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:otherHeaderId forIndexPath:indexPath]; | |
| 94 | - | |
| 95 | - LVCChannelsModel *model = _channelsModelArray[indexPath.section - 1]; | |
| 96 | - | |
| 97 | - otherHeaderView.model = model; | |
| 98 | - | |
| 99 | - return otherHeaderView; | |
| 100 | - } | |
| 101 | - } | |
| 102 | - return nil; | |
| 103 | -} | |
| 104 | - | |
| 105 | -- (NSArray <NSURL *>*)bannerImage { | |
| 106 | - | |
| 107 | - NSMutableArray *arrayM = [NSMutableArray array]; | |
| 108 | - for (LVCChannelDetailsModel *model in _bannerModelArray) { | |
| 109 | - NSString *imgStr = model.img; | |
| 110 | - NSURL *url = [NSURL URLWithString:imgStr]; | |
| 111 | - [arrayM addObject:url]; | |
| 112 | - } | |
| 113 | - return arrayM.copy; | |
| 114 | -} | |
| 115 | - | |
| 116 | -- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section { | |
| 117 | - | |
| 118 | - if (section == 0) { | |
| 119 | - return CGSizeMake(SCREEN_WIDTH, SCREEN_WIDTH * 0.5); | |
| 120 | - }else { | |
| 121 | - return CGSizeMake(SCREEN_WIDTH, 47); | |
| 122 | - } | |
| 123 | -} | |
| 124 | - | |
| 125 | -#pragma mark - | |
| 126 | -#pragma mark - UICollectionViewDelegate | |
| 127 | -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { | |
| 128 | - | |
| 129 | - LVCChannelsModel *model = _channelsModelArray[indexPath.section - 1]; | |
| 130 | - LVCChannelDetailsModel *details = model.programs[indexPath.item]; | |
| 131 | - self.viewController.hidesBottomBarWhenPushed = YES; | |
| 132 | - LVCLivePlayerController *playVC = [[LVCLivePlayerController alloc] init]; | |
| 133 | - playVC.model = details; | |
| 134 | - self.viewController.navigationController.navigationBar.hidden = YES; | |
| 135 | - [self.viewController.navigationController pushViewController:playVC animated:YES]; | |
| 136 | - self.viewController.hidesBottomBarWhenPushed = NO; | |
| 137 | -} | |
| 138 | - | |
| 139 | -#pragma mark - | |
| 140 | -#pragma mark - 加载数据 | |
| 141 | -- (void)loadData { | |
| 142 | - | |
| 143 | - NSString *path = [[NSBundle mainBundle] pathForResource:@"JsonFile" ofType:@"json"]; | |
| 144 | - NSData *data=[NSData dataWithContentsOfFile:path]; | |
| 145 | - NSError *error; | |
| 146 | - id responseObject=[NSJSONSerialization JSONObjectWithData:data | |
| 147 | - options:NSJSONReadingAllowFragments | |
| 148 | - error:&error]; | |
| 149 | -// NSLog(@"%@",responseObject); | |
| 150 | - | |
| 151 | - if (responseObject[@"channels"] && [responseObject[@"channels"] isKindOfClass:[NSArray class]]) { | |
| 152 | - | |
| 153 | - NSMutableArray *arrayM = [[NSMutableArray alloc]init]; | |
| 154 | - for (NSDictionary *dict in responseObject[@"channels"]) { | |
| 155 | - LVCChannelsModel *model = [LVCChannelsModel mj_objectWithKeyValues:dict]; | |
| 156 | - [arrayM addObject:model]; | |
| 157 | - } | |
| 158 | - self.channelsModelArray = arrayM; | |
| 159 | - } | |
| 160 | - if (responseObject[@"banner"] && [responseObject[@"banner"] isKindOfClass:[NSArray class]]) { | |
| 161 | - | |
| 162 | - NSMutableArray *arrayM = [NSMutableArray array]; | |
| 163 | - for (NSDictionary *dict in responseObject[@"banner"]) { | |
| 164 | - LVCChannelDetailsModel *rollModel = [LVCChannelDetailsModel mj_objectWithKeyValues:dict]; | |
| 165 | - [arrayM addObject:rollModel]; | |
| 166 | - } | |
| 167 | - self.bannerModelArray = arrayM; | |
| 168 | - } | |
| 169 | - [self.collectionView reloadData]; | |
| 170 | - | |
| 171 | -} | |
| 172 | - | |
| 173 | -#pragma mark - | |
| 174 | -#pragma mark - getter | |
| 175 | -- (UICollectionView *)collectionView { | |
| 176 | - | |
| 177 | - if (!_collectionView) { | |
| 178 | - | |
| 179 | - UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init]; | |
| 180 | - layout.itemSize = CGSizeMake((SCREEN_WIDTH-30)/2, (SCREEN_WIDTH-30)/2*9/16+65); | |
| 181 | - layout.minimumLineSpacing = 0; | |
| 182 | - layout.minimumInteritemSpacing = 0; | |
| 183 | - layout.sectionInset = UIEdgeInsetsMake(6, 10, 0, 10); | |
| 184 | - _collectionView.showsHorizontalScrollIndicator = NO; | |
| 185 | - | |
| 186 | - _collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-64-49) collectionViewLayout:layout]; | |
| 187 | - _collectionView.backgroundColor = [UIColor whiteColor]; | |
| 188 | - | |
| 189 | - [_collectionView registerClass:[LVCLiveListCollectionViewCell class] forCellWithReuseIdentifier:cellId]; | |
| 190 | - [_collectionView registerClass:[LVCFirstHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:firstHeaderId]; | |
| 191 | - [_collectionView registerClass:[LVCOtherHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:otherHeaderId]; | |
| 192 | - _collectionView.scrollsToTop = NO; | |
| 193 | - _collectionView.dataSource = self; | |
| 194 | - _collectionView.delegate = self; | |
| 195 | - } | |
| 196 | - return _collectionView; | |
| 197 | -} | |
| 198 | - | |
| 199 | -/* | |
| 200 | -// Only override drawRect: if you perform custom drawing. | |
| 201 | -// An empty implementation adversely affects performance during animation. | |
| 202 | -- (void)drawRect:(CGRect)rect { | |
| 203 | - // Drawing code | |
| 204 | -} | |
| 205 | -*/ | |
| 206 | - | |
| 207 | -@end |
LiveVideoCloud/Classes/Sections/homeSections/Controller/HomeViewController.m
| ... | ... | @@ -10,8 +10,6 @@ |
| 10 | 10 | #import "LVCLivePlayerController.h" |
| 11 | 11 | #import "LVCLivePlayerController.h" |
| 12 | 12 | #import "LVCUGCLivePlayerController.h" |
| 13 | -#import "LVCTVLiveViewController.h" | |
| 14 | -#import "LVCTelevisionView.h" | |
| 15 | 13 | #import "LVCUGCLiveListView.h" |
| 16 | 14 | #import "LVCVodPlayerListView.h" |
| 17 | 15 | |
| ... | ... | @@ -34,23 +32,77 @@ |
| 34 | 32 | self.view.backgroundColor = [UIColor whiteColor]; |
| 35 | 33 | |
| 36 | 34 | _titleArr = @[@"电视台"]; |
| 37 | - CGFloat width = 0; | |
| 38 | - for (NSString *title in _titleArr) { | |
| 39 | - CGSize size = [title sizeWithAttributes:@{NSFontAttributeName:self.titleView.elementFont}]; | |
| 40 | - width += size.width+5; | |
| 41 | - } | |
| 42 | - if (width < self.titleView.width) { | |
| 43 | - _titleSpace = (self.titleView.width-width)/_titleArr.count; | |
| 44 | - } else { | |
| 45 | - _titleSpace = 0; | |
| 46 | - } | |
| 47 | - | |
| 48 | - self.navigationItem.titleView = self.titleView; | |
| 49 | - | |
| 50 | - [_pageView reloadPages]; | |
| 51 | - [_titleView reloadData]; | |
| 52 | - [self.view addSubview:self.pageView]; | |
| 53 | - | |
| 35 | +// CGFloat width = 0; | |
| 36 | +// for (NSString *title in _titleArr) { | |
| 37 | +// CGSize size = [title sizeWithAttributes:@{NSFontAttributeName:self.titleView.elementFont}]; | |
| 38 | +// width += size.width+5; | |
| 39 | +// } | |
| 40 | +// if (width < self.titleView.width) { | |
| 41 | +// _titleSpace = (self.titleView.width-width)/_titleArr.count; | |
| 42 | +// } else { | |
| 43 | +// _titleSpace = 0; | |
| 44 | +// } | |
| 45 | +// | |
| 46 | +// self.navigationItem.titleView = self.titleView; | |
| 47 | +// | |
| 48 | +// [_pageView reloadPages]; | |
| 49 | +// [_titleView reloadData]; | |
| 50 | +// [self.view addSubview:self.pageView]; | |
| 51 | +//// | |
| 52 | +// NSArray *arr = @[ @{ | |
| 53 | +// @"mediaId": @"liveshow", | |
| 54 | +// @"title": @"LiveShow", | |
| 55 | +// @"img": @"http://yweb0.cnliveimg.com/cnlive/public/150417133551285_693.png", | |
| 56 | +// @"docID": @"408481", | |
| 57 | +// @"type": @"live"}, | |
| 58 | +// | |
| 59 | +// @{ | |
| 60 | +// @"mediaId": @"news", | |
| 61 | +// @"title": @"快新闻", | |
| 62 | +// @"img": @"http://yweb1.cnliveimg.com/img/cnlive/160121113653827_867.png", | |
| 63 | +// @"docID": @"285697", | |
| 64 | +// @"type": @"live"}, | |
| 65 | +// | |
| 66 | +// | |
| 67 | +// @{ | |
| 68 | +// @"mediaId": @"eyule", | |
| 69 | +// @"title": @"e娱乐", | |
| 70 | +// @"img": @"http://yweb2.cnliveimg.com/img/cnlive/160121113659992_585.png", | |
| 71 | +// @"docID": @"408480", | |
| 72 | +// @"type": @"live"}, | |
| 73 | +// | |
| 74 | +// @{ | |
| 75 | +// @"mediaId": @"chaotiyu", | |
| 76 | +// @"title": @"潮体育", | |
| 77 | +// @"img": @"http://yweb3.cnliveimg.com/img/cnlive/160121113706887_696.png", | |
| 78 | +// @"docID": @"285698", | |
| 79 | +// @"type": @"live"}, | |
| 80 | +// | |
| 81 | +// @{ | |
| 82 | +// @"mediaId": @"xuanhanyu", | |
| 83 | +// @"title": @"炫韩娱", | |
| 84 | +// @"img": @"http://yweb0.cnliveimg.com/cnlive/public/150417133341123_878.png", | |
| 85 | +// @"docID": @"408487", | |
| 86 | +// @"type": @"live"}, | |
| 87 | +// @{ | |
| 88 | +// @"mediaId": @"inyuetai", | |
| 89 | +// @"title": @"in乐台", | |
| 90 | +// @"img": @"http://yweb1.cnliveimg.com/cnlive/public/150417144750615_185.png", | |
| 91 | +// @"docID": @"285696", | |
| 92 | +// @"type": @"live"}, | |
| 93 | +// | |
| 94 | +// ]; | |
| 95 | +// | |
| 96 | +// NSData *data=[NSJSONSerialization dataWithJSONObject:arr options:NSJSONWritingPrettyPrinted error:nil]; | |
| 97 | +// NSString *jsonStr=[[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding]; | |
| 98 | +// NSLog(@"%@", jsonStr); | |
| 99 | +// | |
| 100 | +// NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
| 101 | +// NSString *path=[paths objectAtIndex:0]; | |
| 102 | +// NSString *Json_path=[path stringByAppendingPathComponent:@"TelevisionData.json"]; | |
| 103 | +// //==写入文件 | |
| 104 | +// NSLog(@"%@",[data writeToFile:Json_path atomically:YES] ? @"Succeed":@"Failed"); | |
| 105 | + | |
| 54 | 106 | } |
| 55 | 107 | |
| 56 | 108 | #pragma mark - V8HorizontalPickerViewDataSource |
| ... | ... | @@ -111,14 +163,14 @@ |
| 111 | 163 | |
| 112 | 164 | - (UIView *)pagingScrollView:(MHPagingScrollView *)pagingScrollView pageForIndex:(NSUInteger)index |
| 113 | 165 | { |
| 114 | - if ([_titleArr[index] isEqualToString:@"电视台"]) { | |
| 115 | - | |
| 116 | - LVCTelevisionView *tvView = (LVCTelevisionView *)[pagingScrollView pageViewByIndex:index]; | |
| 117 | - if (!tvView) { | |
| 118 | - tvView = [[LVCTelevisionView alloc] init]; | |
| 119 | - } | |
| 120 | - return tvView; | |
| 121 | - } | |
| 166 | +// if ([_titleArr[index] isEqualToString:@"电视台"]) { | |
| 167 | +// | |
| 168 | +// LVCTelevisionView *tvView = (LVCTelevisionView *)[pagingScrollView pageViewByIndex:index]; | |
| 169 | +// if (!tvView) { | |
| 170 | +// tvView = [[LVCTelevisionView alloc] init]; | |
| 171 | +// } | |
| 172 | +// return tvView; | |
| 173 | +// } | |
| 122 | 174 | // else if ([_titleArr[index] isEqualToString:@"直播"]) { |
| 123 | 175 | // |
| 124 | 176 | // LVCUGCLiveListView *liveListView = (LVCUGCLiveListView *)[pagingScrollView pageViewByIndex:index]; | ... | ... |
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCTVLiveViewController.h deleted
100644 → 0
LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCTVLiveViewController.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCLiveViewController.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by iOS on 17/3/27. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCTVLiveViewController.h" | |
| 10 | -#import "LVCTelevisionView.h" | |
| 11 | - | |
| 12 | -@interface LVCTVLiveViewController () | |
| 13 | - | |
| 14 | -@property (nonatomic, strong) LVCTelevisionView *tvView; | |
| 15 | - | |
| 16 | -@end | |
| 17 | - | |
| 18 | -@implementation LVCTVLiveViewController | |
| 19 | - | |
| 20 | -- (void)viewDidLoad { | |
| 21 | - [super viewDidLoad]; | |
| 22 | - | |
| 23 | - self.view.backgroundColor = [UIColor whiteColor]; | |
| 24 | - | |
| 25 | - [self.view addSubview:self.tvView]; | |
| 26 | -} | |
| 27 | - | |
| 28 | -- (LVCTelevisionView *)tvView | |
| 29 | -{ | |
| 30 | - if (!_tvView) { | |
| 31 | - _tvView = [[LVCTelevisionView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; | |
| 32 | - } | |
| 33 | - return _tvView; | |
| 34 | -} | |
| 35 | - | |
| 36 | -- (void)didReceiveMemoryWarning { | |
| 37 | - [super didReceiveMemoryWarning]; | |
| 38 | - // Dispose of any resources that can be recreated. | |
| 39 | -} | |
| 40 | - | |
| 41 | -/* | |
| 42 | -#pragma mark - Navigation | |
| 43 | - | |
| 44 | -// In a storyboard-based application, you will often want to do a little preparation before navigation | |
| 45 | -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
| 46 | - // Get the new view controller using [segue destinationViewController]. | |
| 47 | - // Pass the selected object to the new view controller. | |
| 48 | -} | |
| 49 | -*/ | |
| 50 | - | |
| 51 | -@end |
LiveVideoCloud/Resource/TelevisionData.json
0 → 100644
| 1 | +[ | |
| 2 | + { | |
| 3 | + "docID" : "408481", | |
| 4 | + "title" : "LiveShow", | |
| 5 | + "img" : "http:\/\/yweb0.cnliveimg.com\/cnlive\/public\/150417133551285_693.png", | |
| 6 | + "type" : "live", | |
| 7 | + "mediaId" : "liveshow" | |
| 8 | + }, | |
| 9 | + { | |
| 10 | + "docID" : "285697", | |
| 11 | + "title" : "快新闻", | |
| 12 | + "img" : "http:\/\/yweb1.cnliveimg.com\/img\/cnlive\/160121113653827_867.png", | |
| 13 | + "type" : "live", | |
| 14 | + "mediaId" : "news" | |
| 15 | + }, | |
| 16 | + { | |
| 17 | + "docID" : "408480", | |
| 18 | + "title" : "e娱乐", | |
| 19 | + "img" : "http:\/\/yweb2.cnliveimg.com\/img\/cnlive\/160121113659992_585.png", | |
| 20 | + "type" : "live", | |
| 21 | + "mediaId" : "eyule" | |
| 22 | + }, | |
| 23 | + { | |
| 24 | + "docID" : "285698", | |
| 25 | + "title" : "潮体育", | |
| 26 | + "img" : "http:\/\/yweb3.cnliveimg.com\/img\/cnlive\/160121113706887_696.png", | |
| 27 | + "type" : "live", | |
| 28 | + "mediaId" : "chaotiyu" | |
| 29 | + }, | |
| 30 | + { | |
| 31 | + "docID" : "408487", | |
| 32 | + "title" : "炫韩娱", | |
| 33 | + "img" : "http:\/\/yweb0.cnliveimg.com\/cnlive\/public\/150417133341123_878.png", | |
| 34 | + "type" : "live", | |
| 35 | + "mediaId" : "xuanhanyu" | |
| 36 | + }, | |
| 37 | + { | |
| 38 | + "docID" : "285696", | |
| 39 | + "title" : "in乐台", | |
| 40 | + "img" : "http:\/\/yweb1.cnliveimg.com\/cnlive\/public\/150417144750615_185.png", | |
| 41 | + "type" : "live", | |
| 42 | + "mediaId" : "inyuetai" | |
| 43 | + } | |
| 44 | +] | |
| 0 | 45 | \ No newline at end of file | ... | ... |