Commit 956cf426d25f5ffa971a042e8084c4f56aa0f587
Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/LiveVideoCloud
# Conflicts: # LiveVideoCloud/LiveVideoCloud.xcodeproj/project.pbxproj # LiveVideoCloud/LiveVideoCloud/Info
Showing
74 changed files
with
2449 additions
and
377 deletions
LiveVideoCloud/LiveVideoCloud.xcodeproj/project.pbxproj
| ... | ... | @@ -19,12 +19,14 @@ |
| 19 | 19 | 810B65051E779B1F00133E15 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64F81E779B1F00133E15 /* NSLayoutConstraint+MASDebugAdditions.m */; }; |
| 20 | 20 | 810B65061E779B1F00133E15 /* View+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64FA1E779B1F00133E15 /* View+MASAdditions.m */; }; |
| 21 | 21 | 810B65071E779B1F00133E15 /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64FD1E779B1F00133E15 /* ViewController+MASAdditions.m */; }; |
| 22 | + 810B650A1E77B39D00133E15 /* LVCFullScreenPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B65091E77B39D00133E15 /* LVCFullScreenPlayerController.m */; }; | |
| 23 | + 8112D4311E7927A5002E00F6 /* LVCPlayerLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8112D4301E7927A5002E00F6 /* LVCPlayerLoadingView.m */; }; | |
| 22 | 24 | 812E50531E7699DC004F5FCD /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 812E50501E7699DC004F5FCD /* CNLivePlayerSDK.framework */; }; |
| 23 | 25 | 812E50551E7699E9004F5FCD /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 812E504F1E7699DC004F5FCD /* CNLiveMsgTools.framework */; }; |
| 24 | 26 | 812E50561E7699E9004F5FCD /* CNLiveMsgTools.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 812E504F1E7699DC004F5FCD /* CNLiveMsgTools.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; |
| 25 | 27 | 812E50581E7699E9004F5FCD /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 812E50501E7699DC004F5FCD /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; |
| 28 | + 81FB5B3C1E7A6FFC00F98E1D /* SevenSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 81FB5B3B1E7A6FFC00F98E1D /* SevenSwitch.m */; }; | |
| 26 | 29 | D2029B861E6EAAA50027CD92 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029B851E6EAAA50027CD92 /* main.m */; }; |
| 27 | - D2029B8F1E6EAAA50027CD92 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D2029B8D1E6EAAA50027CD92 /* Main.storyboard */; }; | |
| 28 | 30 | D2029B911E6EAAA50027CD92 /* animation.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D2029B901E6EAAA50027CD92 /* animation.xcassets */; }; |
| 29 | 31 | D2029B941E6EAAA50027CD92 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D2029B921E6EAAA50027CD92 /* LaunchScreen.storyboard */; }; |
| 30 | 32 | D2029B9F1E6EAAA50027CD92 /* LiveVideoCloudTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029B9E1E6EAAA50027CD92 /* LiveVideoCloudTests.m */; }; |
| ... | ... | @@ -127,10 +129,14 @@ |
| 127 | 129 | D22830FF1E77C69E00627701 /* GiftListView.m in Sources */ = {isa = PBXBuildFile; fileRef = D22830FE1E77C69E00627701 /* GiftListView.m */; }; |
| 128 | 130 | D22831021E77D83C00627701 /* GiftModelView.m in Sources */ = {isa = PBXBuildFile; fileRef = D22831011E77D83C00627701 /* GiftModelView.m */; }; |
| 129 | 131 | D22831091E77D8D500627701 /* GiftModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D22831081E77D8D500627701 /* GiftModel.m */; }; |
| 132 | + D25530001E7909AC00DF38A5 /* GiftAnimOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D2552FFF1E7909AC00DF38A5 /* GiftAnimOperation.m */; }; | |
| 133 | + D25530031E79115100DF38A5 /* AnimQueueManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D25530021E79115100DF38A5 /* AnimQueueManager.m */; }; | |
| 134 | + D25530061E7911A800DF38A5 /* GiftAnimationAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D25530051E7911A800DF38A5 /* GiftAnimationAction.m */; }; | |
| 135 | + D25530091E791A7100DF38A5 /* GiftComboView.m in Sources */ = {isa = PBXBuildFile; fileRef = D25530081E791A7100DF38A5 /* GiftComboView.m */; }; | |
| 136 | + D255300C1E793F8200DF38A5 /* NHFighterView+animDelegagte.m in Sources */ = {isa = PBXBuildFile; fileRef = D255300B1E793F8200DF38A5 /* NHFighterView+animDelegagte.m */; }; | |
| 130 | 137 | D2575C461E76857100E3A8FC /* LVCAnimationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C451E76857100E3A8FC /* LVCAnimationManager.m */; }; |
| 131 | 138 | D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C481E7685DE00E3A8FC /* UIView+Bubbling.m */; }; |
| 132 | 139 | D2575C671E76A25400E3A8FC /* LVCInteractionController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C661E76A25400E3A8FC /* LVCInteractionController.m */; }; |
| 133 | - D2575C6B1E76A45400E3A8FC /* LVCGiftManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C6A1E76A45400E3A8FC /* LVCGiftManager.m */; }; | |
| 134 | 140 | D2575C7A1E76A4F300E3A8FC /* NHCarViews.m in Sources */ = {isa = PBXBuildFile; fileRef = D2575C6F1E76A4F300E3A8FC /* NHCarViews.m */; }; |
| 135 | 141 | D2575C7B1E76A4F300E3A8FC /* NHCarViews.xib in Resources */ = {isa = PBXBuildFile; fileRef = D2575C701E76A4F300E3A8FC /* NHCarViews.xib */; }; |
| 136 | 142 | D2575C7C1E76A4F300E3A8FC /* NHFighterView.nib in Resources */ = {isa = PBXBuildFile; fileRef = D2575C721E76A4F300E3A8FC /* NHFighterView.nib */; }; |
| ... | ... | @@ -210,11 +216,17 @@ |
| 210 | 216 | 810B64FB1E779B1F00133E15 /* View+MASShorthandAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "View+MASShorthandAdditions.h"; sourceTree = "<group>"; }; |
| 211 | 217 | 810B64FC1E779B1F00133E15 /* ViewController+MASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ViewController+MASAdditions.h"; sourceTree = "<group>"; }; |
| 212 | 218 | 810B64FD1E779B1F00133E15 /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ViewController+MASAdditions.m"; sourceTree = "<group>"; }; |
| 219 | + 810B65081E77B39D00133E15 /* LVCFullScreenPlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCFullScreenPlayerController.h; sourceTree = "<group>"; }; | |
| 220 | + 810B65091E77B39D00133E15 /* LVCFullScreenPlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCFullScreenPlayerController.m; sourceTree = "<group>"; }; | |
| 221 | + 8112D42F1E7927A5002E00F6 /* LVCPlayerLoadingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPlayerLoadingView.h; sourceTree = "<group>"; }; | |
| 222 | + 8112D4301E7927A5002E00F6 /* LVCPlayerLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPlayerLoadingView.m; sourceTree = "<group>"; }; | |
| 213 | 223 | 812E504F1E7699DC004F5FCD /* CNLiveMsgTools.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveMsgTools.framework; sourceTree = "<group>"; }; |
| 214 | 224 | 812E50501E7699DC004F5FCD /* CNLivePlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLivePlayerSDK.framework; sourceTree = "<group>"; }; |
| 225 | + 812E50511E7699DC004F5FCD /* KSYGPUResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = KSYGPUResource.bundle; sourceTree = "<group>"; }; | |
| 226 | + 81FB5B3A1E7A6FFC00F98E1D /* SevenSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SevenSwitch.h; sourceTree = "<group>"; }; | |
| 227 | + 81FB5B3B1E7A6FFC00F98E1D /* SevenSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SevenSwitch.m; sourceTree = "<group>"; }; | |
| 215 | 228 | D2029B811E6EAAA50027CD92 /* LiveVideoCloud.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LiveVideoCloud.app; sourceTree = BUILT_PRODUCTS_DIR; }; |
| 216 | 229 | D2029B851E6EAAA50027CD92 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; |
| 217 | - D2029B8E1E6EAAA50027CD92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; | |
| 218 | 230 | D2029B901E6EAAA50027CD92 /* animation.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = animation.xcassets; sourceTree = "<group>"; }; |
| 219 | 231 | D2029B931E6EAAA50027CD92 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; |
| 220 | 232 | D2029B951E6EAAA50027CD92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; |
| ... | ... | @@ -434,14 +446,22 @@ |
| 434 | 446 | D22831011E77D83C00627701 /* GiftModelView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GiftModelView.m; sourceTree = "<group>"; }; |
| 435 | 447 | D22831071E77D8D500627701 /* GiftModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GiftModel.h; sourceTree = "<group>"; }; |
| 436 | 448 | D22831081E77D8D500627701 /* GiftModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GiftModel.m; sourceTree = "<group>"; }; |
| 437 | - D2575C441E76857100E3A8FC /* LVCAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCAnimationManager.h; sourceTree = "<group>"; }; | |
| 438 | - D2575C451E76857100E3A8FC /* LVCAnimationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCAnimationManager.m; sourceTree = "<group>"; }; | |
| 449 | + D2552FFE1E7909AC00DF38A5 /* GiftAnimOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GiftAnimOperation.h; sourceTree = "<group>"; }; | |
| 450 | + D2552FFF1E7909AC00DF38A5 /* GiftAnimOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GiftAnimOperation.m; sourceTree = "<group>"; }; | |
| 451 | + D25530011E79115100DF38A5 /* AnimQueueManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimQueueManager.h; sourceTree = "<group>"; }; | |
| 452 | + D25530021E79115100DF38A5 /* AnimQueueManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnimQueueManager.m; sourceTree = "<group>"; }; | |
| 453 | + D25530041E7911A800DF38A5 /* GiftAnimationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GiftAnimationAction.h; sourceTree = "<group>"; }; | |
| 454 | + D25530051E7911A800DF38A5 /* GiftAnimationAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GiftAnimationAction.m; sourceTree = "<group>"; }; | |
| 455 | + D25530071E791A7100DF38A5 /* GiftComboView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GiftComboView.h; sourceTree = "<group>"; }; | |
| 456 | + D25530081E791A7100DF38A5 /* GiftComboView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GiftComboView.m; sourceTree = "<group>"; }; | |
| 457 | + D255300A1E793F8200DF38A5 /* NHFighterView+animDelegagte.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NHFighterView+animDelegagte.h"; sourceTree = "<group>"; }; | |
| 458 | + D255300B1E793F8200DF38A5 /* NHFighterView+animDelegagte.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NHFighterView+animDelegagte.m"; sourceTree = "<group>"; }; | |
| 459 | + D2575C441E76857100E3A8FC /* LVCAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LVCAnimationManager.h; path = ../LVCAnimationManager.h; sourceTree = "<group>"; }; | |
| 460 | + D2575C451E76857100E3A8FC /* LVCAnimationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LVCAnimationManager.m; path = ../LVCAnimationManager.m; sourceTree = "<group>"; }; | |
| 439 | 461 | D2575C481E7685DE00E3A8FC /* UIView+Bubbling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Bubbling.m"; sourceTree = "<group>"; }; |
| 440 | 462 | D2575C491E7685DE00E3A8FC /* UIView+Bubbling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Bubbling.h"; sourceTree = "<group>"; }; |
| 441 | 463 | D2575C651E76A25400E3A8FC /* LVCInteractionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCInteractionController.h; sourceTree = "<group>"; }; |
| 442 | 464 | D2575C661E76A25400E3A8FC /* LVCInteractionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCInteractionController.m; sourceTree = "<group>"; }; |
| 443 | - D2575C691E76A45400E3A8FC /* LVCGiftManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCGiftManager.h; sourceTree = "<group>"; }; | |
| 444 | - D2575C6A1E76A45400E3A8FC /* LVCGiftManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCGiftManager.m; sourceTree = "<group>"; }; | |
| 445 | 465 | D2575C6D1E76A4F300E3A8FC /* NHCarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NHCarView.h; sourceTree = "<group>"; }; |
| 446 | 466 | D2575C6E1E76A4F300E3A8FC /* NHCarViews.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NHCarViews.h; sourceTree = "<group>"; }; |
| 447 | 467 | D2575C6F1E76A4F300E3A8FC /* NHCarViews.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NHCarViews.m; sourceTree = "<group>"; }; |
| ... | ... | @@ -550,6 +570,15 @@ |
| 550 | 570 | path = CNLiveSDK; |
| 551 | 571 | sourceTree = "<group>"; |
| 552 | 572 | }; |
| 573 | + 81FB5B391E7A6FFC00F98E1D /* SevenSwitch */ = { | |
| 574 | + isa = PBXGroup; | |
| 575 | + children = ( | |
| 576 | + 81FB5B3A1E7A6FFC00F98E1D /* SevenSwitch.h */, | |
| 577 | + 81FB5B3B1E7A6FFC00F98E1D /* SevenSwitch.m */, | |
| 578 | + ); | |
| 579 | + path = SevenSwitch; | |
| 580 | + sourceTree = "<group>"; | |
| 581 | + }; | |
| 553 | 582 | D2029B781E6EAAA50027CD92 = { |
| 554 | 583 | isa = PBXGroup; |
| 555 | 584 | children = ( |
| ... | ... | @@ -590,7 +619,6 @@ |
| 590 | 619 | isa = PBXGroup; |
| 591 | 620 | children = ( |
| 592 | 621 | D2029B921E6EAAA50027CD92 /* LaunchScreen.storyboard */, |
| 593 | - D2029B8D1E6EAAA50027CD92 /* Main.storyboard */, | |
| 594 | 622 | D2029B851E6EAAA50027CD92 /* main.m */, |
| 595 | 623 | D2029B951E6EAAA50027CD92 /* Info.plist */, |
| 596 | 624 | ); |
| ... | ... | @@ -675,6 +703,7 @@ |
| 675 | 703 | D2029BD41E6EADE10027CD92 /* SDK */ = { |
| 676 | 704 | isa = PBXGroup; |
| 677 | 705 | children = ( |
| 706 | + 81FB5B391E7A6FFC00F98E1D /* SevenSwitch */, | |
| 678 | 707 | 810B64E41E779B1F00133E15 /* Masonry */, |
| 679 | 708 | D2029BD51E6EADE10027CD92 /* AFNetworking */, |
| 680 | 709 | D2029BF81E6EADE10027CD92 /* MBProgressHUD */, |
| ... | ... | @@ -1227,8 +1256,6 @@ |
| 1227 | 1256 | D2575C661E76A25400E3A8FC /* LVCInteractionController.m */, |
| 1228 | 1257 | D2575C681E76A42B00E3A8FC /* Gift */, |
| 1229 | 1258 | D2575C471E7685C500E3A8FC /* heartAnimation */, |
| 1230 | - D2575C441E76857100E3A8FC /* LVCAnimationManager.h */, | |
| 1231 | - D2575C451E76857100E3A8FC /* LVCAnimationManager.m */, | |
| 1232 | 1259 | ); |
| 1233 | 1260 | path = InteractionSections; |
| 1234 | 1261 | sourceTree = "<group>"; |
| ... | ... | @@ -1238,6 +1265,8 @@ |
| 1238 | 1265 | children = ( |
| 1239 | 1266 | D2575C491E7685DE00E3A8FC /* UIView+Bubbling.h */, |
| 1240 | 1267 | D2575C481E7685DE00E3A8FC /* UIView+Bubbling.m */, |
| 1268 | + D2575C441E76857100E3A8FC /* LVCAnimationManager.h */, | |
| 1269 | + D2575C451E76857100E3A8FC /* LVCAnimationManager.m */, | |
| 1241 | 1270 | ); |
| 1242 | 1271 | path = heartAnimation; |
| 1243 | 1272 | sourceTree = "<group>"; |
| ... | ... | @@ -1245,8 +1274,14 @@ |
| 1245 | 1274 | D2575C681E76A42B00E3A8FC /* Gift */ = { |
| 1246 | 1275 | isa = PBXGroup; |
| 1247 | 1276 | children = ( |
| 1248 | - D2575C691E76A45400E3A8FC /* LVCGiftManager.h */, | |
| 1249 | - D2575C6A1E76A45400E3A8FC /* LVCGiftManager.m */, | |
| 1277 | + D25530071E791A7100DF38A5 /* GiftComboView.h */, | |
| 1278 | + D25530081E791A7100DF38A5 /* GiftComboView.m */, | |
| 1279 | + D25530041E7911A800DF38A5 /* GiftAnimationAction.h */, | |
| 1280 | + D25530051E7911A800DF38A5 /* GiftAnimationAction.m */, | |
| 1281 | + D25530011E79115100DF38A5 /* AnimQueueManager.h */, | |
| 1282 | + D25530021E79115100DF38A5 /* AnimQueueManager.m */, | |
| 1283 | + D2552FFE1E7909AC00DF38A5 /* GiftAnimOperation.h */, | |
| 1284 | + D2552FFF1E7909AC00DF38A5 /* GiftAnimOperation.m */, | |
| 1250 | 1285 | D22830F51E77C24900627701 /* GiftViews */, |
| 1251 | 1286 | D2575C6C1E76A4F300E3A8FC /* GiftResource */, |
| 1252 | 1287 | D22831061E77D8D500627701 /* GiftModel */, |
| ... | ... | @@ -1257,6 +1292,8 @@ |
| 1257 | 1292 | D2575C6C1E76A4F300E3A8FC /* GiftResource */ = { |
| 1258 | 1293 | isa = PBXGroup; |
| 1259 | 1294 | children = ( |
| 1295 | + D255300A1E793F8200DF38A5 /* NHFighterView+animDelegagte.h */, | |
| 1296 | + D255300B1E793F8200DF38A5 /* NHFighterView+animDelegagte.m */, | |
| 1260 | 1297 | D2575C6D1E76A4F300E3A8FC /* NHCarView.h */, |
| 1261 | 1298 | D2575C6E1E76A4F300E3A8FC /* NHCarViews.h */, |
| 1262 | 1299 | D2575C6F1E76A4F300E3A8FC /* NHCarViews.m */, |
| ... | ... | @@ -1337,6 +1374,8 @@ |
| 1337 | 1374 | D2888DB31E6EC154003A77C8 /* HomeViewController.m */, |
| 1338 | 1375 | 810B64E11E779AFE00133E15 /* LVCLivePlayerController.h */, |
| 1339 | 1376 | 810B64E21E779AFE00133E15 /* LVCLivePlayerController.m */, |
| 1377 | + 810B65081E77B39D00133E15 /* LVCFullScreenPlayerController.h */, | |
| 1378 | + 810B65091E77B39D00133E15 /* LVCFullScreenPlayerController.m */, | |
| 1340 | 1379 | ); |
| 1341 | 1380 | path = Controller; |
| 1342 | 1381 | sourceTree = "<group>"; |
| ... | ... | @@ -1353,6 +1392,8 @@ |
| 1353 | 1392 | children = ( |
| 1354 | 1393 | 810B64DE1E779AE900133E15 /* LVCPlayer.h */, |
| 1355 | 1394 | 810B64DF1E779AE900133E15 /* LVCPlayer.m */, |
| 1395 | + 8112D42F1E7927A5002E00F6 /* LVCPlayerLoadingView.h */, | |
| 1396 | + 8112D4301E7927A5002E00F6 /* LVCPlayerLoadingView.m */, | |
| 1356 | 1397 | ); |
| 1357 | 1398 | path = View; |
| 1358 | 1399 | sourceTree = "<group>"; |
| ... | ... | @@ -1510,6 +1551,7 @@ |
| 1510 | 1551 | D2575C7C1E76A4F300E3A8FC /* NHFighterView.nib in Resources */, |
| 1511 | 1552 | D25BF87D1E7B8C78007FB138 /* KSYGPUResource.bundle in Resources */, |
| 1512 | 1553 | D2029B8F1E6EAAA50027CD92 /* Main.storyboard in Resources */, |
| 1554 | + 812E50541E7699DC004F5FCD /* KSYGPUResource.bundle in Resources */, | |
| 1513 | 1555 | ); |
| 1514 | 1556 | runOnlyForDeploymentPostprocessing = 0; |
| 1515 | 1557 | }; |
| ... | ... | @@ -1534,6 +1576,7 @@ |
| 1534 | 1576 | isa = PBXSourcesBuildPhase; |
| 1535 | 1577 | buildActionMask = 2147483647; |
| 1536 | 1578 | files = ( |
| 1579 | + D25530091E791A7100DF38A5 /* GiftComboView.m in Sources */, | |
| 1537 | 1580 | D2029CC31E6EADE10027CD92 /* UIImageView+HighlightedWebCache.m in Sources */, |
| 1538 | 1581 | D22830FF1E77C69E00627701 /* GiftListView.m in Sources */, |
| 1539 | 1582 | D2029CC01E6EADE10027CD92 /* UIImage+GIF.m in Sources */, |
| ... | ... | @@ -1585,6 +1628,7 @@ |
| 1585 | 1628 | D2029CA21E6EADE10027CD92 /* MJRefreshAutoFooter.m in Sources */, |
| 1586 | 1629 | D2029CC71E6EADE10027CD92 /* SVIndefiniteAnimatedView.m in Sources */, |
| 1587 | 1630 | D2029CA31E6EADE10027CD92 /* MJRefreshBackFooter.m in Sources */, |
| 1631 | + D255300C1E793F8200DF38A5 /* NHFighterView+animDelegagte.m in Sources */, | |
| 1588 | 1632 | D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */, |
| 1589 | 1633 | D22831021E77D83C00627701 /* GiftModelView.m in Sources */, |
| 1590 | 1634 | D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */, |
| ... | ... | @@ -1608,6 +1652,7 @@ |
| 1608 | 1652 | D2575C461E76857100E3A8FC /* LVCAnimationManager.m in Sources */, |
| 1609 | 1653 | D2029C8A1E6EADE10027CD92 /* AFURLRequestSerialization.m in Sources */, |
| 1610 | 1654 | D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */, |
| 1655 | + D25530031E79115100DF38A5 /* AnimQueueManager.m in Sources */, | |
| 1611 | 1656 | D2029C871E6EADE10027CD92 /* AFHTTPSessionManager.m in Sources */, |
| 1612 | 1657 | D2029B861E6EAAA50027CD92 /* main.m in Sources */, |
| 1613 | 1658 | D2029C8C1E6EADE10027CD92 /* AFURLSessionManager.m in Sources */, |
| ... | ... | @@ -1632,6 +1677,7 @@ |
| 1632 | 1677 | D2029C891E6EADE10027CD92 /* AFSecurityPolicy.m in Sources */, |
| 1633 | 1678 | D22830F11E778C0F00627701 /* LiveBaseView.m in Sources */, |
| 1634 | 1679 | D2029CBA1E6EADE10027CD92 /* SDWebImageDecoder.m in Sources */, |
| 1680 | + 8112D4311E7927A5002E00F6 /* LVCPlayerLoadingView.m in Sources */, | |
| 1635 | 1681 | D2029D081E6EAE2E0027CD92 /* ZXDeviceInfo.m in Sources */, |
| 1636 | 1682 | D2029CC21E6EADE10027CD92 /* UIImage+WebP.m in Sources */, |
| 1637 | 1683 | D2029BCD1E6EADD70027CD92 /* BaseViewController.m in Sources */, |
| ... | ... | @@ -1641,11 +1687,13 @@ |
| 1641 | 1687 | D2029D001E6EAE2E0027CD92 /* NSNumber+ScaleHeight.m in Sources */, |
| 1642 | 1688 | D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */, |
| 1643 | 1689 | D2029C951E6EADE10027CD92 /* UIWebView+AFNetworking.m in Sources */, |
| 1644 | - D2575C6B1E76A45400E3A8FC /* LVCGiftManager.m in Sources */, | |
| 1690 | + 810B650A1E77B39D00133E15 /* LVCFullScreenPlayerController.m in Sources */, | |
| 1645 | 1691 | D2029CBD1E6EADE10027CD92 /* SDWebImageManager.m in Sources */, |
| 1646 | 1692 | D2029CB41E6EADE10027CD92 /* UIView+MJExtension.m in Sources */, |
| 1693 | + 81FB5B3C1E7A6FFC00F98E1D /* SevenSwitch.m in Sources */, | |
| 1647 | 1694 | D2029CA91E6EADE10027CD92 /* MJRefreshAutoStateFooter.m in Sources */, |
| 1648 | 1695 | D2029D061E6EAE2E0027CD92 /* UIView+Extension.m in Sources */, |
| 1696 | + D25530001E7909AC00DF38A5 /* GiftAnimOperation.m in Sources */, | |
| 1649 | 1697 | D2029C9D1E6EADE10027CD92 /* NSObject+MJClass.m in Sources */, |
| 1650 | 1698 | D2029CCF1E6EADE10027CD92 /* SearchHttp.m in Sources */, |
| 1651 | 1699 | 810B65001E779B1F00133E15 /* MASConstraintMaker.m in Sources */, |
| ... | ... | @@ -1654,6 +1702,7 @@ |
| 1654 | 1702 | D2029BCC1E6EADD70027CD92 /* BaseView.m in Sources */, |
| 1655 | 1703 | D2888D941E6EB8B4003A77C8 /* LVCTabBar.m in Sources */, |
| 1656 | 1704 | D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */, |
| 1705 | + D25530061E7911A800DF38A5 /* GiftAnimationAction.m in Sources */, | |
| 1657 | 1706 | D2029CD41E6EADE70027CD92 /* HttpService.m in Sources */, |
| 1658 | 1707 | ); |
| 1659 | 1708 | runOnlyForDeploymentPostprocessing = 0; |
| ... | ... | @@ -1690,14 +1739,6 @@ |
| 1690 | 1739 | /* End PBXTargetDependency section */ |
| 1691 | 1740 | |
| 1692 | 1741 | /* Begin PBXVariantGroup section */ |
| 1693 | - D2029B8D1E6EAAA50027CD92 /* Main.storyboard */ = { | |
| 1694 | - isa = PBXVariantGroup; | |
| 1695 | - children = ( | |
| 1696 | - D2029B8E1E6EAAA50027CD92 /* Base */, | |
| 1697 | - ); | |
| 1698 | - name = Main.storyboard; | |
| 1699 | - sourceTree = "<group>"; | |
| 1700 | - }; | |
| 1701 | 1742 | D2029B921E6EAAA50027CD92 /* LaunchScreen.storyboard */ = { |
| 1702 | 1743 | isa = PBXVariantGroup; |
| 1703 | 1744 | children = ( |
| ... | ... | @@ -1803,6 +1844,7 @@ |
| 1803 | 1844 | isa = XCBuildConfiguration; |
| 1804 | 1845 | buildSettings = { |
| 1805 | 1846 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 1847 | + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; | |
| 1806 | 1848 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 1807 | 1849 | FRAMEWORK_SEARCH_PATHS = ( |
| 1808 | 1850 | "$(inherited)", |
| ... | ... | @@ -1816,7 +1858,7 @@ |
| 1816 | 1858 | "$(inherited)", |
| 1817 | 1859 | "$(PROJECT_DIR)/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource", |
| 1818 | 1860 | ); |
| 1819 | - PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.zhangxu.LiveVideoCloud; | |
| 1861 | + PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.video; | |
| 1820 | 1862 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 1821 | 1863 | }; |
| 1822 | 1864 | name = Debug; |
| ... | ... | @@ -1825,6 +1867,7 @@ |
| 1825 | 1867 | isa = XCBuildConfiguration; |
| 1826 | 1868 | buildSettings = { |
| 1827 | 1869 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 1870 | + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; | |
| 1828 | 1871 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 1829 | 1872 | FRAMEWORK_SEARCH_PATHS = ( |
| 1830 | 1873 | "$(inherited)", |
| ... | ... | @@ -1838,7 +1881,7 @@ |
| 1838 | 1881 | "$(inherited)", |
| 1839 | 1882 | "$(PROJECT_DIR)/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource", |
| 1840 | 1883 | ); |
| 1841 | - PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.zhangxu.LiveVideoCloud; | |
| 1884 | + PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.video; | |
| 1842 | 1885 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 1843 | 1886 | }; |
| 1844 | 1887 | name = Release; | ... | ... |
LiveVideoCloud/LiveVideoCloud/AppCustoms/Main/ZXTabBarController.m
LiveVideoCloud/LiveVideoCloud/Base.lproj/Main.storyboard deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
| 2 | -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> | |
| 3 | - <dependencies> | |
| 4 | - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/> | |
| 5 | - <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
| 6 | - </dependencies> | |
| 7 | - <scenes> | |
| 8 | - <!--View Controller--> | |
| 9 | - <scene sceneID="tne-QT-ifu"> | |
| 10 | - <objects> | |
| 11 | - <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController"> | |
| 12 | - <layoutGuides> | |
| 13 | - <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> | |
| 14 | - <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> | |
| 15 | - </layoutGuides> | |
| 16 | - <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> | |
| 17 | - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | |
| 18 | - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | |
| 19 | - <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | |
| 20 | - </view> | |
| 21 | - </viewController> | |
| 22 | - <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> | |
| 23 | - </objects> | |
| 24 | - </scene> | |
| 25 | - </scenes> | |
| 26 | -</document> |
LiveVideoCloud/LiveVideoCloud/Classes/SDK/SevenSwitch/SevenSwitch.h
0 → 100755
| 1 | +// | |
| 2 | +// SevenSwitch | |
| 3 | +// | |
| 4 | +// Created by Benjamin Vogelzang on 6/10/13. | |
| 5 | +// Copyright (c) 2013 Ben Vogelzang. All rights reserved. | |
| 6 | +// | |
| 7 | +// Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 8 | +// of this software and associated documentation files (the "Software"), to deal | |
| 9 | +// in the Software without restriction, including without limitation the rights | |
| 10 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 11 | +// copies of the Software, and to permit persons to whom the Software is | |
| 12 | +// furnished to do so, subject to the following conditions: | |
| 13 | +// | |
| 14 | +// The above copyright notice and this permission notice shall be included in | |
| 15 | +// all copies or substantial portions of the Software. | |
| 16 | +// | |
| 17 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 18 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 19 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 20 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 21 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 22 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
| 23 | +// THE SOFTWARE. | |
| 24 | + | |
| 25 | +#import <UIKit/UIKit.h> | |
| 26 | + | |
| 27 | +@protocol SevenSwitchDelegate <NSObject> | |
| 28 | + | |
| 29 | +- (void)sevenSwitchChanged:(BOOL)change; | |
| 30 | + | |
| 31 | +@end | |
| 32 | + | |
| 33 | +@interface SevenSwitch : UIControl | |
| 34 | + | |
| 35 | +@property (nonatomic, weak) id<SevenSwitchDelegate> delegate; | |
| 36 | + | |
| 37 | +/* | |
| 38 | + * Set (without animation) whether the switch is on or off | |
| 39 | + */ | |
| 40 | +@property (nonatomic, assign) BOOL on; | |
| 41 | + | |
| 42 | + | |
| 43 | +/* | |
| 44 | + * Sets the background color when the switch is off. | |
| 45 | + * Defaults to clear color. | |
| 46 | + */ | |
| 47 | +@property (nonatomic, strong) UIColor *inactiveColor; | |
| 48 | + | |
| 49 | +/* | |
| 50 | + * Sets the background color that shows when the switch off and actively being touched. | |
| 51 | + * Defaults to light gray. | |
| 52 | + */ | |
| 53 | +@property (nonatomic, strong) UIColor *activeColor; | |
| 54 | + | |
| 55 | +/* | |
| 56 | + * Sets the background color that shows when the switch is on. | |
| 57 | + * Defaults to green. | |
| 58 | + */ | |
| 59 | +@property (nonatomic, strong) UIColor *onColor; | |
| 60 | + | |
| 61 | +/* | |
| 62 | + * Sets the border color that shows when the switch is off. Defaults to light gray. | |
| 63 | + */ | |
| 64 | +@property (nonatomic, strong) UIColor *borderColor; | |
| 65 | + | |
| 66 | +/* | |
| 67 | + * Sets the knob color. Defaults to white. | |
| 68 | + */ | |
| 69 | +@property (nonatomic, strong) UIColor *knobColor; | |
| 70 | + | |
| 71 | +@property (nonatomic, strong) UIImage *knobOnImage; | |
| 72 | +@property (nonatomic, strong) UIImage *knobOffImage; | |
| 73 | +@property (nonatomic, strong) UIColor *knobOnColor; | |
| 74 | +@property (nonatomic, strong) UIColor *knobOffColor; | |
| 75 | + | |
| 76 | +/* | |
| 77 | + * Sets the shadow color of the knob. Defaults to gray. | |
| 78 | + */ | |
| 79 | +@property (nonatomic, strong) UIColor *shadowColor; | |
| 80 | + | |
| 81 | + | |
| 82 | +/* | |
| 83 | + * Sets whether or not the switch edges are rounded. | |
| 84 | + * Set to NO to get a stylish square switch. | |
| 85 | + * Defaults to YES. | |
| 86 | + */ | |
| 87 | +@property (nonatomic, assign) BOOL isRounded; | |
| 88 | + | |
| 89 | +@property (nonatomic, assign) CGFloat cornerRadius; | |
| 90 | + | |
| 91 | + | |
| 92 | +/* | |
| 93 | + * Sets the image that shows when the switch is on. | |
| 94 | + * The image is centered in the area not covered by the knob. | |
| 95 | + * Make sure to size your images appropriately. | |
| 96 | + */ | |
| 97 | +@property (nonatomic, strong) UIImage *onImage; | |
| 98 | + | |
| 99 | +/* | |
| 100 | + * Sets the image that shows when the switch is off. | |
| 101 | + * The image is centered in the area not covered by the knob. | |
| 102 | + * Make sure to size your images appropriately. | |
| 103 | + */ | |
| 104 | +@property (nonatomic, strong) UIImage *offImage; | |
| 105 | + | |
| 106 | + | |
| 107 | +/* | |
| 108 | + * Set whether the switch is on or off. Optionally animate the change | |
| 109 | + */ | |
| 110 | +- (void)setOn:(BOOL)on animated:(BOOL)animated; | |
| 111 | + | |
| 112 | +/* | |
| 113 | + * Detects whether the switch is on or off | |
| 114 | + * | |
| 115 | + * @return BOOL YES if switch is on. NO if switch is off | |
| 116 | + */ | |
| 117 | +- (BOOL)isOn; | |
| 118 | + | |
| 119 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/SDK/SevenSwitch/SevenSwitch.m
0 → 100755
| 1 | +// | |
| 2 | +// SevenSwitch | |
| 3 | +// | |
| 4 | +// Created by Benjamin Vogelzang on 6/10/13. | |
| 5 | +// Copyright (c) 2013 Ben Vogelzang. All rights reserved. | |
| 6 | +// | |
| 7 | +// Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 8 | +// of this software and associated documentation files (the "Software"), to deal | |
| 9 | +// in the Software without restriction, including without limitation the rights | |
| 10 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 11 | +// copies of the Software, and to permit persons to whom the Software is | |
| 12 | +// furnished to do so, subject to the following conditions: | |
| 13 | +// | |
| 14 | +// The above copyright notice and this permission notice shall be included in | |
| 15 | +// all copies or substantial portions of the Software. | |
| 16 | +// | |
| 17 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 18 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 19 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 20 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 21 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 22 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
| 23 | +// THE SOFTWARE. | |
| 24 | + | |
| 25 | +#import "SevenSwitch.h" | |
| 26 | +#import <QuartzCore/QuartzCore.h> | |
| 27 | + | |
| 28 | +@interface SevenSwitch () { | |
| 29 | + UIView *background; | |
| 30 | + UIImageView *knob; | |
| 31 | + UIImageView *onImageView; | |
| 32 | + UIImageView *offImageView; | |
| 33 | + double startTime; | |
| 34 | + BOOL isAnimating; | |
| 35 | +} | |
| 36 | + | |
| 37 | +- (void)showOn:(BOOL)animated; | |
| 38 | +- (void)showOff:(BOOL)animated; | |
| 39 | +- (void)setup; | |
| 40 | + | |
| 41 | +@end | |
| 42 | + | |
| 43 | + | |
| 44 | +@implementation SevenSwitch | |
| 45 | + | |
| 46 | +@synthesize inactiveColor, activeColor, onColor, borderColor, knobColor, shadowColor; | |
| 47 | +@synthesize onImage, offImage; | |
| 48 | +@synthesize isRounded; | |
| 49 | +@synthesize on; | |
| 50 | + | |
| 51 | + | |
| 52 | +#pragma mark init Methods | |
| 53 | + | |
| 54 | +- (id)init { | |
| 55 | + self = [super initWithFrame:CGRectMake(0, 0, 50, 30)]; | |
| 56 | + if (self) { | |
| 57 | + [self setup]; | |
| 58 | + } | |
| 59 | + return self; | |
| 60 | +} | |
| 61 | + | |
| 62 | +- (id)initWithCoder:(NSCoder *)aDecoder { | |
| 63 | + self = [super initWithCoder:aDecoder]; | |
| 64 | + if (self) { | |
| 65 | + [self setup]; | |
| 66 | + } | |
| 67 | + return self; | |
| 68 | +} | |
| 69 | + | |
| 70 | +- (id)initWithFrame:(CGRect)frame | |
| 71 | +{ | |
| 72 | + // use the default values if CGRectZero frame is set | |
| 73 | + CGRect initialFrame; | |
| 74 | + if (CGRectIsEmpty(frame)) { | |
| 75 | + initialFrame = CGRectMake(0, 0, 50, 30); | |
| 76 | + } | |
| 77 | + else { | |
| 78 | + initialFrame = frame; | |
| 79 | + } | |
| 80 | + self = [super initWithFrame:initialFrame]; | |
| 81 | + if (self) { | |
| 82 | + [self setup]; | |
| 83 | + } | |
| 84 | + return self; | |
| 85 | +} | |
| 86 | + | |
| 87 | + | |
| 88 | +/** | |
| 89 | + * Setup the individual elements of the switch and set default values | |
| 90 | + */ | |
| 91 | +- (void)setup { | |
| 92 | + | |
| 93 | + // default values | |
| 94 | + self.on = NO; | |
| 95 | + self.isRounded = YES; | |
| 96 | + self.inactiveColor = [UIColor clearColor]; | |
| 97 | + self.activeColor = [UIColor colorWithRed:0.89f green:0.89f blue:0.89f alpha:1.00f]; | |
| 98 | + self.onColor = [UIColor colorWithRed:0.30f green:0.85f blue:0.39f alpha:1.00f]; | |
| 99 | + self.borderColor = [UIColor colorWithRed:0.89f green:0.89f blue:0.91f alpha:1.00f]; | |
| 100 | + self.knobColor = [UIColor whiteColor]; | |
| 101 | + self.shadowColor = [UIColor grayColor]; | |
| 102 | + self.cornerRadius = 2; | |
| 103 | + | |
| 104 | + // background | |
| 105 | + background = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; | |
| 106 | + background.backgroundColor = [UIColor clearColor]; | |
| 107 | + background.layer.cornerRadius = self.frame.size.height * 0.5; | |
| 108 | +// background.layer.borderColor = self.borderColor.CGColor; | |
| 109 | +// background.layer.borderWidth = 1.0; | |
| 110 | + background.userInteractionEnabled = NO; | |
| 111 | + [self addSubview:background]; | |
| 112 | + | |
| 113 | + // images | |
| 114 | + onImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width - self.frame.size.height, self.frame.size.height)]; | |
| 115 | + onImageView.alpha = 0; | |
| 116 | + onImageView.contentMode = UIViewContentModeCenter; | |
| 117 | + [self addSubview:onImageView]; | |
| 118 | + | |
| 119 | + offImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.height, 0, self.frame.size.width - self.frame.size.height, self.frame.size.height)]; | |
| 120 | + offImageView.alpha = 1.0; | |
| 121 | + offImageView.contentMode = UIViewContentModeCenter; | |
| 122 | + [self addSubview:offImageView]; | |
| 123 | + | |
| 124 | + // knob | |
| 125 | + knob = [[UIImageView alloc] initWithFrame:CGRectMake(1, 1, self.frame.size.height - 2, self.frame.size.height - 2)]; | |
| 126 | + knob.backgroundColor = self.knobColor; | |
| 127 | + knob.layer.cornerRadius = (self.frame.size.height * 0.5) - 1; | |
| 128 | + knob.layer.shadowColor = self.shadowColor.CGColor; | |
| 129 | + knob.layer.shadowRadius = 2.0; | |
| 130 | + knob.layer.shadowOpacity = 0.5; | |
| 131 | + knob.layer.shadowOffset = CGSizeMake(0, 3); | |
| 132 | + knob.layer.masksToBounds = NO; | |
| 133 | + knob.userInteractionEnabled = NO; | |
| 134 | + [self addSubview:knob]; | |
| 135 | + | |
| 136 | + isAnimating = NO; | |
| 137 | +} | |
| 138 | + | |
| 139 | + | |
| 140 | +#pragma mark Touch Tracking | |
| 141 | + | |
| 142 | +- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { | |
| 143 | + [super beginTrackingWithTouch:touch withEvent:event]; | |
| 144 | + | |
| 145 | + // start timer to detect tap later in endTrackingWithTouch:withEvent: | |
| 146 | + startTime = [[NSDate date] timeIntervalSince1970]; | |
| 147 | + | |
| 148 | + // make the knob larger and animate to the correct color | |
| 149 | + CGFloat activeKnobWidth = self.bounds.size.height - 2 + 5; | |
| 150 | + isAnimating = YES; | |
| 151 | + [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseOut|UIViewAnimationOptionBeginFromCurrentState animations:^{ | |
| 152 | + if (self.on) { | |
| 153 | + knob.frame = CGRectMake(self.bounds.size.width - (activeKnobWidth + 1), knob.frame.origin.y, activeKnobWidth, knob.frame.size.height); | |
| 154 | + background.backgroundColor = self.onColor; | |
| 155 | + knob.image = self.knobOnImage; | |
| 156 | + knob.backgroundColor = self.knobOnColor; | |
| 157 | + } | |
| 158 | + else { | |
| 159 | + knob.frame = CGRectMake(knob.frame.origin.x, knob.frame.origin.y, activeKnobWidth, knob.frame.size.height); | |
| 160 | + background.backgroundColor = self.activeColor; | |
| 161 | + knob.image = self.knobOffImage; | |
| 162 | + knob.backgroundColor = self.knobOffColor; | |
| 163 | + } | |
| 164 | + } completion:^(BOOL finished) { | |
| 165 | + isAnimating = NO; | |
| 166 | + }]; | |
| 167 | + | |
| 168 | + return YES; | |
| 169 | +} | |
| 170 | + | |
| 171 | +- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { | |
| 172 | + [super continueTrackingWithTouch:touch withEvent:event]; | |
| 173 | + | |
| 174 | + // Get touch location | |
| 175 | + CGPoint lastPoint = [touch locationInView:self]; | |
| 176 | + | |
| 177 | + // update the switch to the correct visuals depending on if | |
| 178 | + // they moved their touch to the right or left side of the switch | |
| 179 | + if (lastPoint.x > self.bounds.size.width * 0.5) | |
| 180 | + [self showOn:YES]; | |
| 181 | + else | |
| 182 | + [self showOff:YES]; | |
| 183 | + | |
| 184 | + return YES; | |
| 185 | +} | |
| 186 | + | |
| 187 | +- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { | |
| 188 | + [super endTrackingWithTouch:touch withEvent:event]; | |
| 189 | + | |
| 190 | + // capture time to see if this was a tap action | |
| 191 | + double endTime = [[NSDate date] timeIntervalSince1970]; | |
| 192 | + double difference = endTime - startTime; | |
| 193 | + BOOL previousValue = self.on; | |
| 194 | + | |
| 195 | + // determine if the user tapped the switch or has held it for longer | |
| 196 | + if (difference <= 0.2) { | |
| 197 | + CGFloat normalKnobWidth = self.bounds.size.height - 2; | |
| 198 | + knob.frame = CGRectMake(knob.frame.origin.x, knob.frame.origin.y, normalKnobWidth, knob.frame.size.height); | |
| 199 | + knob.image = self.knobOffImage; | |
| 200 | + knob.backgroundColor = self.knobOffColor; | |
| 201 | + | |
| 202 | + [self setOn:!self.on animated:YES]; | |
| 203 | + } | |
| 204 | + else { | |
| 205 | + // Get touch location | |
| 206 | + CGPoint lastPoint = [touch locationInView:self]; | |
| 207 | + | |
| 208 | + // update the switch to the correct value depending on if | |
| 209 | + // their touch finished on the right or left side of the switch | |
| 210 | + if (lastPoint.x > self.bounds.size.width * 0.5) | |
| 211 | + [self setOn:YES animated:YES]; | |
| 212 | + else | |
| 213 | + [self setOn:NO animated:YES]; | |
| 214 | + } | |
| 215 | + | |
| 216 | + if (previousValue != self.on) | |
| 217 | + [self sendActionsForControlEvents:UIControlEventValueChanged]; | |
| 218 | +} | |
| 219 | + | |
| 220 | +- (void)cancelTrackingWithEvent:(UIEvent *)event { | |
| 221 | + [super cancelTrackingWithEvent:event]; | |
| 222 | + | |
| 223 | + // just animate back to the original value | |
| 224 | + if (self.on) | |
| 225 | + [self showOn:YES]; | |
| 226 | + else | |
| 227 | + [self showOff:YES]; | |
| 228 | +} | |
| 229 | + | |
| 230 | + | |
| 231 | +- (void)layoutSubviews { | |
| 232 | + [super layoutSubviews]; | |
| 233 | + | |
| 234 | + if (!isAnimating) { | |
| 235 | + CGRect frame = self.frame; | |
| 236 | + | |
| 237 | + // background | |
| 238 | + background.frame = CGRectMake(0, 0, frame.size.width, frame.size.height); | |
| 239 | + background.layer.cornerRadius = self.isRounded ? frame.size.height * 0.5 : self.cornerRadius; | |
| 240 | + | |
| 241 | + // images | |
| 242 | + onImageView.frame = CGRectMake(0, 0, frame.size.width - frame.size.height, frame.size.height); | |
| 243 | + offImageView.frame = CGRectMake(frame.size.height, 0, frame.size.width - frame.size.height, frame.size.height); | |
| 244 | + | |
| 245 | + // knob | |
| 246 | + CGFloat normalKnobWidth = frame.size.height - 2; | |
| 247 | + if (self.on) | |
| 248 | + { | |
| 249 | + knob.frame = CGRectMake(frame.size.width - (normalKnobWidth + 1), 1, frame.size.height - 2, normalKnobWidth); | |
| 250 | + knob.image = self.knobOnImage; | |
| 251 | + knob.backgroundColor = self.knobOnColor; | |
| 252 | + } | |
| 253 | + else | |
| 254 | + { | |
| 255 | + knob.frame = CGRectMake(1, 1, normalKnobWidth, normalKnobWidth); | |
| 256 | + knob.image = self.knobOffImage; | |
| 257 | + knob.backgroundColor = self.knobOffColor; | |
| 258 | + } | |
| 259 | + | |
| 260 | + knob.layer.cornerRadius = self.isRounded ? (frame.size.height * 0.5) - 1 : 2; | |
| 261 | + } | |
| 262 | +} | |
| 263 | + | |
| 264 | + | |
| 265 | +#pragma mark Setters | |
| 266 | + | |
| 267 | +/* | |
| 268 | + * Sets the background color when the switch is off. | |
| 269 | + * Defaults to clear color. | |
| 270 | + */ | |
| 271 | +- (void)setInactiveColor:(UIColor *)color { | |
| 272 | + inactiveColor = color; | |
| 273 | + if (!self.on && !self.isTracking) | |
| 274 | + background.backgroundColor = color; | |
| 275 | +} | |
| 276 | + | |
| 277 | +/* | |
| 278 | + * Sets the background color that shows when the switch is on. | |
| 279 | + * Defaults to green. | |
| 280 | + */ | |
| 281 | +- (void)setOnColor:(UIColor *)color { | |
| 282 | + onColor = color; | |
| 283 | + if (self.on && !self.isTracking) { | |
| 284 | + background.backgroundColor = color; | |
| 285 | +// background.layer.borderColor = color.CGColor; | |
| 286 | + } | |
| 287 | +} | |
| 288 | + | |
| 289 | +/* | |
| 290 | + * Sets the border color that shows when the switch is off. Defaults to light gray. | |
| 291 | + */ | |
| 292 | +- (void)setBorderColor:(UIColor *)color { | |
| 293 | + borderColor = color; | |
| 294 | +// if (!self.on) | |
| 295 | +// background.layer.borderColor = color.CGColor; | |
| 296 | +} | |
| 297 | + | |
| 298 | +/* | |
| 299 | + * Sets the knob color. Defaults to white. | |
| 300 | + */ | |
| 301 | +- (void)setKnobColor:(UIColor *)color { | |
| 302 | + knobColor = color; | |
| 303 | + knob.backgroundColor = color; | |
| 304 | +} | |
| 305 | + | |
| 306 | +/* | |
| 307 | + * Sets the shadow color of the knob. Defaults to gray. | |
| 308 | + */ | |
| 309 | +- (void)setShadowColor:(UIColor *)color { | |
| 310 | + shadowColor = color; | |
| 311 | + knob.layer.shadowColor = color.CGColor; | |
| 312 | +} | |
| 313 | + | |
| 314 | + | |
| 315 | +/* | |
| 316 | + * Sets the image that shows when the switch is on. | |
| 317 | + * The image is centered in the area not covered by the knob. | |
| 318 | + * Make sure to size your images appropriately. | |
| 319 | + */ | |
| 320 | +- (void)setOnImage:(UIImage *)image { | |
| 321 | + onImage = image; | |
| 322 | + onImageView.image = image; | |
| 323 | +} | |
| 324 | + | |
| 325 | +/* | |
| 326 | + * Sets the image that shows when the switch is off. | |
| 327 | + * The image is centered in the area not covered by the knob. | |
| 328 | + * Make sure to size your images appropriately. | |
| 329 | + */ | |
| 330 | +- (void)setOffImage:(UIImage *)image { | |
| 331 | + offImage = image; | |
| 332 | + offImageView.image = image; | |
| 333 | +} | |
| 334 | + | |
| 335 | + | |
| 336 | +/* | |
| 337 | + * Sets whether or not the switch edges are rounded. | |
| 338 | + * Set to NO to get a stylish square switch. | |
| 339 | + * Defaults to YES. | |
| 340 | + */ | |
| 341 | +- (void)setIsRounded:(BOOL)rounded { | |
| 342 | + isRounded = rounded; | |
| 343 | + | |
| 344 | + if (rounded) { | |
| 345 | + background.layer.cornerRadius = self.frame.size.height * 0.5; | |
| 346 | + knob.layer.cornerRadius = (self.frame.size.height * 0.5) - 1; | |
| 347 | + } | |
| 348 | + else { | |
| 349 | + background.layer.cornerRadius = self.cornerRadius; | |
| 350 | + knob.layer.cornerRadius = 2; | |
| 351 | + } | |
| 352 | +} | |
| 353 | + | |
| 354 | + | |
| 355 | +/* | |
| 356 | + * Set (without animation) whether the switch is on or off | |
| 357 | + */ | |
| 358 | +- (void)setOn:(BOOL)isOn { | |
| 359 | + [self setOn:isOn animated:NO]; | |
| 360 | +} | |
| 361 | + | |
| 362 | + | |
| 363 | +/* | |
| 364 | + * Set the state of the switch to on or off, optionally animating the transition. | |
| 365 | + */ | |
| 366 | +- (void)setOn:(BOOL)isOn animated:(BOOL)animated { | |
| 367 | + on = isOn; | |
| 368 | + | |
| 369 | + if ([self.delegate respondsToSelector:@selector(sevenSwitchChanged:)]) { | |
| 370 | + [self.delegate sevenSwitchChanged:isOn]; | |
| 371 | + } | |
| 372 | + | |
| 373 | + if (isOn) { | |
| 374 | + [self showOn:animated]; | |
| 375 | + } | |
| 376 | + else { | |
| 377 | + [self showOff:animated]; | |
| 378 | + } | |
| 379 | +} | |
| 380 | + | |
| 381 | + | |
| 382 | +#pragma mark Getters | |
| 383 | + | |
| 384 | +/* | |
| 385 | + * Detects whether the switch is on or off | |
| 386 | + * | |
| 387 | + * @return BOOL YES if switch is on. NO if switch is off | |
| 388 | + */ | |
| 389 | +- (BOOL)isOn { | |
| 390 | + return self.on; | |
| 391 | +} | |
| 392 | + | |
| 393 | + | |
| 394 | +#pragma mark State Changes | |
| 395 | + | |
| 396 | + | |
| 397 | +/* | |
| 398 | + * update the looks of the switch to be in the on position | |
| 399 | + * optionally make it animated | |
| 400 | + */ | |
| 401 | +- (void)showOn:(BOOL)animated { | |
| 402 | + CGFloat normalKnobWidth = self.bounds.size.height - 2; | |
| 403 | + CGFloat activeKnobWidth = normalKnobWidth + 5; | |
| 404 | + if (animated) { | |
| 405 | + isAnimating = YES; | |
| 406 | + [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseOut|UIViewAnimationOptionBeginFromCurrentState animations:^{ | |
| 407 | + if (self.tracking) | |
| 408 | + { | |
| 409 | + knob.frame = CGRectMake(self.bounds.size.width - (activeKnobWidth + 1), knob.frame.origin.y, activeKnobWidth, knob.frame.size.height); | |
| 410 | + } | |
| 411 | + else | |
| 412 | + { | |
| 413 | + knob.frame = CGRectMake(self.bounds.size.width - (normalKnobWidth + 1), knob.frame.origin.y, normalKnobWidth, knob.frame.size.height); | |
| 414 | + } | |
| 415 | + knob.image = self.knobOnImage; | |
| 416 | + knob.backgroundColor = self.knobOnColor; | |
| 417 | + background.backgroundColor = self.onColor; | |
| 418 | +// background.layer.borderColor = self.onColor.CGColor; | |
| 419 | + onImageView.alpha = 1.0; | |
| 420 | + offImageView.alpha = 0; | |
| 421 | + } completion:^(BOOL finished) { | |
| 422 | + isAnimating = NO; | |
| 423 | + }]; | |
| 424 | + } | |
| 425 | + else { | |
| 426 | + if (self.tracking) | |
| 427 | + { | |
| 428 | + knob.frame = CGRectMake(self.bounds.size.width - (activeKnobWidth + 1), knob.frame.origin.y, activeKnobWidth, knob.frame.size.height); | |
| 429 | + } | |
| 430 | + else | |
| 431 | + { | |
| 432 | + knob.frame = CGRectMake(self.bounds.size.width - (normalKnobWidth + 1), knob.frame.origin.y, normalKnobWidth, knob.frame.size.height); | |
| 433 | + } | |
| 434 | + knob.image = self.knobOnImage; | |
| 435 | + knob.backgroundColor = self.knobOnColor; | |
| 436 | + background.backgroundColor = self.onColor; | |
| 437 | +// background.layer.borderColor = self.onColor.CGColor; | |
| 438 | + onImageView.alpha = 1.0; | |
| 439 | + offImageView.alpha = 0; | |
| 440 | + } | |
| 441 | +} | |
| 442 | + | |
| 443 | + | |
| 444 | +/* | |
| 445 | + * update the looks of the switch to be in the off position | |
| 446 | + * optionally make it animated | |
| 447 | + */ | |
| 448 | +- (void)showOff:(BOOL)animated { | |
| 449 | + CGFloat normalKnobWidth = self.bounds.size.height - 2; | |
| 450 | + CGFloat activeKnobWidth = normalKnobWidth + 5; | |
| 451 | + if (animated) { | |
| 452 | + isAnimating = YES; | |
| 453 | + [UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationOptionCurveEaseOut|UIViewAnimationOptionBeginFromCurrentState animations:^{ | |
| 454 | + if (self.tracking) { | |
| 455 | + knob.frame = CGRectMake(1, knob.frame.origin.y, activeKnobWidth, knob.frame.size.height); | |
| 456 | + background.backgroundColor = self.activeColor; | |
| 457 | + } | |
| 458 | + else { | |
| 459 | + knob.frame = CGRectMake(1, knob.frame.origin.y, normalKnobWidth, knob.frame.size.height); | |
| 460 | + background.backgroundColor = self.inactiveColor; | |
| 461 | + } | |
| 462 | + knob.image = self.knobOffImage; | |
| 463 | + knob.backgroundColor = self.knobOffColor; | |
| 464 | +// background.layer.borderColor = self.borderColor.CGColor; | |
| 465 | + onImageView.alpha = 0; | |
| 466 | + offImageView.alpha = 1.0; | |
| 467 | + } completion:^(BOOL finished) { | |
| 468 | + isAnimating = NO; | |
| 469 | + }]; | |
| 470 | + } | |
| 471 | + else { | |
| 472 | + if (self.tracking) { | |
| 473 | + knob.frame = CGRectMake(1, knob.frame.origin.y, activeKnobWidth, knob.frame.size.height); | |
| 474 | + background.backgroundColor = self.activeColor; | |
| 475 | + } | |
| 476 | + else { | |
| 477 | + knob.frame = CGRectMake(1, knob.frame.origin.y, normalKnobWidth, knob.frame.size.height); | |
| 478 | + background.backgroundColor = self.inactiveColor; | |
| 479 | + } | |
| 480 | + knob.image = self.knobOffImage; | |
| 481 | + knob.backgroundColor = self.knobOffColor; | |
| 482 | +// background.layer.borderColor = self.borderColor.CGColor; | |
| 483 | + onImageView.alpha = 0; | |
| 484 | + offImageView.alpha = 1.0; | |
| 485 | + } | |
| 486 | +} | |
| 487 | + | |
| 488 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/AnimQueueManager.h
0 → 100644
| 1 | +// | |
| 2 | +// AnimQueueManager.h | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <Foundation/Foundation.h> | |
| 10 | + | |
| 11 | +@class GiftModel; | |
| 12 | +@interface AnimQueueManager : NSObject | |
| 13 | + | |
| 14 | +@property (nonatomic, assign)NSInteger maxTop; //初始位置(需要根据显示设置最低位置在哪里) | |
| 15 | +//@property (nonatomic, strong)NSMutableArray *arGiftArray; //横幅的数量,用于轨道计算(现在结构是一维数组,因为轨道中的弹道只有1个,如果是多个的话需要变为二维数组) | |
| 16 | + | |
| 17 | +/** | |
| 18 | + 初始化管理类 | |
| 19 | + @return 当前manager | |
| 20 | + */ | |
| 21 | ++ (instancetype)sharedAnimQueueManager; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + 根据实际model添加飞机横幅动画(火箭、飞机横幅动画为一个队列) | |
| 25 | + | |
| 26 | + @param animContentView 需要把动画view添加到的view | |
| 27 | + @param model modelobj | |
| 28 | + */ | |
| 29 | +- (void)addAnimationWithModel:(GiftModel *)model animContentView:(UIView *)animContentView; | |
| 30 | + | |
| 31 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/AnimQueueManager.m
0 → 100644
| 1 | +// | |
| 2 | +// AnimQueueManager.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "AnimQueueManager.h" | |
| 10 | +#import "GiftAnimOperation.h" | |
| 11 | +#import "GiftModel.h" | |
| 12 | + | |
| 13 | +@interface AnimQueueManager () | |
| 14 | + | |
| 15 | +@property (nonatomic, assign)NSInteger maxOperationCount; //并发数 | |
| 16 | +@property (nonatomic,strong) NSOperationQueue *comboAnimationQueue; //连击动画队列 | |
| 17 | +@property (nonatomic,strong) NSOperationQueue *expenAnimationQueue; //豪华礼物动画队列 | |
| 18 | + | |
| 19 | +@end | |
| 20 | + | |
| 21 | +@implementation AnimQueueManager | |
| 22 | + | |
| 23 | +/** | |
| 24 | + 初始化管理类 | |
| 25 | + @return 当前manager | |
| 26 | + */ | |
| 27 | ++ (instancetype)sharedAnimQueueManager{ | |
| 28 | + | |
| 29 | + static AnimQueueManager *manager; | |
| 30 | + | |
| 31 | + static dispatch_once_t onceToken; | |
| 32 | + dispatch_once(&onceToken, ^{ | |
| 33 | + manager = [[AnimQueueManager alloc] init]; | |
| 34 | + manager.maxOperationCount = 2; | |
| 35 | +// manager.arGiftArray = [NSMutableArray arrayWithObjects:@200,@240,@280, nil]; | |
| 36 | + }); | |
| 37 | + return manager; | |
| 38 | +} | |
| 39 | + | |
| 40 | +/** | |
| 41 | + 连击动画队列 | |
| 42 | + | |
| 43 | + @return 队列obj | |
| 44 | + */ | |
| 45 | +- (NSOperationQueue *)comboAnimationQueue{ | |
| 46 | + if (_comboAnimationQueue == nil) { | |
| 47 | + _comboAnimationQueue = [[NSOperationQueue alloc] init]; | |
| 48 | + _comboAnimationQueue.maxConcurrentOperationCount = 3; | |
| 49 | + } | |
| 50 | + return _comboAnimationQueue; | |
| 51 | +} | |
| 52 | + | |
| 53 | +/** | |
| 54 | + 豪华动画队列 | |
| 55 | + | |
| 56 | + @return 队列obj | |
| 57 | + */ | |
| 58 | +- (NSOperationQueue *)expenAnimationQueue{ | |
| 59 | + if (_expenAnimationQueue == nil) { | |
| 60 | + _expenAnimationQueue = [[NSOperationQueue alloc] init]; | |
| 61 | + _expenAnimationQueue.maxConcurrentOperationCount = 1; | |
| 62 | + } | |
| 63 | + return _expenAnimationQueue; | |
| 64 | +} | |
| 65 | + | |
| 66 | +/** | |
| 67 | + 根据实际model添加动画 | |
| 68 | + | |
| 69 | + @param model modelobj | |
| 70 | + */ | |
| 71 | +- (void)addAnimationWithModel:(GiftModel *)model animContentView:(UIView *)animContentView{ | |
| 72 | + | |
| 73 | + GiftAnimOperation *op = [GiftAnimOperation addGiftAnimOperationWithGiftModel:model animContentView:animContentView maxTop:self.maxTop]; | |
| 74 | + NSInteger index = self.comboAnimationQueue.operationCount; | |
| 75 | + NSLog(@"index:%zd",index); | |
| 76 | + switch (model.giftStyle) { | |
| 77 | + case GiftStylePorsch: | |
| 78 | + [self.expenAnimationQueue addOperation:op]; | |
| 79 | + break; | |
| 80 | +// case GiftStyleFighter: | |
| 81 | +// [self.expenAnimationQueue addOperation:op]; | |
| 82 | +// break; | |
| 83 | + case GiftStylePlane: | |
| 84 | + [self.expenAnimationQueue addOperation:op]; | |
| 85 | + break; | |
| 86 | + case GiftStyleCombo: | |
| 87 | + { | |
| 88 | + [self.comboAnimationQueue addOperation:op]; | |
| 89 | +// int i = rand()%4; | |
| 90 | +// op.name = i >0 ? @"张三_love" : @"李四_flower";//name imagename | |
| 91 | +// self.comboAnimationQueue.suspended; | |
| 92 | + } | |
| 93 | + | |
| 94 | + break; | |
| 95 | + default: | |
| 96 | + break; | |
| 97 | + } | |
| 98 | +} | |
| 99 | + | |
| 100 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftAnimOperation.h
0 → 100644
| 1 | +// | |
| 2 | +// GiftAnimOperation.h | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <Foundation/Foundation.h> | |
| 10 | +#import <UIKit/UIKit.h> | |
| 11 | + | |
| 12 | +@class GiftModel; | |
| 13 | + | |
| 14 | +@interface GiftAnimOperation : NSOperation | |
| 15 | + | |
| 16 | ++ (GiftAnimOperation *)addGiftAnimOperationWithGiftModel:(GiftModel *)model animContentView:(UIView *)animContentView maxTop:(NSInteger)maxTop; | |
| 17 | + | |
| 18 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftAnimOperation.m
0 → 100644
| 1 | +// | |
| 2 | +// GiftAnimOperation.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "GiftAnimOperation.h" | |
| 10 | +#import "GiftModel.h" | |
| 11 | +#import "GiftComboView.h" | |
| 12 | +#import "NHCarViews.h" | |
| 13 | +#import "NHPlaneViews.h" | |
| 14 | +#import "GiftAnimationAction.h" | |
| 15 | +//#import "NHFighterView.h" | |
| 16 | +//#import "NHFighterView+animDelegagte.h" | |
| 17 | + | |
| 18 | +@interface GiftAnimOperation () | |
| 19 | +{ | |
| 20 | + BOOL _finished; //用于设置队列是否完成 | |
| 21 | + BOOL _executing; //队列任务开始执行 | |
| 22 | +} | |
| 23 | + | |
| 24 | +@property (nonatomic, strong)GiftComboView *giftComboView; //连击动画 | |
| 25 | +@property (nonatomic, strong)NHCarViews *giftCarView; //跑车动画 | |
| 26 | +//@property (nonatomic, strong)NHFighterView *giftFighterView; //歼灭机动画 | |
| 27 | +@property (nonatomic, strong)NHPlaneViews *giftPlaneView; //客机动画 | |
| 28 | + | |
| 29 | +@property (nonatomic, strong)GiftModel *model; //model | |
| 30 | +@property (nonatomic,strong) UIView *animContentView; //需要显示动画的view | |
| 31 | +@property (nonatomic, assign)NSInteger maxTop; //初始位置(需要根据显示设置最低位置在哪里) | |
| 32 | +@property (nonatomic ,strong) NSArray * _Nullable defaultTrajory;//默认轨迹数组 | |
| 33 | +@property (nonatomic ,strong) NSMutableArray * _Nullable emptyTrajory;//当前空轨迹数组 | |
| 34 | + | |
| 35 | +@end | |
| 36 | + | |
| 37 | +@implementation GiftAnimOperation | |
| 38 | + | |
| 39 | ++ (GiftAnimOperation *)addGiftAnimOperationWithGiftModel:(GiftModel *)model animContentView:(UIView *)animContentView maxTop:(NSInteger)maxTop{ | |
| 40 | + | |
| 41 | + GiftAnimOperation *giftAnimOperation = [[GiftAnimOperation alloc]initWithGiftModel:model animContentView:animContentView maxTop:maxTop]; | |
| 42 | + return giftAnimOperation; | |
| 43 | +} | |
| 44 | + | |
| 45 | +/** | |
| 46 | + 初始化 | |
| 47 | + | |
| 48 | + @param model 礼物model | |
| 49 | + @param animContentView 需要把动画view添加到的view | |
| 50 | + @return obj | |
| 51 | + */ | |
| 52 | +- (instancetype)initWithGiftModel:(GiftModel *)model animContentView:(UIView *)animContentView maxTop:(NSInteger)maxTop{ | |
| 53 | + self = [super init]; | |
| 54 | + if (self) { | |
| 55 | + self.model = model; | |
| 56 | + self.animContentView = animContentView; | |
| 57 | + self.maxTop = maxTop; | |
| 58 | + } | |
| 59 | + return self; | |
| 60 | +} | |
| 61 | + | |
| 62 | +/** | |
| 63 | + 开始方法(KVO控制队列任务状态) | |
| 64 | + */ | |
| 65 | +- (void)start{ | |
| 66 | + //这里动画队列任务不存在Cancelled状态所以不需要判断,直接开始执行 | |
| 67 | + [self willChangeValueForKey:@"isExecuting"]; | |
| 68 | + _executing = YES; | |
| 69 | + [self main]; | |
| 70 | + [self didChangeValueForKey:@"isExecuting"]; | |
| 71 | +} | |
| 72 | + | |
| 73 | +/** | |
| 74 | + 自定义Operation提供了start main接口。 | |
| 75 | + */ | |
| 76 | +- (void)main{ | |
| 77 | + | |
| 78 | + switch (_model.giftStyle) { | |
| 79 | + case GiftStylePorsch: | |
| 80 | + [self porschAnimation]; | |
| 81 | + break; | |
| 82 | +// case GiftStyleFighter: | |
| 83 | +// [self fighterAnimation]; | |
| 84 | +// break; | |
| 85 | + case GiftStylePlane: | |
| 86 | + [self planeAnimation]; | |
| 87 | + break; | |
| 88 | + case GiftStyleCombo: | |
| 89 | + [self comboViewAnimation]; | |
| 90 | + break; | |
| 91 | + default: | |
| 92 | + break; | |
| 93 | + } | |
| 94 | +} | |
| 95 | + | |
| 96 | +- (void)porschAnimation | |
| 97 | +{ | |
| 98 | + weakself | |
| 99 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 100 | + strongself | |
| 101 | + | |
| 102 | + [self.giftCarView addAnimationsMoveToPoint:CGPointMake(0, 100) endPoint:CGPointMake(self.animContentView.bounds.size.width +166, 500)]; | |
| 103 | + [self.animContentView addSubview:self.giftCarView]; | |
| 104 | + | |
| 105 | + [self.giftCarView startPorschAnimationWithCompletion:^{ | |
| 106 | + | |
| 107 | + [self willChangeValueForKey:@"isFinished"]; | |
| 108 | + | |
| 109 | + _finished = YES; | |
| 110 | + | |
| 111 | + [self didChangeValueForKey:@"isFinished"]; | |
| 112 | + }]; | |
| 113 | + | |
| 114 | + }); | |
| 115 | +} | |
| 116 | + | |
| 117 | +//- (void)fighterAnimation | |
| 118 | +//{ | |
| 119 | +// weakself | |
| 120 | +// dispatch_async(dispatch_get_main_queue(), ^{ | |
| 121 | +// strongself | |
| 122 | +// | |
| 123 | +// [self.giftFighterView addAnimationsMoveToPoint:CGPointMake(SCREEN_WIDTH, 60) endPoint:CGPointMake( -500, 600)]; | |
| 124 | +// [self.animContentView addSubview:self.giftFighterView]; | |
| 125 | +// [self.giftFighterView startFighterAnimationWithCompletion:^{ | |
| 126 | +// [self willChangeValueForKey:@"isFinished"]; | |
| 127 | +// | |
| 128 | +// _finished = YES; | |
| 129 | +// | |
| 130 | +// [self didChangeValueForKey:@"isFinished"]; | |
| 131 | +// }]; | |
| 132 | +// | |
| 133 | +// }); | |
| 134 | +//} | |
| 135 | + | |
| 136 | +- (void)planeAnimation | |
| 137 | +{ | |
| 138 | + weakself | |
| 139 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 140 | + strongself | |
| 141 | + | |
| 142 | + [self.giftPlaneView addAnimationsMoveToPoint:CGPointMake(SCREEN_WIDTH, 100) endPoint:CGPointMake(-500, 410)]; | |
| 143 | + [self.animContentView addSubview:self.giftPlaneView]; | |
| 144 | + [self.giftPlaneView startPlaneAnimationWithCompletion:^{ | |
| 145 | + | |
| 146 | + [self willChangeValueForKey:@"isFinished"]; | |
| 147 | + | |
| 148 | + _finished = YES; | |
| 149 | + | |
| 150 | + [self didChangeValueForKey:@"isFinished"]; | |
| 151 | + }]; | |
| 152 | + | |
| 153 | + }); | |
| 154 | +} | |
| 155 | + | |
| 156 | +static long currentCompleteIndex = 0; | |
| 157 | +/** | |
| 158 | + 连击动画 | |
| 159 | + */ | |
| 160 | +- (void)comboViewAnimation{ | |
| 161 | + | |
| 162 | + __weak GiftAnimOperation *weakSelf = self; | |
| 163 | +// currentCompleteIndex ++; | |
| 164 | + | |
| 165 | +// if (self.emptyTrajory.count == 0)//index = 0 | |
| 166 | +// { | |
| 167 | +// currentCompleteIndex = 0; | |
| 168 | +// | |
| 169 | +// }else if (self.emptyTrajory.count < 3)//从emptyArr取空的index并赋值 index | |
| 170 | +// { | |
| 171 | +// | |
| 172 | +// | |
| 173 | +// }else// = 3已满 index = 0 | |
| 174 | +// { | |
| 175 | +// currentCompleteIndex = 0; | |
| 176 | +// } | |
| 177 | +// self.name = @"111"; | |
| 178 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 179 | + [weakSelf.animContentView addSubview:weakSelf.giftComboView]; | |
| 180 | + | |
| 181 | + weakSelf.giftComboView.top = [self.defaultTrajory[currentCompleteIndex] integerValue]; | |
| 182 | + | |
| 183 | + NSLog(@"top:%zd,index%ld",[self.defaultTrajory[currentCompleteIndex] integerValue],currentCompleteIndex); | |
| 184 | + currentCompleteIndex ++; | |
| 185 | + if (currentCompleteIndex == 3) | |
| 186 | + { | |
| 187 | + currentCompleteIndex = 0; | |
| 188 | + } | |
| 189 | +// if ([self.name isEqualToString:@"李四_flower"]) { | |
| 190 | +//// currentCompleteIndex = 0; | |
| 191 | +// self. | |
| 192 | +// } | |
| 193 | + [weakSelf.giftComboView startComboAnimationWithCompletion:^{ | |
| 194 | + NSLog(@"complet top:%zd,index%zd",[self.defaultTrajory[currentCompleteIndex] integerValue],currentCompleteIndex); | |
| 195 | + //empty存当前顺序 | |
| 196 | +// [self.emptyTrajory replaceObjectAtIndex:<#(NSUInteger)#> withObject:<#(nonnull id)#>]; | |
| 197 | + [weakSelf.giftComboView removeFromSuperview]; | |
| 198 | + | |
| 199 | + [weakSelf willChangeValueForKey:@"isFinished"]; | |
| 200 | + | |
| 201 | + _finished = YES; | |
| 202 | + | |
| 203 | + [weakSelf didChangeValueForKey:@"isFinished"]; | |
| 204 | + }]; | |
| 205 | + }); | |
| 206 | +} | |
| 207 | + | |
| 208 | +/** | |
| 209 | + 连击动画 | |
| 210 | + | |
| 211 | + @return 连击view | |
| 212 | + */ | |
| 213 | +- (GiftComboView *)giftComboView{ | |
| 214 | + if (_giftComboView == nil) { | |
| 215 | + _giftComboView = [GiftComboView comboView]; | |
| 216 | + } | |
| 217 | + return _giftComboView; | |
| 218 | +} | |
| 219 | + | |
| 220 | +/** | |
| 221 | + 跑车动画 | |
| 222 | + | |
| 223 | + @return 连击view | |
| 224 | + */ | |
| 225 | +- (NHCarViews *)giftCarView{ | |
| 226 | + if (_giftCarView == nil) { | |
| 227 | + _giftCarView = [NHCarViews loadCarViewWithPoint:CGPointZero]; | |
| 228 | + //数组中放CGRect数据,CGRect的x和y分别作为控制点的x和y,CGRect的width和height作为结束点的x和y | |
| 229 | + //方法如下:数组内的每个元素代码一个控制点和结束点 | |
| 230 | + NSMutableArray *pointArrs = [[NSMutableArray alloc] init]; | |
| 231 | + CGFloat width = SCREEN_WIDTH / 2; | |
| 232 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | |
| 233 | + [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | |
| 234 | + _giftCarView.curveControlAndEndPoints = pointArrs; | |
| 235 | + } | |
| 236 | + return _giftCarView; | |
| 237 | +} | |
| 238 | + | |
| 239 | +/** | |
| 240 | + 歼灭机动画 | |
| 241 | + | |
| 242 | + @return 连击view | |
| 243 | + */ | |
| 244 | +//- (NHFighterView *)giftFighterView{ | |
| 245 | +// if (_giftFighterView == nil) { | |
| 246 | +// _giftFighterView = [NHFighterView loadFighterViewWithPoint:CGPointMake(10, 100)]; | |
| 247 | +// } | |
| 248 | +// return _giftFighterView; | |
| 249 | +//} | |
| 250 | + | |
| 251 | +/** | |
| 252 | + 客机动画 | |
| 253 | + | |
| 254 | + @return 连击view | |
| 255 | + */ | |
| 256 | +- (NHPlaneViews *)giftPlaneView{ | |
| 257 | + if (_giftPlaneView == nil) { | |
| 258 | + _giftPlaneView = [NHPlaneViews loadPlaneViewWithPoint:CGPointMake(SCREEN_WIDTH + 232, 0)]; | |
| 259 | + } | |
| 260 | + return _giftPlaneView; | |
| 261 | +} | |
| 262 | + | |
| 263 | +- (NSArray *)defaultTrajory | |
| 264 | +{ | |
| 265 | + if (!_defaultTrajory) | |
| 266 | + { | |
| 267 | + _defaultTrajory = [[NSArray alloc] initWithObjects:@200,@240,@280, nil]; | |
| 268 | + } | |
| 269 | + return _defaultTrajory; | |
| 270 | +} | |
| 271 | + | |
| 272 | +- (NSMutableArray *)emptyTrajory | |
| 273 | +{ | |
| 274 | + if (!_emptyTrajory) | |
| 275 | + { | |
| 276 | + _emptyTrajory = [[NSMutableArray alloc] init]; | |
| 277 | + } | |
| 278 | + return _emptyTrajory; | |
| 279 | +} | |
| 280 | + | |
| 281 | +// 提示:To be deprecated; use and override 'asynchronous' below | |
| 282 | +//之前用的isConcurrent | |
| 283 | +/** | |
| 284 | + 覆写异步执行 | |
| 285 | + | |
| 286 | + @return YES | |
| 287 | + */ | |
| 288 | +- (BOOL)isAsynchronous{ | |
| 289 | + return YES; | |
| 290 | +} | |
| 291 | + | |
| 292 | +/** | |
| 293 | + 覆写任务是否完成控制 | |
| 294 | + | |
| 295 | + @return 完成状态 _finished | |
| 296 | + */ | |
| 297 | +- (BOOL) isFinished{ | |
| 298 | + return _finished; | |
| 299 | +} | |
| 300 | + | |
| 301 | +/** | |
| 302 | + 覆写任务是否完成开始执行 | |
| 303 | + | |
| 304 | + @return 执行状态 _executing | |
| 305 | + */ | |
| 306 | +- (BOOL) isExecuting{ | |
| 307 | + return _executing; | |
| 308 | +} | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftAnimationAction.h
0 → 100644
| 1 | +// | |
| 2 | +// GiftAnimationAction.h | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +/** | |
| 12 | + 动画完成回调 | |
| 13 | + */ | |
| 14 | +typedef void(^giftAnimationCompletion)(); | |
| 15 | + | |
| 16 | +@interface GiftAnimationAction : UIView<CAAnimationDelegate>{ | |
| 17 | + giftAnimationCompletion _giftAnimationCompletion; //动画完成回调 | |
| 18 | +} | |
| 19 | + | |
| 20 | +/** | |
| 21 | + 连击动画 | |
| 22 | + */ | |
| 23 | +- (void)startComboAnimationWithCompletion:(giftAnimationCompletion)Completion; | |
| 24 | + | |
| 25 | +/** | |
| 26 | + 跑车动画 | |
| 27 | + */ | |
| 28 | +- (void)startPorschAnimationWithCompletion:(giftAnimationCompletion)Completion; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + 歼灭机动画 | |
| 32 | + */ | |
| 33 | +//- (void)startFighterAnimationWithCompletion:(giftAnimationCompletion)Completion; | |
| 34 | + | |
| 35 | +/** | |
| 36 | + 客机动画 | |
| 37 | + */ | |
| 38 | +- (void)startPlaneAnimationWithCompletion:(giftAnimationCompletion)Completion; | |
| 39 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftAnimationAction.m
0 → 100644
| 1 | +// | |
| 2 | +// GiftAnimationAction.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "GiftAnimationAction.h" | |
| 10 | + | |
| 11 | +@implementation GiftAnimationAction | |
| 12 | + | |
| 13 | +/** | |
| 14 | + 连击横屏动画 | |
| 15 | + */ | |
| 16 | +- (void)startComboAnimationWithCompletion:(giftAnimationCompletion)Completion{ | |
| 17 | + _giftAnimationCompletion = Completion; | |
| 18 | + NSLog(@"self.width:%f",self.width); | |
| 19 | + [self animationWithDuration:4 | |
| 20 | + YValues:@[@(0 - self.width), @(115), @(110), @(110), @(0 - self.width)] | |
| 21 | + keyTimes:@[@0.0, @0.2, @0.3, @0.8, @1.0] | |
| 22 | + timingFunctions:@[ | |
| 23 | + [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut], | |
| 24 | + [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault], | |
| 25 | + [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault], | |
| 26 | + [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn] | |
| 27 | + ] | |
| 28 | + addView:self]; | |
| 29 | +} | |
| 30 | + | |
| 31 | +/** | |
| 32 | + 位移动画具体实现 | |
| 33 | + | |
| 34 | + @param duration 动画持续时间 | |
| 35 | + @param YValues 动画帧数组 | |
| 36 | + @param keyTimes 动画帧时间 | |
| 37 | + @param timingFunctions 动画方式数组 | |
| 38 | + @param addView 需要添加的view | |
| 39 | + */ | |
| 40 | +- (void)animationWithDuration:(float)duration YValues:(NSArray *)YValues keyTimes:(NSArray *)keyTimes timingFunctions:(NSArray *)timingFunctions addView:(UIView *)addView{ | |
| 41 | + CAKeyframeAnimation *rocketAnim = [CAKeyframeAnimation animation]; | |
| 42 | + rocketAnim.keyPath = @"position.x"; | |
| 43 | + rocketAnim.values = YValues; | |
| 44 | + rocketAnim.keyTimes = keyTimes; | |
| 45 | + rocketAnim.timingFunctions = timingFunctions; | |
| 46 | + rocketAnim.duration = duration; | |
| 47 | + rocketAnim.fillMode = kCAFillModeForwards; | |
| 48 | + rocketAnim.removedOnCompletion = NO; | |
| 49 | + rocketAnim.delegate = self; | |
| 50 | + [addView.layer addAnimation:rocketAnim forKey:@"positionY"]; | |
| 51 | +} | |
| 52 | + | |
| 53 | +/** | |
| 54 | + 跑车动画 | |
| 55 | + */ | |
| 56 | +- (void)startPorschAnimationWithCompletion:(giftAnimationCompletion)Completion | |
| 57 | +{ | |
| 58 | + _giftAnimationCompletion = Completion; | |
| 59 | +} | |
| 60 | + | |
| 61 | +/** | |
| 62 | + 歼灭机动画 | |
| 63 | + */ | |
| 64 | +//- (void)startFighterAnimationWithCompletion:(giftAnimationCompletion)Completion | |
| 65 | +//{ | |
| 66 | +// _giftAnimationCompletion = Completion; | |
| 67 | +//} | |
| 68 | + | |
| 69 | +/** | |
| 70 | + 客机动画 | |
| 71 | + */ | |
| 72 | +- (void)startPlaneAnimationWithCompletion:(giftAnimationCompletion)Completion | |
| 73 | +{ | |
| 74 | + _giftAnimationCompletion = Completion; | |
| 75 | +} | |
| 76 | + | |
| 77 | +/** | |
| 78 | + 动画回调代理,用于判断是否完成 | |
| 79 | + | |
| 80 | + @param anim 动画对象 | |
| 81 | + @param flag 是否完成标记 | |
| 82 | + */ | |
| 83 | +- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{ | |
| 84 | + _giftAnimationCompletion(); | |
| 85 | +} | |
| 86 | + | |
| 87 | + | |
| 88 | +/* | |
| 89 | +// Only override drawRect: if you perform custom drawing. | |
| 90 | +// An empty implementation adversely affects performance during animation. | |
| 91 | +- (void)drawRect:(CGRect)rect { | |
| 92 | + // Drawing code | |
| 93 | +} | |
| 94 | +*/ | |
| 95 | + | |
| 96 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftComboView.h
0 → 100644
| 1 | +// | |
| 2 | +// GiftComboView.h | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "GiftAnimationAction.h" | |
| 10 | + | |
| 11 | +@class GiftModel; | |
| 12 | +@interface GiftComboView : GiftAnimationAction | |
| 13 | + | |
| 14 | +/** | |
| 15 | + 动画开始 | |
| 16 | + | |
| 17 | + @param model 对应的动画解析model | |
| 18 | + @param animationCompletion 动画完成回调(用于控制队列) | |
| 19 | + */ | |
| 20 | +- (void)startAnimationWithModel:(GiftModel *)model withAnimationCompletion: (giftAnimationCompletion)animationCompletion; | |
| 21 | + | |
| 22 | ++ (instancetype)comboView; | |
| 23 | + | |
| 24 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftComboView.m
0 → 100644
| 1 | +// | |
| 2 | +// GiftComboView.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "GiftComboView.h" | |
| 10 | +#import "GiftModel.h" | |
| 11 | + | |
| 12 | +@interface GiftComboView (){ | |
| 13 | + GiftModel *_model;//礼物model | |
| 14 | +} | |
| 15 | + | |
| 16 | +@end | |
| 17 | + | |
| 18 | +@implementation GiftComboView | |
| 19 | + | |
| 20 | +/** | |
| 21 | + 动画开始 | |
| 22 | + | |
| 23 | + @param model 对应的动画解析model | |
| 24 | + @param animationCompletion 动画完成回调(用于控制队列) | |
| 25 | + */ | |
| 26 | +- (void)startAnimationWithModel:(GiftModel *)model withAnimationCompletion: (giftAnimationCompletion)animationCompletion | |
| 27 | +{ | |
| 28 | + _giftAnimationCompletion = animationCompletion; | |
| 29 | + _model = model; | |
| 30 | + | |
| 31 | + [self startComboAnimationWithCompletion:animationCompletion]; | |
| 32 | +} | |
| 33 | + | |
| 34 | + | |
| 35 | +/** | |
| 36 | + 初始化连击View | |
| 37 | + | |
| 38 | + @return 初始化连击ComboView | |
| 39 | + */ | |
| 40 | ++ (instancetype)comboView | |
| 41 | +{ | |
| 42 | + GiftComboView *comboView = [[GiftComboView alloc] initWithFrame:CGRectMake(0, 0, 180, 30)]; | |
| 43 | + comboView.backgroundColor = [UIColor blueColor]; | |
| 44 | + | |
| 45 | + return comboView; | |
| 46 | +} | |
| 47 | + | |
| 48 | +/* | |
| 49 | +// Only override drawRect: if you perform custom drawing. | |
| 50 | +// An empty implementation adversely affects performance during animation. | |
| 51 | +- (void)drawRect:(CGRect)rect { | |
| 52 | + // Drawing code | |
| 53 | +} | |
| 54 | +*/ | |
| 55 | + | |
| 56 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftModel/GiftModel.h
| ... | ... | @@ -8,15 +8,28 @@ |
| 8 | 8 | |
| 9 | 9 | #import "BaseModel.h" |
| 10 | 10 | |
| 11 | -typedef NS_ENUM(NSInteger, GiftModelType) {//礼物类型 | |
| 12 | - GiftModelTypeCommon = 1,//普通礼物 | |
| 13 | - GiftModelTypeSpecial //特殊(豪华)礼物 | |
| 11 | +typedef NS_ENUM(NSInteger, GiftStyle) {//礼物类型 | |
| 12 | + GiftStyleCombo = 1,//普通可连击礼物 | |
| 13 | + GiftStylePorsch ,//豪华跑车礼物 | |
| 14 | +// GiftStyleFighter ,//豪华歼灭机礼物 | |
| 15 | + GiftStylePlane ,//豪华客机礼物 | |
| 14 | 16 | }; |
| 15 | 17 | |
| 16 | 18 | @interface GiftModel : BaseModel |
| 17 | 19 | |
| 18 | -@property (nonatomic ,copy) NSString * _Nullable image; | |
| 19 | -@property (nonatomic ) GiftModelType type; | |
| 20 | -@property (nonatomic ,copy) NSString * _Nullable price; | |
| 20 | +@property (nonatomic ,copy ) NSString * _Nullable image; | |
| 21 | +@property (nonatomic ,copy ) NSString * _Nullable price; | |
| 22 | + | |
| 23 | +@property (nonatomic ) NSInteger index;//索引 | |
| 24 | +@property (nonatomic ) GiftStyle giftStyle;//动画类型 | |
| 25 | +@property (nonatomic, copy ) NSString * _Nullable giftname;//礼物名字 | |
| 26 | +@property (nonatomic, strong) NSArray * _Nullable giftIconArray;//礼物图片数组 | |
| 27 | +@property (nonatomic, copy ) NSString * _Nullable giftNum;//礼物数量 | |
| 28 | +@property (nonatomic, copy ) NSString * _Nullable giftRusername;//接受礼物的人 | |
| 29 | +@property (nonatomic, copy ) NSString * _Nullable giftRuserId;//接受礼物的人id | |
| 30 | +@property (nonatomic, copy ) NSString * _Nullable giftGusername;//送礼物的人 | |
| 31 | +@property (nonatomic, copy ) NSString * _Nullable giftGuserId;//送礼物的id | |
| 32 | + | |
| 33 | +//@property (nonatomic, strong) NSString *_Nullable pushId;//跳转id | |
| 21 | 34 | |
| 22 | 35 | @end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHCarViews.h
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHCarViews.m
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHFighterView+animDelegagte.h
0 → 100644
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHFighterView+animDelegagte.m
0 → 100644
| 1 | +// | |
| 2 | +// NHFighterView+animDelegagte.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by 张旭 on 2017/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "NHFighterView+animDelegagte.h" | |
| 10 | + | |
| 11 | +@implementation NHFighterView (animDelegagte) | |
| 12 | + | |
| 13 | +- (void)animationDidStart:(CAAnimation *)anim | |
| 14 | +{ | |
| 15 | + NSLog(@"did start"); | |
| 16 | +} | |
| 17 | + | |
| 18 | +- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag | |
| 19 | +{ | |
| 20 | + _giftAnimationCompletion(-1); | |
| 21 | + NSLog(@"did stop"); | |
| 22 | +} | |
| 23 | + | |
| 24 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHFighterView.h
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHPlaneViews.h
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource/NHPlaneViews.m
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftViews/GiftListView.h
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftViews/GiftListView.m
| ... | ... | @@ -8,6 +8,8 @@ |
| 8 | 8 | |
| 9 | 9 | #import "GiftListView.h" |
| 10 | 10 | #import "GiftModel.h" |
| 11 | +#import "LiveBaseView.h" | |
| 12 | +#import "AnimQueueManager.h" | |
| 11 | 13 | |
| 12 | 14 | #define MAX_LINE_COUNT 4 |
| 13 | 15 | #define MAX_ROW_COUNT 2 |
| ... | ... | @@ -15,24 +17,29 @@ |
| 15 | 17 | @interface GiftListView () |
| 16 | 18 | |
| 17 | 19 | @property (nonatomic ,strong) NSArray <GiftModel *>* _Nullable giftArray; |
| 20 | +@property (nonatomic ,weak) LiveBaseView * _Nullable liveBaseView; | |
| 21 | +@property (nonatomic, strong) AnimQueueManager *animQueueManager; | |
| 22 | +@property (nonatomic ,strong) GiftModel * _Nullable model; | |
| 18 | 23 | |
| 19 | 24 | @end |
| 20 | 25 | |
| 21 | 26 | @implementation GiftListView |
| 22 | 27 | |
| 23 | -- (instancetype)initWithFrame:(CGRect)frame | |
| 28 | +- (instancetype)initWithFrame:(CGRect)frame liveBaseView:(LiveBaseView *_Nullable)liveBaseView | |
| 24 | 29 | { |
| 25 | 30 | if (self = [super initWithFrame:frame]) { |
| 31 | + self.liveBaseView = liveBaseView; | |
| 32 | + self.animQueueManager = [AnimQueueManager sharedAnimQueueManager]; | |
| 33 | + self.animQueueManager.maxTop = 200; | |
| 26 | 34 | |
| 27 | - | |
| 28 | - UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.bounds]; | |
| 29 | - scrollView.contentSize = CGSizeMake(self.width *(self.giftArray.count/(MAX_ROW_COUNT*MAX_LINE_COUNT) + 1), self.height); | |
| 35 | + UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height - 30)]; | |
| 36 | + scrollView.contentSize = CGSizeMake(self.width *(self.giftArray.count/(MAX_ROW_COUNT*MAX_LINE_COUNT) + 1), self.height - 30); | |
| 30 | 37 | scrollView.pagingEnabled = YES; |
| 31 | 38 | scrollView.bounces = NO; |
| 32 | 39 | scrollView.showsVerticalScrollIndicator = NO; |
| 33 | 40 | scrollView.showsHorizontalScrollIndicator = NO; |
| 34 | - scrollView.backgroundColor = [UIColor blueColor]; | |
| 35 | 41 | [self addSubview:scrollView]; |
| 42 | + scrollView.backgroundColor = ZXRandomColor; | |
| 36 | 43 | |
| 37 | 44 | int line = 0; |
| 38 | 45 | int row = 0; |
| ... | ... | @@ -50,12 +57,11 @@ |
| 50 | 57 | } |
| 51 | 58 | row = i % MAX_LINE_COUNT; |
| 52 | 59 | CGFloat giftWidth = self.width / MAX_LINE_COUNT * 1.0; |
| 53 | - CGFloat giftHeight = self.height / MAX_ROW_COUNT * 1.0; | |
| 60 | + CGFloat giftHeight = (self.height - 30) / MAX_ROW_COUNT * 1.0; | |
| 54 | 61 | giftX = row * giftWidth + page * scrollView.width; |
| 55 | 62 | giftY = line * giftHeight; |
| 56 | 63 | |
| 57 | 64 | UIView *giftView = [self giftViewWithFrame:CGRectMake(giftX, giftY, giftWidth, giftHeight) model:self.giftArray[i]]; |
| 58 | - giftView.backgroundColor = ZXRandomColor; | |
| 59 | 65 | |
| 60 | 66 | UIImageView *picImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:self.giftArray[i].image]]; |
| 61 | 67 | picImg.centerX = giftView.width * 0.5; |
| ... | ... | @@ -63,6 +69,10 @@ |
| 63 | 69 | [giftView addSubview:picImg]; |
| 64 | 70 | |
| 65 | 71 | [scrollView addSubview:giftView]; |
| 72 | + | |
| 73 | + UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gestureClick:)]; | |
| 74 | + giftView.tag = i + 10; | |
| 75 | + [giftView addGestureRecognizer:gesture]; | |
| 66 | 76 | } |
| 67 | 77 | } |
| 68 | 78 | return self; |
| ... | ... | @@ -70,40 +80,84 @@ |
| 70 | 80 | |
| 71 | 81 | - (UIView *)giftViewWithFrame:(CGRect)frame model:(GiftModel *)model |
| 72 | 82 | { |
| 83 | + _model = model; | |
| 73 | 84 | UIView *giftView = [[UIView alloc] initWithFrame:frame]; |
| 74 | - switch (model.type) { | |
| 75 | - case GiftModelTypeCommon: | |
| 76 | - { | |
| 77 | - UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(giftView.width - 17, 3, 15, 15)]; | |
| 78 | - imageView.backgroundColor = ZXRandomColor; | |
| 79 | - [giftView addSubview:imageView]; | |
| 80 | - } | |
| 81 | - break; | |
| 82 | - case GiftModelTypeSpecial: | |
| 83 | - { | |
| 84 | - | |
| 85 | - } | |
| 86 | - break; | |
| 87 | - default: | |
| 88 | - break; | |
| 85 | + if (model.giftStyle == GiftStyleCombo) | |
| 86 | + { | |
| 87 | + UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(giftView.width - 17, 3, 15, 15)]; | |
| 88 | + imageView.backgroundColor = ZXRandomColor; | |
| 89 | + [giftView addSubview:imageView]; | |
| 90 | + }else | |
| 91 | + { | |
| 92 | + | |
| 89 | 93 | } |
| 94 | + UILabel *priceLbl = [[UILabel alloc] initWithFrame:CGRectMake(0, giftView.height - 15, 40, 14)]; | |
| 95 | + priceLbl.font = [UIFont systemFontOfSize:kDetailContentFont]; | |
| 96 | + priceLbl.textColor = [UIColor greenColor]; | |
| 97 | + priceLbl.text = model.price; | |
| 98 | + priceLbl.width = [priceLbl labelSize].width; | |
| 99 | + priceLbl.height = [priceLbl labelSize].height; | |
| 100 | + priceLbl.centerX = giftView.width * 0.5 - 4; | |
| 101 | + [giftView addSubview:priceLbl]; | |
| 102 | + | |
| 103 | + UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"littleHeart2"]]; | |
| 104 | + image.left = priceLbl.right + 3; | |
| 105 | + image.centerY = priceLbl.centerY; | |
| 106 | + [giftView addSubview:image]; | |
| 90 | 107 | |
| 91 | - UIButton *coin = [[UIButton alloc] initWithFrame:CGRectMake(0, giftView.height - 13, 15, 10)]; | |
| 92 | - coin.centerX = giftView.width * 0.5; | |
| 93 | - coin.backgroundColor = ZXRandomColor; | |
| 94 | - [giftView addSubview:coin]; | |
| 95 | 108 | return giftView; |
| 96 | 109 | } |
| 97 | 110 | |
| 111 | +#pragma mark - 选择礼物点击 | |
| 112 | +- (void)gestureClick:(UITapGestureRecognizer *)gesture | |
| 113 | +{ | |
| 114 | + NSInteger tag = gesture.view.tag - 10; | |
| 115 | + NSLog(@"%zd",tag); | |
| 116 | + //右上角添加✔️,再次点击去掉✔️ | |
| 117 | + [self.animQueueManager addAnimationWithModel:self.giftArray[tag] animContentView:self.liveBaseView]; | |
| 118 | +} | |
| 119 | + | |
| 120 | +#pragma mark - getter | |
| 121 | + | |
| 98 | 122 | - (NSArray *)giftArray |
| 99 | 123 | { |
| 100 | 124 | if (!_giftArray) |
| 101 | 125 | { |
| 102 | - GiftModel *model = [[GiftModel alloc] init]; | |
| 103 | - model.image = @"love"; | |
| 104 | - model.type = GiftModelTypeCommon; | |
| 105 | - model.price = @"3"; | |
| 106 | - _giftArray = [[NSArray alloc] initWithObjects:model,model,model,model,model,model,model,model,model,model, nil]; | |
| 126 | + NSArray *images = [NSArray arrayWithObjects:@"love",@"love",@"love",@"love",@"love",@"love",@"love",@"love",@"love",@"love",nil]; | |
| 127 | + NSArray *types = [NSArray arrayWithObjects:@2,@3,@1,@1,@1,@1,@1,@1,@1,@1, nil]; | |
| 128 | + NSArray *prices = [NSArray arrayWithObjects:@"300000000",@"3000",@"300000",@"30",@"3",@"3",@"1",@"3",@"1",@"3", nil]; | |
| 129 | + | |
| 130 | + NSMutableArray *tempArr = [NSMutableArray array]; | |
| 131 | + for (int i = 0; i < images.count; i ++) { | |
| 132 | + GiftModel *model = [GiftModel new]; | |
| 133 | + model.giftname = @"鲜花"; | |
| 134 | + model.giftIconArray = @[[UIImage imageNamed:@"love"]]; | |
| 135 | + model.giftNum = @"5"; | |
| 136 | + model.giftRusername = @"啊啊啊啊啊啊啊啊啊啊啊啊"; | |
| 137 | + model.giftRuserId = @"10000"; | |
| 138 | + model.giftGusername = @"按时大多数阿萨德 爱傻傻的爱的"; | |
| 139 | + model.giftGuserId = @"20000"; | |
| 140 | + model.image = images[i]; | |
| 141 | + int type = [types[i] intValue]; | |
| 142 | + if (type == 1) { | |
| 143 | + model.giftStyle = GiftStyleCombo; | |
| 144 | + }else if (type == 2) | |
| 145 | + { | |
| 146 | + model.giftStyle = GiftStylePorsch; | |
| 147 | + } | |
| 148 | +// else if (type == 3) | |
| 149 | +// { | |
| 150 | +// model.giftStyle = GiftStyleFighter; | |
| 151 | +// } | |
| 152 | + else if (type == 3) | |
| 153 | + { | |
| 154 | + model.giftStyle = GiftStylePlane; | |
| 155 | + } | |
| 156 | + | |
| 157 | + model.price = prices[i]; | |
| 158 | + [tempArr addObject:model]; | |
| 159 | + } | |
| 160 | + _giftArray = [[NSArray alloc] initWithArray:tempArr]; | |
| 107 | 161 | } |
| 108 | 162 | return _giftArray; |
| 109 | 163 | } | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/LVCGiftManager.h deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCGiftManager.h | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by 张旭 on 2017/3/13. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import <Foundation/Foundation.h> | |
| 10 | - | |
| 11 | -typedef NS_ENUM(NSInteger, GiftType) {//礼物类型 | |
| 12 | - GiftTypePorsch = 1,//跑车 | |
| 13 | - GiftTypeFighter ,//歼灭机 | |
| 14 | - GiftTypePlane ,//客机 | |
| 15 | -}; | |
| 16 | - | |
| 17 | -@interface LVCGiftManager : NSObject | |
| 18 | - | |
| 19 | -+ (void)giftType:(GiftType)giftType toView:(UIView *_Nonnull)toView; | |
| 20 | - | |
| 21 | -@end | |
| 22 | - |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/LVCGiftManager.m deleted
100644 → 0
| 1 | -// | |
| 2 | -// LVCGiftManager.m | |
| 3 | -// LiveVideoCloud | |
| 4 | -// | |
| 5 | -// Created by 张旭 on 2017/3/13. | |
| 6 | -// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | -// | |
| 8 | - | |
| 9 | -#import "LVCGiftManager.h" | |
| 10 | -#import "NHCarViews.h" | |
| 11 | -#import "NHFighterView.h" | |
| 12 | -#import "NHPlaneViews.h" | |
| 13 | - | |
| 14 | -@implementation LVCGiftManager | |
| 15 | - | |
| 16 | -+ (void)giftType:(GiftType)giftType toView:(UIView *_Nonnull)toView | |
| 17 | -{ | |
| 18 | - | |
| 19 | - switch (giftType) { | |
| 20 | - case GiftTypePorsch: | |
| 21 | - { | |
| 22 | - NHCarViews *car = [NHCarViews loadCarViewWithPoint:CGPointZero]; | |
| 23 | - //数组中放CGRect数据,CGRect的x和y分别作为控制点的x和y,CGRect的width和height作为结束点的x和y | |
| 24 | - //方法如下:数组内的每个元素代码一个控制点和结束点 | |
| 25 | - NSMutableArray *pointArrs = [[NSMutableArray alloc] init]; | |
| 26 | - CGFloat width = SCREEN_WIDTH / 2; | |
| 27 | - [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | |
| 28 | - [pointArrs addObject:NSStringFromCGRect(CGRectMake(width, 300, width, 300))]; | |
| 29 | - car.curveControlAndEndPoints = pointArrs; | |
| 30 | - [car addAnimationsMoveToPoint:CGPointMake(0, 100) endPoint:CGPointMake(toView.bounds.size.width +166, 500)]; | |
| 31 | - [toView addSubview:car]; | |
| 32 | - } | |
| 33 | - break; | |
| 34 | - case GiftTypeFighter: | |
| 35 | - { | |
| 36 | - NHFighterView *fighter = [NHFighterView loadFighterViewWithPoint:CGPointMake(10, 100)]; | |
| 37 | - [fighter addAnimationsMoveToPoint:CGPointMake(SCREEN_WIDTH, 60) endPoint:CGPointMake( -500, 600)]; | |
| 38 | - [toView addSubview:fighter]; | |
| 39 | - } | |
| 40 | - break; | |
| 41 | - case GiftTypePlane: | |
| 42 | - { | |
| 43 | - NHPlaneViews *plane = [NHPlaneViews loadPlaneViewWithPoint:CGPointMake(SCREEN_WIDTH + 232, 0)]; | |
| 44 | -// NSMutableArray *pointArrs = [[NSMutableArray alloc] init]; | |
| 45 | -// [pointArrs addObject:NSStringFromCGRect(CGRectMake(290, 250, 290, 250))]; | |
| 46 | -// [pointArrs addObject:NSStringFromCGRect(CGRectMake(290, 250, 290, 250))]; | |
| 47 | -// plane.curveControlAndEndPoints = pointArrs; | |
| 48 | - [plane addAnimationsMoveToPoint:CGPointMake(SCREEN_WIDTH, 100) endPoint:CGPointMake(-500, 410)]; | |
| 49 | - [toView addSubview:plane]; | |
| 50 | - } | |
| 51 | - break; | |
| 52 | - | |
| 53 | - default: | |
| 54 | - break; | |
| 55 | - } | |
| 56 | - | |
| 57 | - | |
| 58 | - } | |
| 59 | - | |
| 60 | -@end |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/LVCInteractionController.m
| ... | ... | @@ -33,7 +33,8 @@ |
| 33 | 33 | if (!_liveBaseView) |
| 34 | 34 | { |
| 35 | 35 | _liveBaseView = [[LiveBaseView alloc] initWithFrame:SCREEN_RECT]; |
| 36 | - _liveBaseView.backgroundColor = [UIColor greenColor]; | |
| 36 | + _liveBaseView.viewController = self; | |
| 37 | + _liveBaseView.backgroundColor = [UIColor clearColor]; | |
| 37 | 38 | } |
| 38 | 39 | return _liveBaseView; |
| 39 | 40 | } | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/LiveBaseView.h
LiveVideoCloud/LiveVideoCloud/Classes/Sections/InteractionSections/LiveBaseView.m
| ... | ... | @@ -8,10 +8,9 @@ |
| 8 | 8 | // |
| 9 | 9 | |
| 10 | 10 | #import "LiveBaseView.h" |
| 11 | -#import "LVCGiftManager.h" | |
| 12 | 11 | #import "BottomToolView.h" |
| 13 | 12 | #import "GiftListView.h" |
| 14 | - | |
| 13 | +#import "GiftModel.h" | |
| 15 | 14 | @interface LiveBaseView ()<bottomBtnDeledate> |
| 16 | 15 | |
| 17 | 16 | @property (nonatomic ,strong) UIScrollView * _Nullable scrollView; |
| ... | ... | @@ -19,10 +18,6 @@ |
| 19 | 18 | @property (nonatomic ,strong) UIButton * _Nullable closeBtn; |
| 20 | 19 | @property (nonatomic ,strong) UIView * _Nullable currentPopView; |
| 21 | 20 | |
| 22 | -@property (nonatomic ,strong) UIButton * _Nullable porschBtn; | |
| 23 | -@property (nonatomic ,strong) UIButton * _Nullable fightBtn; | |
| 24 | -@property (nonatomic ,strong) UIButton * _Nullable planeBtn; | |
| 25 | - | |
| 26 | 21 | @end |
| 27 | 22 | |
| 28 | 23 | @implementation LiveBaseView |
| ... | ... | @@ -34,11 +29,7 @@ |
| 34 | 29 | [self addSubview:self.scrollView]; |
| 35 | 30 | [self.scrollView addSubview:self.bottomToolView]; |
| 36 | 31 | [self addSubview:self.closeBtn]; |
| 37 | - [self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureClick)]]; | |
| 38 | - | |
| 39 | -// [self addSubview:self.porschBtn]; | |
| 40 | -// [self addSubview:self.fightBtn]; | |
| 41 | -// [self addSubview:self.planeBtn]; | |
| 32 | + [self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureClick:)]]; | |
| 42 | 33 | } |
| 43 | 34 | return self; |
| 44 | 35 | } |
| ... | ... | @@ -60,14 +51,11 @@ |
| 60 | 51 | break; |
| 61 | 52 | case BtnClickTypeGift: |
| 62 | 53 | { |
| 63 | - GiftListView *giftListView = [[GiftListView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - 200, SCREEN_WIDTH, 200)]; | |
| 64 | - giftListView.backgroundColor = [UIColor redColor]; | |
| 54 | + GiftListView *giftListView = [[GiftListView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT - 230, SCREEN_WIDTH, 230) liveBaseView:self]; | |
| 55 | + giftListView.backgroundColor = [UIColor lightGrayColor]; | |
| 65 | 56 | [self addSubview:giftListView]; |
| 66 | 57 | self.currentPopView = giftListView; |
| 67 | - | |
| 68 | - | |
| 69 | - | |
| 70 | - | |
| 58 | + | |
| 71 | 59 | } |
| 72 | 60 | break; |
| 73 | 61 | default: |
| ... | ... | @@ -93,30 +81,20 @@ |
| 93 | 81 | } |
| 94 | 82 | |
| 95 | 83 | #pragma mark - buttonClick |
| 96 | -- (void)tapGestureClick | |
| 84 | +- (void)tapGestureClick:(UITapGestureRecognizer *)gesture | |
| 97 | 85 | { |
| 98 | 86 | [self clearCurrentPopView]; |
| 99 | 87 | } |
| 100 | 88 | |
| 101 | - | |
| 102 | -- (void)porschAction | |
| 103 | -{ | |
| 104 | - [LVCGiftManager giftType:GiftTypePorsch toView:self]; | |
| 105 | -} | |
| 106 | - | |
| 107 | -- (void)fightAction | |
| 108 | -{ | |
| 109 | - [LVCGiftManager giftType:GiftTypeFighter toView:self]; | |
| 110 | -} | |
| 111 | - | |
| 112 | -- (void)planeAction | |
| 89 | +- (void)closeAction | |
| 113 | 90 | { |
| 114 | - [LVCGiftManager giftType:GiftTypePlane toView:self]; | |
| 91 | + [self.viewController.navigationController popViewControllerAnimated:YES]; | |
| 115 | 92 | } |
| 116 | 93 | |
| 117 | -- (void)closeAction | |
| 94 | +#pragma mark - setter | |
| 95 | +-(void)setViewController:(UIViewController *)viewController | |
| 118 | 96 | { |
| 119 | - | |
| 97 | + _viewController = viewController; | |
| 120 | 98 | } |
| 121 | 99 | |
| 122 | 100 | #pragma mark - getter |
| ... | ... | @@ -162,48 +140,6 @@ |
| 162 | 140 | return _closeBtn; |
| 163 | 141 | } |
| 164 | 142 | |
| 165 | -- (UIButton *)porschBtn | |
| 166 | -{ | |
| 167 | - if (!_porschBtn) | |
| 168 | - { | |
| 169 | - UIButton *porschBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 170 | - porschBtn.frame = CGRectMake(SCREEN_WIDTH - 80, 400, 80, 30); | |
| 171 | - [porschBtn setTitle:@"保时捷" forState:UIControlStateNormal]; | |
| 172 | - [porschBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | |
| 173 | - [porschBtn addTarget:self action:@selector(porschAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 174 | - _porschBtn = porschBtn; | |
| 175 | - } | |
| 176 | - return _porschBtn; | |
| 177 | -} | |
| 178 | - | |
| 179 | -- (UIButton *)fightBtn | |
| 180 | -{ | |
| 181 | - if (!_fightBtn) | |
| 182 | - { | |
| 183 | - UIButton *fightBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 184 | - fightBtn.frame = CGRectMake(SCREEN_WIDTH - 80, 450, 80, 30); | |
| 185 | - [fightBtn setTitle:@"歼灭机" forState:UIControlStateNormal]; | |
| 186 | - [fightBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | |
| 187 | - [fightBtn addTarget:self action:@selector(fightAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 188 | - _fightBtn = fightBtn; | |
| 189 | - } | |
| 190 | - return _fightBtn; | |
| 191 | -} | |
| 192 | - | |
| 193 | -- (UIButton *)planeBtn | |
| 194 | -{ | |
| 195 | - if (!_planeBtn) | |
| 196 | - { | |
| 197 | - UIButton *planeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 198 | - planeBtn.frame = CGRectMake(SCREEN_WIDTH - 80, 500, 80, 30); | |
| 199 | - [planeBtn setTitle:@"客机" forState:UIControlStateNormal]; | |
| 200 | - [planeBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | |
| 201 | - [planeBtn addTarget:self action:@selector(planeAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 202 | - _planeBtn = planeBtn; | |
| 203 | - } | |
| 204 | - return _planeBtn; | |
| 205 | -} | |
| 206 | - | |
| 207 | 143 | /* |
| 208 | 144 | // Only override drawRect: if you perform custom drawing. |
| 209 | 145 | // An empty implementation adversely affects performance during animation. | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/HomeViewController.m
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCFullScreenPlayerController.h
0 → 100644
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCFullScreenPlayerController.m
0 → 100644
| 1 | +// | |
| 2 | +// LVCFullScreenPlayerController.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by iOS on 17/3/14. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "LVCFullScreenPlayerController.h" | |
| 10 | + | |
| 11 | +@interface LVCFullScreenPlayerController () | |
| 12 | + | |
| 13 | +@end | |
| 14 | + | |
| 15 | +@implementation LVCFullScreenPlayerController | |
| 16 | + | |
| 17 | +- (UIInterfaceOrientationMask)supportedInterfaceOrientations { | |
| 18 | + return UIInterfaceOrientationMaskLandscape; | |
| 19 | +} | |
| 20 | + | |
| 21 | +- (BOOL)shouldAutorotate { | |
| 22 | + return YES; | |
| 23 | +} | |
| 24 | + | |
| 25 | +- (void)viewWillAppear:(BOOL)animated | |
| 26 | +{ | |
| 27 | + [super viewWillAppear:animated]; | |
| 28 | + | |
| 29 | + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; | |
| 30 | + [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade]; | |
| 31 | +} | |
| 32 | + | |
| 33 | +- (void)viewDidLoad { | |
| 34 | + [super viewDidLoad]; | |
| 35 | + self.view.backgroundColor = [UIColor blackColor]; | |
| 36 | + | |
| 37 | +} | |
| 38 | + | |
| 39 | +- (void)didReceiveMemoryWarning { | |
| 40 | + [super didReceiveMemoryWarning]; | |
| 41 | + // Dispose of any resources that can be recreated. | |
| 42 | +} | |
| 43 | + | |
| 44 | +/* | |
| 45 | +#pragma mark - Navigation | |
| 46 | + | |
| 47 | +// In a storyboard-based application, you will often want to do a little preparation before navigation | |
| 48 | +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
| 49 | + // Get the new view controller using [segue destinationViewController]. | |
| 50 | + // Pass the selected object to the new view controller. | |
| 51 | +} | |
| 52 | +*/ | |
| 53 | + | |
| 54 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCLivePlayerController.m
| ... | ... | @@ -8,28 +8,50 @@ |
| 8 | 8 | |
| 9 | 9 | #import "LVCLivePlayerController.h" |
| 10 | 10 | #import "LVCPlayer.h" |
| 11 | +#import "LVCFullScreenPlayerController.h" | |
| 12 | + | |
| 13 | +#define WIDTH_SCREEN [UIScreen mainScreen].bounds.size.width | |
| 14 | +#define HEIGHT_SCREEN [UIScreen mainScreen].bounds.size.height | |
| 11 | 15 | |
| 12 | 16 | @interface LVCLivePlayerController ()<LVCPlayerDelegate> |
| 13 | 17 | { |
| 14 | - BOOL isHiddenStatusBar;//记录状态的隐藏显示 | |
| 15 | - CGRect playerFrame; | |
| 18 | + BOOL isHiddenStatusBar; //记录状态的隐藏显示 | |
| 19 | + CGRect playerFrame; // | |
| 20 | + NSInteger _originalDirection; //记录原始方向 | |
| 16 | 21 | |
| 17 | 22 | |
| 18 | 23 | } |
| 19 | 24 | @property (nonatomic, strong) LVCPlayer *player; |
| 25 | +@property (nonatomic, strong) LVCFullScreenPlayerController *fullVC; | |
| 20 | 26 | |
| 21 | 27 | @end |
| 22 | 28 | |
| 23 | 29 | @implementation LVCLivePlayerController |
| 24 | 30 | |
| 31 | +- (void)viewWillAppear:(BOOL)animated | |
| 32 | +{ | |
| 33 | + [super viewWillAppear:animated]; | |
| 34 | + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; | |
| 35 | +} | |
| 36 | + | |
| 37 | +- (void)viewWillDisappear:(BOOL)animated | |
| 38 | +{ | |
| 39 | + [super viewWillDisappear:animated]; | |
| 40 | + [[UIApplication sharedApplication] setStatusBarHidden: NO withAnimation:UIStatusBarAnimationNone]; | |
| 41 | + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; | |
| 42 | +} | |
| 43 | + | |
| 25 | 44 | - (void)viewDidLoad { |
| 26 | 45 | [super viewDidLoad]; |
| 27 | 46 | |
| 47 | + self.view.backgroundColor = [UIColor whiteColor]; | |
| 48 | + | |
| 49 | + playerFrame = CGRectMake(0, 0,WIDTH_SCREEN, WIDTH_SCREEN*9/16); | |
| 50 | + _originalDirection = 0; | |
| 51 | + | |
| 52 | + //注册通知 | |
| 28 | 53 | [self addObservers]; |
| 29 | 54 | |
| 30 | - playerFrame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, ([UIScreen mainScreen].bounds.size.width)* 9 / 16); | |
| 31 | - | |
| 32 | - self.view.backgroundColor = [UIColor whiteColor]; | |
| 33 | 55 | [self.view addSubview:self.player]; |
| 34 | 56 | |
| 35 | 57 | [self makeConstraints]; |
| ... | ... | @@ -42,93 +64,84 @@ |
| 42 | 64 | name:UIDeviceOrientationDidChangeNotification |
| 43 | 65 | object:nil]; |
| 44 | 66 | |
| 67 | + | |
| 45 | 68 | } |
| 46 | 69 | |
| 47 | 70 | #pragma mark - |
| 48 | 71 | #pragma mark - Notification |
| 49 | -- (void)onDeviceOrientationChange:(NSNotification *)notification{ | |
| 50 | - | |
| 51 | - if (_player==nil||_player.superview==nil){ | |
| 52 | - return; | |
| 53 | - } | |
| 72 | +- (void)onDeviceOrientationChange:(NSNotification *)notification | |
| 73 | +{ | |
| 74 | + if (_player == nil|| _player.superview == nil) return; | |
| 54 | 75 | |
| 55 | - UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; | |
| 56 | - UIInterfaceOrientation interfaceOrientation = (UIInterfaceOrientation)orientation; | |
| 57 | - switch (interfaceOrientation) { | |
| 58 | - case UIInterfaceOrientationPortraitUpsideDown:{ | |
| 59 | - _player.isFullScreen = NO; | |
| 60 | - } | |
| 61 | - break; | |
| 62 | - case UIInterfaceOrientationPortrait:{ | |
| 63 | - [self toOrientation:UIInterfaceOrientationPortrait]; | |
| 76 | + UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; | |
| 77 | + | |
| 78 | + switch (orientation) { | |
| 79 | + case UIDeviceOrientationPortrait: | |
| 80 | + { | |
| 81 | + if (_originalDirection == 1) { | |
| 82 | + [self toHalfScreenWithrotationAngle:M_PI_2]; | |
| 83 | + } else if (_originalDirection == 2){ | |
| 84 | + [self toHalfScreenWithrotationAngle:-M_PI_2]; | |
| 85 | + } | |
| 86 | + _originalDirection = 0; | |
| 64 | 87 | _player.isFullScreen = NO; |
| 65 | 88 | } |
| 66 | 89 | break; |
| 67 | - case UIInterfaceOrientationLandscapeLeft:{ | |
| 68 | - [self toOrientation:UIInterfaceOrientationLandscapeLeft]; | |
| 69 | - _player.isFullScreen = YES; | |
| 90 | + | |
| 91 | + case UIDeviceOrientationLandscapeLeft: | |
| 92 | + { | |
| 93 | + if (_originalDirection == 0 ) { | |
| 94 | + [self toFullWithrotationAngle:-M_PI_2]; | |
| 95 | + } | |
| 96 | + _originalDirection = 1; | |
| 70 | 97 | } |
| 71 | 98 | break; |
| 72 | - case UIInterfaceOrientationLandscapeRight:{ | |
| 73 | - [self toOrientation:UIInterfaceOrientationLandscapeRight]; | |
| 74 | - _player.isFullScreen = YES; | |
| 99 | + | |
| 100 | + case UIDeviceOrientationLandscapeRight: | |
| 101 | + { | |
| 102 | + if (_originalDirection == 0 ) { | |
| 103 | + [self toFullWithrotationAngle:M_PI_2]; | |
| 104 | + } | |
| 105 | + _originalDirection = 2; | |
| 75 | 106 | } |
| 76 | 107 | break; |
| 108 | + | |
| 77 | 109 | default: |
| 78 | 110 | break; |
| 79 | 111 | } |
| 80 | 112 | } |
| 81 | 113 | |
| 82 | -#pragma mark - | |
| 83 | -#pragma mark - 屏幕旋转 | |
| 84 | --(void)toOrientation:(UIInterfaceOrientation)orientation{ | |
| 85 | - //获取到当前状态条的方向 | |
| 86 | - UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation; | |
| 87 | - //判断如果当前方向和要旋转的方向一致,那么不做任何操作 | |
| 88 | - if (currentOrientation == orientation) { | |
| 89 | - return; | |
| 90 | - } | |
| 114 | +//旋转至全屏 | |
| 115 | +- (void)toFullWithrotationAngle:(CGFloat)angle | |
| 116 | +{ | |
| 117 | + if (self.player.isFullScreen) return; | |
| 91 | 118 | |
| 92 | - //根据要旋转的方向,使用Masonry重新修改限制 | |
| 93 | - if (orientation ==UIInterfaceOrientationPortrait) {// | |
| 94 | - [_player mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 95 | - make.top.left.right.mas_equalTo(0); | |
| 96 | - make.height.equalTo(@(playerFrame.size.height)); | |
| 119 | + [self presentViewController:self.fullVC animated:NO completion:^{ | |
| 120 | + [_player removeFromSuperview]; | |
| 121 | + [self.fullVC.view addSubview:self.player]; | |
| 122 | + [self makePlayerViewConstraints:YES]; | |
| 123 | + self.player.transform = CGAffineTransformMakeRotation(angle); | |
| 124 | + [UIView animateWithDuration:0.3 animations:^{ | |
| 125 | + self.player.transform = CGAffineTransformMakeRotation(0); | |
| 97 | 126 | }]; |
| 98 | - }else{ | |
| 99 | - | |
| 100 | - if (currentOrientation ==UIInterfaceOrientationPortrait) { | |
| 101 | - [_player mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 102 | - make.width.equalTo(@([UIScreen mainScreen].bounds.size.height)); | |
| 103 | - make.height.equalTo(@([UIScreen mainScreen].bounds.size.width)); | |
| 104 | - make.center.equalTo(_player.superview); | |
| 105 | - }]; | |
| 106 | - } | |
| 107 | - } | |
| 127 | + }]; | |
| 108 | 128 | |
| 109 | - //设置状态栏方向 | |
| 110 | - [[UIApplication sharedApplication] setStatusBarOrientation:orientation animated:NO]; | |
| 129 | + self.player.isFullScreen = YES; | |
| 111 | 130 | |
| 112 | - //旋转屏幕 | |
| 113 | - [UIView beginAnimations:nil context:nil]; | |
| 114 | - _player.transform = CGAffineTransformIdentity; | |
| 115 | - _player.transform = [self getCurrentDeviceOrientation]; | |
| 116 | - [UIView setAnimationDuration:2.0]; | |
| 117 | - [UIView commitAnimations]; | |
| 118 | -} | |
| 119 | - | |
| 120 | -//获取旋转方向 | |
| 121 | -- (CGAffineTransform)getCurrentDeviceOrientation{ | |
| 122 | - UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; | |
| 123 | - //根据要进行旋转的方向来计算旋转的角度 | |
| 124 | - if (orientation ==UIInterfaceOrientationPortrait) { | |
| 125 | - return CGAffineTransformIdentity; | |
| 126 | - }else if (orientation ==UIInterfaceOrientationLandscapeLeft){ | |
| 127 | - return CGAffineTransformMakeRotation(-M_PI_2); | |
| 128 | - }else if(orientation ==UIInterfaceOrientationLandscapeRight){ | |
| 129 | - return CGAffineTransformMakeRotation(M_PI_2); | |
| 130 | - } | |
| 131 | - return CGAffineTransformIdentity; | |
| 131 | +} | |
| 132 | + | |
| 133 | +//旋转至半屏 | |
| 134 | +- (void)toHalfScreenWithrotationAngle:(CGFloat)angle | |
| 135 | +{ | |
| 136 | + [_fullVC dismissViewControllerAnimated:NO completion:^{ | |
| 137 | + [_player removeFromSuperview]; | |
| 138 | + [self.view addSubview:self.player]; | |
| 139 | + [self makePlayerViewConstraints:NO]; | |
| 140 | + self.player.transform = CGAffineTransformMakeRotation(angle); | |
| 141 | + [UIView animateWithDuration:0.3 animations:^{ | |
| 142 | + self.player.transform = CGAffineTransformMakeRotation(0); | |
| 143 | + }]; | |
| 144 | + }]; | |
| 132 | 145 | } |
| 133 | 146 | |
| 134 | 147 | #pragma mark - |
| ... | ... | @@ -136,32 +149,32 @@ |
| 136 | 149 | - (void)lvcPlayer:(LVCPlayer *)player clickedBackBtn:(UIButton *)backBtn |
| 137 | 150 | { |
| 138 | 151 | //如果是全屏返回半屏,如果是半屏直接退出 |
| 139 | - if (player.isFullScreen) { | |
| 140 | - [self toOrientation:UIInterfaceOrientationPortrait]; | |
| 141 | - player.isFullScreen = NO; | |
| 152 | + if (self.player.isFullScreen) { | |
| 153 | + [self toHalfScreenWithrotationAngle:M_PI_2]; | |
| 154 | + self.player.isFullScreen = NO; | |
| 142 | 155 | } else { |
| 156 | + [_player stopPlaying]; | |
| 143 | 157 | self.navigationController.navigationBar.hidden = NO; |
| 144 | 158 | [self.navigationController popViewControllerAnimated:YES]; |
| 145 | 159 | } |
| 146 | 160 | } |
| 147 | 161 | |
| 148 | -- (void)lvcPlayer:(LVCPlayer *)player clickedPlayOrPauseBtn:(UIButton *)playOrPauseBtn | |
| 149 | -{ | |
| 150 | - | |
| 151 | -} | |
| 152 | - | |
| 153 | 162 | - (void)lvcPlayer:(LVCPlayer *)player clickedFullScreenBtn:(UIButton *)fullScreenBtn |
| 154 | 163 | { |
| 155 | - if (player.isFullScreen == YES) {//全屏 | |
| 156 | - [self toOrientation:UIInterfaceOrientationPortrait]; | |
| 157 | - player.isFullScreen = NO; | |
| 164 | + if (self.player.isFullScreen == YES) {//全屏 | |
| 165 | + [self toHalfScreenWithrotationAngle:M_PI_2]; | |
| 166 | + self.player.isFullScreen = NO; | |
| 158 | 167 | |
| 159 | 168 | }else{//非全屏 |
| 160 | - [self toOrientation:UIInterfaceOrientationLandscapeRight]; | |
| 161 | - player.isFullScreen = YES; | |
| 169 | + [self toFullWithrotationAngle:-M_PI_2]; | |
| 162 | 170 | } |
| 163 | 171 | } |
| 164 | 172 | |
| 173 | +- (void)lvcPlayer:(LVCPlayer *)player clickedEditBtn:(UIButton *)editBtn | |
| 174 | +{ | |
| 175 | + NSLog(@"开始编辑~~~~"); | |
| 176 | +} | |
| 177 | + | |
| 165 | 178 | #pragma mark - |
| 166 | 179 | #pragma mark - makeConstraints |
| 167 | 180 | - (void)makeConstraints |
| ... | ... | @@ -172,6 +185,21 @@ |
| 172 | 185 | }]; |
| 173 | 186 | } |
| 174 | 187 | |
| 188 | +- (void)makePlayerViewConstraints:(BOOL)fullScreen | |
| 189 | +{ | |
| 190 | + if (fullScreen) { | |
| 191 | + [self.player mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 192 | + make.top.left.right.bottom.mas_equalTo(0); | |
| 193 | + }]; | |
| 194 | + | |
| 195 | + } else { | |
| 196 | + [self.player mas_remakeConstraints:^(MASConstraintMaker *make) { | |
| 197 | + make.top.left.right.mas_equalTo(0); | |
| 198 | + make.height.equalTo(@(playerFrame.size.height)); | |
| 199 | + }]; | |
| 200 | + } | |
| 201 | +} | |
| 202 | + | |
| 175 | 203 | #pragma mark - |
| 176 | 204 | #pragma mark - gatter |
| 177 | 205 | - (LVCPlayer *)player |
| ... | ... | @@ -183,6 +211,13 @@ |
| 183 | 211 | return _player; |
| 184 | 212 | } |
| 185 | 213 | |
| 214 | +- (LVCFullScreenPlayerController *)fullVC | |
| 215 | +{ | |
| 216 | + if (!_fullVC) { | |
| 217 | + _fullVC = [[LVCFullScreenPlayerController alloc] init]; | |
| 218 | + } | |
| 219 | + return _fullVC; | |
| 220 | +} | |
| 186 | 221 | - (void)didReceiveMemoryWarning { |
| 187 | 222 | [super didReceiveMemoryWarning]; |
| 188 | 223 | // Dispose of any resources that can be recreated. | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCPlayer.h
| ... | ... | @@ -15,8 +15,8 @@ |
| 15 | 15 | @optional |
| 16 | 16 | |
| 17 | 17 | - (void)lvcPlayer:(LVCPlayer *)player clickedBackBtn:(UIButton *)backBtn; //返回 |
| 18 | -- (void)lvcPlayer:(LVCPlayer *)player clickedPlayOrPauseBtn:(UIButton *)playOrPauseBtn; //播放或暂停 | |
| 19 | 18 | - (void)lvcPlayer:(LVCPlayer *)player clickedFullScreenBtn:(UIButton *)fullScreenBtn; //全屏 |
| 19 | +- (void)lvcPlayer:(LVCPlayer *)player clickedEditBtn:(UIButton *)editBtn; //全屏编辑按钮 | |
| 20 | 20 | |
| 21 | 21 | @end |
| 22 | 22 | |
| ... | ... | @@ -25,9 +25,10 @@ |
| 25 | 25 | |
| 26 | 26 | @property (nonatomic, assign) id<LVCPlayerDelegate> delegate; |
| 27 | 27 | |
| 28 | -@property (nonatomic, strong) UIView *contentView; //所有空间统一管理在这个view中 | |
| 28 | +@property (nonatomic, strong) UIImageView *contentView; //所有空间统一管理在这个view中 | |
| 29 | 29 | @property (nonatomic, strong) UIButton *backBtn; //返回 |
| 30 | +@property (nonatomic, assign) BOOL isFullScreen; //是否是全屏 | |
| 30 | 31 | |
| 31 | -@property (nonatomic, assign) BOOL isFullScreen; //是否是全屏 | |
| 32 | +- (void)stopPlaying; | |
| 32 | 33 | |
| 33 | 34 | @end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCPlayer.m
| ... | ... | @@ -7,16 +7,27 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "LVCPlayer.h" |
| 10 | +#import "LVCPlayerLoadingView.h" | |
| 11 | +#import "SevenSwitch.h" | |
| 10 | 12 | |
| 11 | -@interface LVCPlayer () | |
| 13 | +#define kAppId @"60_irn9edco29" | |
| 14 | +#define kAppKey @"69fe70bda67e059286ad509d9f5377f815955645b52f94" | |
| 15 | +#define kbundleId @"com.cnlive.zhangxu.LiveVideoCloud" | |
| 12 | 16 | |
| 17 | +@interface LVCPlayer () | |
| 18 | +{ | |
| 19 | + BOOL _isFull; | |
| 20 | +} | |
| 13 | 21 | @property (nonatomic, strong) UIImageView *topBgView; //顶部蒙版 |
| 14 | 22 | @property (nonatomic, strong) UIImageView *bottomBgView; //底部蒙版 |
| 15 | 23 | @property (nonatomic, strong) UIButton *playOrPauseBtn; //播放/暂停 |
| 16 | 24 | @property (nonatomic, strong) UILabel *titleLab; //标题 |
| 17 | 25 | @property (nonatomic, strong) UIButton *fullScreenBtn; //控制全屏按钮 |
| 18 | -@property (nonatomic, strong) UIGestureRecognizer *singleTap; //单击手势 | |
| 19 | -@property (nonatomic, strong) UIActivityIndicatorView *loadingView; //加载图 | |
| 26 | +@property (nonatomic, strong) UITapGestureRecognizer *singleTap; //单击手势 | |
| 27 | +@property (nonatomic, strong) LVCPlayerLoadingView *loadingView; //加载图 | |
| 28 | +@property (nonatomic, strong) CNLiveMoviePlayerController *player; | |
| 29 | +@property (nonatomic, strong) SevenSwitch *barrageSwitch; //弹幕开关 | |
| 30 | +@property (nonatomic, strong) UIButton *editBtn; //全屏编辑按钮 | |
| 20 | 31 | @end |
| 21 | 32 | |
| 22 | 33 | @implementation LVCPlayer |
| ... | ... | @@ -26,27 +37,62 @@ |
| 26 | 37 | self = [super initWithFrame:frame]; |
| 27 | 38 | if (self) { |
| 28 | 39 | |
| 40 | + [self initPlayer]; | |
| 41 | + | |
| 29 | 42 | [self addSubview:self.contentView]; |
| 30 | 43 | [self.contentView addSubview:self.bottomBgView]; |
| 31 | 44 | [self.contentView addSubview:self.topBgView]; |
| 32 | 45 | [self.bottomBgView addSubview:self.playOrPauseBtn]; |
| 33 | 46 | [self.bottomBgView addSubview:self.fullScreenBtn]; |
| 34 | 47 | [self.topBgView addSubview:self.titleLab]; |
| 35 | - [self.topBgView addSubview:self.backBtn]; | |
| 48 | + [self.topBgView addSubview:self.barrageSwitch]; | |
| 49 | + [self addSubview:self.backBtn]; | |
| 36 | 50 | [self.contentView addSubview:self.loadingView]; |
| 51 | + [self.contentView addSubview:self.editBtn]; | |
| 52 | + [self.contentView addGestureRecognizer:self.singleTap]; | |
| 53 | + | |
| 37 | 54 | [self makeSubViewsConstraints]; |
| 38 | 55 | |
| 39 | 56 | } |
| 40 | 57 | return self; |
| 41 | 58 | } |
| 59 | +#pragma mark - | |
| 60 | +#pragma mark - initPlayer | |
| 61 | +- (void)initPlayer | |
| 62 | +{ | |
| 63 | + [[CNLiveWebcastManager manager] initWithAppId:kAppId appKey:kAppKey]; | |
| 64 | + //点播播放 | |
| 65 | + _player = [[CNLiveMoviePlayerController alloc] initVodPlayWithVId:@"aaa123" | |
| 66 | + authSuccess:^{ | |
| 67 | + | |
| 68 | + [self addObservers]; | |
| 69 | + _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO; | |
| 70 | + _player.shouldAutoplay = YES; | |
| 71 | + [_player prepareToPlay]; | |
| 72 | + [self.contentView addSubview:_player.view]; | |
| 73 | + [self.contentView sendSubviewToBack:_player.view]; | |
| 74 | + | |
| 75 | + [self makePlayerConstraint]; | |
| 76 | + | |
| 77 | + | |
| 78 | + } authFailed:^(NSDictionary *errorInfo) { | |
| 79 | + NSLog(@"初始化点播播放器失败%@", errorInfo); | |
| 80 | + | |
| 81 | + }]; | |
| 82 | +} | |
| 42 | 83 | |
| 43 | 84 | #pragma mark - |
| 44 | 85 | #pragma mark - action |
| 45 | 86 | - (void)playOrPauseBtnAction:(UIButton *)btn |
| 46 | 87 | { |
| 47 | - if (self.delegate && [self.delegate respondsToSelector:@selector(lvcPlayer:clickedPlayOrPauseBtn:)]) { | |
| 48 | - [self.delegate lvcPlayer:self clickedPlayOrPauseBtn:btn]; | |
| 88 | + if (btn.selected) { | |
| 89 | + [_player pause]; | |
| 90 | + } else { | |
| 91 | + [_player play]; | |
| 49 | 92 | } |
| 93 | + | |
| 94 | + btn.selected =! btn.selected; | |
| 95 | + | |
| 50 | 96 | } |
| 51 | 97 | |
| 52 | 98 | - (void)backBtnAction:(UIButton *)btn |
| ... | ... | @@ -64,24 +110,238 @@ |
| 64 | 110 | |
| 65 | 111 | } |
| 66 | 112 | |
| 113 | +- (void)singleTapView | |
| 114 | +{ | |
| 115 | + [UIView animateWithDuration:0.25 animations:^{ | |
| 116 | + self.topBgView.alpha = self.topBgView.alpha == 0 ? 1 : 0; | |
| 117 | + self.bottomBgView.alpha = self.bottomBgView.alpha == 0 ? 1 : 0; | |
| 118 | + self.editBtn.alpha = self.editBtn.alpha == 0 ? 1 : 0; | |
| 119 | + }]; | |
| 120 | + [[UIApplication sharedApplication] setStatusBarHidden:self.topBgView.alpha == 0 ? YES : NO withAnimation:UIStatusBarAnimationFade]; | |
| 121 | + | |
| 122 | +} | |
| 123 | + | |
| 124 | +- (void)barrageSwitchAction | |
| 125 | +{ | |
| 126 | + NSString *string = self.barrageSwitch.on ? @"已开启弹幕" : @"已关闭弹幕"; | |
| 127 | + | |
| 128 | + NSLog(@"%@",string); | |
| 129 | +} | |
| 130 | + | |
| 131 | +- (void)editBtnAction:(UIButton *)btn | |
| 132 | +{ | |
| 133 | + if (self.delegate && [self.delegate respondsToSelector:@selector(lvcPlayer:clickedEditBtn:)]) { | |
| 134 | + [self.delegate lvcPlayer:self clickedEditBtn:btn]; | |
| 135 | + } | |
| 136 | +} | |
| 137 | + | |
| 67 | 138 | #pragma mark - |
| 68 | -#pragma mark - setter | |
| 139 | +#pragma mark - Notification | |
| 140 | +- (void)addObservers | |
| 141 | +{ | |
| 142 | + //视频加载状态改变 | |
| 143 | + [[NSNotificationCenter defaultCenter] addObserver:self | |
| 144 | + selector:@selector(loadStateDidChange:) | |
| 145 | + name:MPMoviePlayerLoadStateDidChangeNotification | |
| 146 | + object:nil]; | |
| 147 | + | |
| 148 | + //视频播放错误及结束原因 | |
| 149 | + [[NSNotificationCenter defaultCenter] addObserver:self | |
| 150 | + selector:@selector(moviePlayBackDidFinish:) | |
| 151 | + name:MPMoviePlayerPlaybackDidFinishNotification | |
| 152 | + object:nil]; | |
| 153 | + | |
| 154 | + //视频缓冲至可播放状态 | |
| 155 | + [[NSNotificationCenter defaultCenter] addObserver:self | |
| 156 | + selector:@selector(mediaIsPreparedToPlayDidChange:) | |
| 157 | + name:MPMediaPlaybackIsPreparedToPlayDidChangeNotification | |
| 158 | + object:nil]; | |
| 159 | + | |
| 160 | + //视频播放状态改变 | |
| 161 | + [[NSNotificationCenter defaultCenter] addObserver:self | |
| 162 | + selector:@selector(moviePlayBackStateDidChange:) | |
| 163 | + name:MPMoviePlayerPlaybackStateDidChangeNotification | |
| 164 | + object:nil]; | |
| 165 | + | |
| 166 | + [[NSNotificationCenter defaultCenter] addObserver:self | |
| 167 | + selector:@selector(appResignActive:) | |
| 168 | + name:UIApplicationWillResignActiveNotification | |
| 169 | + object:nil]; | |
| 170 | + | |
| 171 | + [[NSNotificationCenter defaultCenter] addObserver:self | |
| 172 | + selector:@selector(appBecomeActive:) | |
| 173 | + name:UIApplicationDidBecomeActiveNotification | |
| 174 | + object:nil]; | |
| 175 | +} | |
| 176 | + | |
| 177 | +- (void)loadStateDidChange:(NSNotification *)notification | |
| 178 | +{ | |
| 179 | + if (_player) { | |
| 180 | + MPMovieLoadState loadState = _player.loadState; | |
| 181 | + if ((loadState & MPMovieLoadStatePlaythroughOK) != 0) { | |
| 182 | + NSLog(@"loadStateDidChange: MPMovieLoadStatePlaythroughOK: %d\n", (int)loadState); | |
| 183 | + | |
| 184 | + } else if ((loadState & MPMovieLoadStateStalled) != 0) { | |
| 185 | + NSLog(@"loadStateDidChange: MPMovieLoadStateStalled: %d\n", (int)loadState); | |
| 186 | + | |
| 187 | + } else { | |
| 188 | + NSLog(@"loadStateDidChange: ???: %d\n", (int)loadState); | |
| 189 | + } | |
| 190 | + } | |
| 191 | +} | |
| 192 | + | |
| 193 | +- (void)moviePlayBackDidFinish:(NSNotification *)notification | |
| 194 | +{ | |
| 195 | + if (_player) { | |
| 196 | + int reason = [[[notification userInfo] valueForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] intValue]; | |
| 197 | + if (MPMovieFinishReasonPlaybackError == reason) { | |
| 198 | + } else { | |
| 199 | +// _loadingView.retryBtn.hidden = YES; | |
| 200 | + } | |
| 201 | + | |
| 202 | + switch (reason) | |
| 203 | + { | |
| 204 | + case MPMovieFinishReasonPlaybackEnded: | |
| 205 | + NSLog(@"playbackStateDidChange: MPMovieFinishReasonPlaybackEnded: %d\n", reason); | |
| 206 | + break; | |
| 207 | + | |
| 208 | + case MPMovieFinishReasonUserExited: | |
| 209 | + NSLog(@"playbackStateDidChange: MPMovieFinishReasonUserExited: %d\n", reason); | |
| 210 | + break; | |
| 211 | + | |
| 212 | + case MPMovieFinishReasonPlaybackError: | |
| 213 | + NSLog(@"playbackStateDidChange: MPMovieFinishReasonPlaybackError: %d\n", reason); | |
| 214 | + break; | |
| 215 | + | |
| 216 | + default: | |
| 217 | + NSLog(@"playbackPlayBackDidFinish: ???: %d\n", reason); | |
| 218 | + break; | |
| 219 | + } | |
| 220 | + } | |
| 221 | +} | |
| 222 | + | |
| 223 | +- (void)mediaIsPreparedToPlayDidChange:(NSNotification *)notification | |
| 224 | +{ | |
| 225 | + if (_player) { | |
| 226 | + NSLog(@"isPreparedToPlay"); | |
| 227 | + } | |
| 228 | +} | |
| 229 | + | |
| 230 | +- (void)moviePlayBackStateDidChange:(NSNotification *)notification | |
| 231 | +{ | |
| 232 | + if (_player) { | |
| 233 | + | |
| 234 | + if (_player.playbackState == MPMoviePlaybackStatePlaying) { | |
| 235 | + _playOrPauseBtn.selected = YES; | |
| 236 | + [self.loadingView retry]; | |
| 237 | + } else { | |
| 238 | + _playOrPauseBtn.selected = NO; | |
| 239 | + } | |
| 240 | + | |
| 241 | + NSLog(@"moviePlayBackStateDidChange : %ld",(long)_player.playbackState); | |
| 242 | + | |
| 243 | + /* | |
| 244 | + switch (_player.playbackState) { | |
| 245 | + case MPMoviePlaybackStateStopped: { | |
| 246 | + | |
| 247 | + [self changePlayBtnStatus:NO]; | |
| 248 | + NSLog(@"moviePlayBackStateDidChange : MPMoviePlaybackStateStopped"); | |
| 249 | + break; | |
| 250 | + } | |
| 251 | + case MPMoviePlaybackStatePlaying: { | |
| 252 | + [self changePlayBtnStatus:YES]; | |
| 253 | + NSLog(@"moviePlayBackStateDidChange : MPMoviePlaybackStatePlaying"); | |
| 254 | + break; | |
| 255 | + } | |
| 256 | + case MPMoviePlaybackStatePaused: | |
| 257 | + [self changePlayBtnStatus:NO]; | |
| 258 | + NSLog(@"moviePlayBackStateDidChange : MPMoviePlaybackStatePaused"); | |
| 259 | + break; | |
| 260 | + case MPMoviePlaybackStateInterrupted: | |
| 261 | + [self changePlayBtnStatus:NO]; | |
| 262 | + NSLog(@"moviePlayBackStateDidChange : MPMoviePlaybackStateInterrupted"); | |
| 263 | + break; | |
| 264 | + case MPMoviePlaybackStateSeekingForward: | |
| 265 | + [self changePlayBtnStatus:NO]; | |
| 266 | + NSLog(@"moviePlayBackStateDidChange : MPMoviePlaybackStateSeekingForward"); | |
| 267 | + break; | |
| 268 | + case MPMoviePlaybackStateSeekingBackward: | |
| 269 | + [self changePlayBtnStatus:NO]; | |
| 270 | + NSLog(@"moviePlayBackStateDidChange : MPMoviePlaybackStateSeekingBackward"); | |
| 271 | + break; | |
| 272 | + default: | |
| 273 | + [self changePlayBtnStatus:NO]; | |
| 274 | + NSLog(@"moviePlayBackStateDidChange : %ld", _player.playbackState); | |
| 275 | + break; | |
| 276 | + } | |
| 277 | + */ | |
| 278 | + } | |
| 279 | +} | |
| 280 | + | |
| 281 | +- (void)appResignActive:(NSNotification *)noti | |
| 282 | +{ | |
| 283 | + [_player pause]; | |
| 284 | +} | |
| 285 | + | |
| 286 | +- (void)appBecomeActive:(NSNotification *)noti | |
| 287 | +{ | |
| 288 | + [_player play]; | |
| 289 | +} | |
| 69 | 290 | |
| 291 | +#pragma mark - | |
| 292 | +#pragma mark - public | |
| 293 | +- (void)stopPlaying | |
| 294 | +{ | |
| 295 | + if (_player.isPlaying) { | |
| 296 | + [_player stop]; | |
| 297 | + } | |
| 298 | + _player = nil; | |
| 299 | + [self removeMovieNotificationObservers]; | |
| 300 | +} | |
| 301 | + | |
| 302 | +- (void)removeMovieNotificationObservers | |
| 303 | +{ | |
| 304 | + [[NSNotificationCenter defaultCenter]removeObserver:self | |
| 305 | + name:MPMoviePlayerLoadStateDidChangeNotification | |
| 306 | + object:nil]; | |
| 307 | + [[NSNotificationCenter defaultCenter]removeObserver:self | |
| 308 | + name:MPMoviePlayerPlaybackDidFinishNotification | |
| 309 | + object:nil]; | |
| 310 | + [[NSNotificationCenter defaultCenter]removeObserver:self | |
| 311 | + name:MPMediaPlaybackIsPreparedToPlayDidChangeNotification | |
| 312 | + object:nil]; | |
| 313 | + [[NSNotificationCenter defaultCenter]removeObserver:self | |
| 314 | + name:MPMoviePlayerPlaybackStateDidChangeNotification | |
| 315 | + object:nil]; | |
| 316 | +} | |
| 317 | + | |
| 318 | +#pragma mark - | |
| 319 | +#pragma mark - makeConstraints | |
| 320 | +- (void)makePlayerConstraint | |
| 321 | +{ | |
| 322 | + [self.player.view mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 323 | + make.width.equalTo(self.contentView); | |
| 324 | + make.height.equalTo(self.contentView); | |
| 325 | + make.center.equalTo(self.contentView); | |
| 326 | + }]; | |
| 327 | +} | |
| 70 | 328 | |
| 71 | 329 | - (void)makeSubViewsConstraints |
| 72 | 330 | { |
| 331 | + | |
| 73 | 332 | [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { |
| 74 | 333 | make.top.left.right.bottom.mas_equalTo(0); |
| 75 | 334 | }]; |
| 76 | 335 | |
| 77 | 336 | [self.loadingView mas_makeConstraints:^(MASConstraintMaker *make) { |
| 78 | 337 | make.center.equalTo(self.contentView); |
| 338 | + make.width.mas_equalTo(100); | |
| 339 | + make.height.mas_equalTo(80); | |
| 79 | 340 | }]; |
| 80 | - | |
| 341 | + | |
| 81 | 342 | [self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
| 82 | 343 | make.left.equalTo(self.topBgView).with.offset(5); |
| 83 | - make.height.mas_equalTo(30); | |
| 84 | - make.width.mas_equalTo(30); | |
| 344 | + make.width.height.mas_equalTo(30); | |
| 85 | 345 | make.top.equalTo(self.topBgView).with.offset(20); |
| 86 | 346 | }]; |
| 87 | 347 | |
| ... | ... | @@ -90,41 +350,55 @@ |
| 90 | 350 | make.height.mas_equalTo(70); |
| 91 | 351 | }]; |
| 92 | 352 | |
| 353 | + [self.barrageSwitch mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 354 | + make.width.mas_equalTo(35); | |
| 355 | + make.height.mas_equalTo(20); | |
| 356 | + make.top.mas_equalTo(20); | |
| 357 | + make.right.equalTo(self.topBgView).offset(-60); | |
| 358 | + }]; | |
| 359 | + | |
| 93 | 360 | [self.bottomBgView mas_makeConstraints:^(MASConstraintMaker *make) { |
| 94 | 361 | make.bottom.left.right.equalTo(self.contentView).with.offset(0); |
| 95 | 362 | make.height.mas_equalTo(50); |
| 96 | 363 | }]; |
| 97 | 364 | |
| 98 | 365 | [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { |
| 99 | - make.leading.trailing.bottom.mas_equalTo(0); | |
| 100 | - make.height.mas_equalTo(40); | |
| 366 | + make.left.equalTo(self.backBtn).offset(40); | |
| 367 | + make.top.trailing.bottom.mas_equalTo(0); | |
| 101 | 368 | }]; |
| 102 | 369 | |
| 103 | 370 | [self.playOrPauseBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
| 104 | - make.left.equalTo(self.bottomBgView).with.offset(0); | |
| 105 | - make.height.mas_equalTo(50); | |
| 106 | - make.bottom.equalTo(self.bottomBgView).with.offset(0); | |
| 107 | - make.width.mas_equalTo(50); | |
| 371 | + make.left.bottom.equalTo(self.bottomBgView).with.offset(0); | |
| 372 | + make.width.height.mas_equalTo(50); | |
| 108 | 373 | }]; |
| 109 | 374 | |
| 110 | 375 | [self.fullScreenBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
| 111 | - make.right.equalTo(self.bottomBgView).with.offset(0); | |
| 112 | - make.height.mas_equalTo(50); | |
| 113 | - make.bottom.equalTo(self.bottomBgView).with.offset(0); | |
| 114 | - make.width.mas_equalTo(50); | |
| 115 | - | |
| 376 | + make.right.bottom.equalTo(self.bottomBgView).with.offset(0); | |
| 377 | + make.width.height.mas_equalTo(50); | |
| 378 | + }]; | |
| 379 | + | |
| 380 | + [self.editBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 381 | + make.width.height.mas_equalTo(40); | |
| 382 | + make.centerY.equalTo(self.contentView); | |
| 383 | + make.right.equalTo(self.contentView).with.offset(-20); | |
| 116 | 384 | }]; |
| 117 | 385 | |
| 118 | 386 | } |
| 119 | 387 | |
| 120 | 388 | #pragma mark - |
| 389 | +#pragma mark - setter | |
| 390 | + | |
| 391 | + | |
| 392 | +#pragma mark - | |
| 121 | 393 | #pragma mark - getter |
| 122 | 394 | |
| 123 | -- (UIView *)contentView | |
| 395 | +- (UIImageView *)contentView | |
| 124 | 396 | { |
| 125 | 397 | if (!_contentView) { |
| 126 | - _contentView = [[UIView alloc] init]; | |
| 127 | - _contentView.backgroundColor = [UIColor blueColor]; | |
| 398 | + _contentView = [[UIImageView alloc] init]; | |
| 399 | + _contentView.image = [UIImage imageNamed:@""]; | |
| 400 | + _contentView.backgroundColor = [UIColor lightGrayColor]; | |
| 401 | + _contentView.userInteractionEnabled = YES; | |
| 128 | 402 | } |
| 129 | 403 | return _contentView; |
| 130 | 404 | } |
| ... | ... | @@ -153,8 +427,8 @@ |
| 153 | 427 | { |
| 154 | 428 | if (!_playOrPauseBtn) { |
| 155 | 429 | _playOrPauseBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 156 | - [_playOrPauseBtn setImage:[UIImage imageNamed:@"pause"] forState:UIControlStateNormal]; | |
| 157 | - [_playOrPauseBtn setImage:[UIImage imageNamed:@"play"] forState:UIControlStateSelected]; | |
| 430 | + [_playOrPauseBtn setImage:[UIImage imageNamed:@"play"] forState:UIControlStateNormal]; | |
| 431 | + [_playOrPauseBtn setImage:[UIImage imageNamed:@"pause"] forState:UIControlStateSelected]; | |
| 158 | 432 | [_playOrPauseBtn addTarget:self action:@selector(playOrPauseBtnAction:) forControlEvents:UIControlEventTouchUpInside]; |
| 159 | 433 | } |
| 160 | 434 | return _playOrPauseBtn; |
| ... | ... | @@ -164,8 +438,9 @@ |
| 164 | 438 | { |
| 165 | 439 | if (!_titleLab) { |
| 166 | 440 | _titleLab = [[UILabel alloc] init]; |
| 441 | + _titleLab.text = @"我是标题~~"; | |
| 167 | 442 | _titleLab.textColor = [UIColor whiteColor]; |
| 168 | - _titleLab.font = [UIFont systemFontOfSize:15]; | |
| 443 | + _titleLab.font = [UIFont systemFontOfSize:17]; | |
| 169 | 444 | } |
| 170 | 445 | return _titleLab; |
| 171 | 446 | } |
| ... | ... | @@ -185,21 +460,53 @@ |
| 185 | 460 | { |
| 186 | 461 | if (!_backBtn) { |
| 187 | 462 | _backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; |
| 188 | - [_backBtn setImage:[UIImage imageNamed:@"返回"] forState:UIControlStateNormal]; | |
| 463 | + [_backBtn setImage:[UIImage imageNamed:@"play_back"] forState:UIControlStateNormal]; | |
| 189 | 464 | [_backBtn addTarget:self action:@selector(backBtnAction:) forControlEvents:UIControlEventTouchUpInside]; |
| 190 | 465 | } |
| 191 | 466 | return _backBtn; |
| 192 | 467 | } |
| 193 | 468 | |
| 194 | -- (UIActivityIndicatorView *)loadingView | |
| 469 | +- (LVCPlayerLoadingView *)loadingView | |
| 195 | 470 | { |
| 196 | 471 | if (!_loadingView) { |
| 197 | - _loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; | |
| 198 | - [_loadingView startAnimating]; | |
| 472 | + _loadingView = [[LVCPlayerLoadingView alloc] init]; | |
| 199 | 473 | } |
| 200 | 474 | return _loadingView; |
| 201 | 475 | } |
| 202 | 476 | |
| 477 | +- (UITapGestureRecognizer *)singleTap | |
| 478 | +{ | |
| 479 | + if (!_singleTap) { | |
| 480 | + _singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapView)]; | |
| 481 | + } | |
| 482 | + return _singleTap; | |
| 483 | +} | |
| 484 | + | |
| 485 | +- (SevenSwitch *)barrageSwitch { //弹幕开关 | |
| 486 | + if (!_barrageSwitch) { | |
| 487 | + _barrageSwitch = [[SevenSwitch alloc] init]; | |
| 488 | + _barrageSwitch.knobOnImage = [UIImage imageNamed:@"弹off"]; | |
| 489 | + _barrageSwitch.knobOffImage = [UIImage imageNamed:@"弹off"]; | |
| 490 | + _barrageSwitch.onColor = [UIColor yellowColorZX]; | |
| 491 | + _barrageSwitch.borderColor = [UIColor blackColor]; | |
| 492 | + _barrageSwitch.activeColor = [UIColor blackColor]; | |
| 493 | + _barrageSwitch.inactiveColor = [UIColor blackColor]; | |
| 494 | + _barrageSwitch.on = YES; | |
| 495 | +// _barrageSwitch.hidden = YES; | |
| 496 | + [_barrageSwitch addTarget:self action:@selector(barrageSwitchAction) forControlEvents:UIControlEventValueChanged]; | |
| 497 | + } | |
| 498 | + return _barrageSwitch; | |
| 499 | +} | |
| 500 | + | |
| 501 | +- (UIButton *)editBtn | |
| 502 | +{ | |
| 503 | + if (!_editBtn) { | |
| 504 | + _editBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 505 | + [_editBtn setImage:[UIImage imageNamed:@"Barrage input"] forState:UIControlStateNormal]; | |
| 506 | + [_editBtn addTarget:self action:@selector(editBtnAction:) forControlEvents:UIControlEventTouchUpInside]; | |
| 507 | + } | |
| 508 | + return _editBtn; | |
| 509 | +} | |
| 203 | 510 | |
| 204 | 511 | /* |
| 205 | 512 | // Only override drawRect: if you perform custom drawing. | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCPlayerLoadingView.h
0 → 100644
| 1 | +// | |
| 2 | +// LVCPlayerLoadingView.h | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by iOS on 17/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import <UIKit/UIKit.h> | |
| 10 | + | |
| 11 | +@protocol LVCPlayerLoadingViewDelegate <NSObject> | |
| 12 | + | |
| 13 | +- (void)retryBtnClick; //点击重试 | |
| 14 | + | |
| 15 | +@end | |
| 16 | + | |
| 17 | +@interface LVCPlayerLoadingView : UIView | |
| 18 | + | |
| 19 | +@property (nonatomic, assign) id<LVCPlayerLoadingViewDelegate> delegate; | |
| 20 | + | |
| 21 | +- (void)startLoading; //开始加载 | |
| 22 | + | |
| 23 | +- (void)stopLoading; //停止加载 | |
| 24 | + | |
| 25 | +- (void)retry; | |
| 26 | + | |
| 27 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCPlayerLoadingView.m
0 → 100644
| 1 | +// | |
| 2 | +// LVCPlayerLoadingView.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by iOS on 17/3/15. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "LVCPlayerLoadingView.h" | |
| 10 | + | |
| 11 | +@interface LVCPlayerLoadingView () | |
| 12 | + | |
| 13 | +@property (nonatomic, strong) UIActivityIndicatorView *loadingView; | |
| 14 | +@property (nonatomic, strong) UILabel *loadingLab; | |
| 15 | +@property (nonatomic, strong) UIButton *retryBtn; | |
| 16 | + | |
| 17 | +@end | |
| 18 | + | |
| 19 | +@implementation LVCPlayerLoadingView | |
| 20 | + | |
| 21 | +- (instancetype)initWithFrame:(CGRect)frame | |
| 22 | +{ | |
| 23 | + self = [super initWithFrame:frame]; | |
| 24 | + if (self) { | |
| 25 | + [self addSubview:self.loadingView]; | |
| 26 | + [self addSubview:self.loadingLab]; | |
| 27 | + [self addSubview:self.retryBtn]; | |
| 28 | + | |
| 29 | + [self makeSubViewsConstraints]; | |
| 30 | + [self.loadingView startAnimating]; | |
| 31 | + | |
| 32 | + } | |
| 33 | + return self; | |
| 34 | +} | |
| 35 | + | |
| 36 | +#pragma mark - | |
| 37 | +#pragma mark - public methods | |
| 38 | + | |
| 39 | +- (void)startLoading | |
| 40 | +{ | |
| 41 | + [self.loadingView startAnimating]; | |
| 42 | + _loadingLab.hidden = NO; | |
| 43 | + self.retryBtn.hidden = YES; | |
| 44 | + self.hidden = NO; | |
| 45 | +} | |
| 46 | + | |
| 47 | +- (void)stopLoading | |
| 48 | +{ | |
| 49 | + [self.loadingView stopAnimating]; | |
| 50 | + self.hidden = YES; | |
| 51 | +} | |
| 52 | + | |
| 53 | +- (void)retry | |
| 54 | +{ | |
| 55 | + _retryBtn.hidden = NO; | |
| 56 | + [_loadingView stopAnimating]; | |
| 57 | + _loadingLab.hidden = YES; | |
| 58 | +} | |
| 59 | + | |
| 60 | +#pragma mark - | |
| 61 | +#pragma mark - action | |
| 62 | +- (void)retryBtnAction | |
| 63 | +{ | |
| 64 | + [self startLoading]; | |
| 65 | + if (self.delegate && [self.delegate respondsToSelector:@selector(retryBtnClick)]) { | |
| 66 | + [self.delegate retryBtnClick]; | |
| 67 | + } | |
| 68 | +} | |
| 69 | + | |
| 70 | +#pragma mark - | |
| 71 | +#pragma mark - makeSubViewsConstraints | |
| 72 | +- (void)makeSubViewsConstraints | |
| 73 | +{ | |
| 74 | + | |
| 75 | + [self.loadingView mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 76 | + make.centerX.mas_equalTo(self.width/2); | |
| 77 | + make.top.mas_equalTo(0); | |
| 78 | + }]; | |
| 79 | + | |
| 80 | + [self.loadingLab mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 81 | + make.left.mas_equalTo(0); | |
| 82 | + make.top.mas_equalTo(40); | |
| 83 | + make.width.equalTo(self); | |
| 84 | + make.height.mas_equalTo(40); | |
| 85 | + }]; | |
| 86 | + | |
| 87 | + [self.retryBtn mas_makeConstraints:^(MASConstraintMaker *make) { | |
| 88 | + make.width.mas_equalTo(70); | |
| 89 | + make.height.mas_equalTo(40); | |
| 90 | + make.center.equalTo(self); | |
| 91 | + }]; | |
| 92 | + | |
| 93 | +} | |
| 94 | + | |
| 95 | +#pragma mark - | |
| 96 | +#pragma mark - getter | |
| 97 | + | |
| 98 | +- (UIActivityIndicatorView *)loadingView | |
| 99 | +{ | |
| 100 | + if (!_loadingView) { | |
| 101 | + _loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; | |
| 102 | + } | |
| 103 | + return _loadingView; | |
| 104 | +} | |
| 105 | + | |
| 106 | +- (UILabel *)loadingLab | |
| 107 | +{ | |
| 108 | + if (!_loadingLab) { | |
| 109 | + _loadingLab = [[UILabel alloc] init]; | |
| 110 | + _loadingLab.text = @"努力加载中..."; | |
| 111 | + _loadingLab.textColor = [UIColor whiteColor]; | |
| 112 | + _loadingLab.textAlignment = NSTextAlignmentCenter; | |
| 113 | + } | |
| 114 | + return _loadingLab; | |
| 115 | +} | |
| 116 | + | |
| 117 | +- (UIButton *)retryBtn | |
| 118 | +{ | |
| 119 | + if (!_retryBtn) { | |
| 120 | + _retryBtn = [UIButton buttonWithType:UIButtonTypeCustom]; | |
| 121 | + [_retryBtn setTitle:@"重试" forState:UIControlStateNormal]; | |
| 122 | + [_retryBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; | |
| 123 | + _retryBtn.hidden = YES; | |
| 124 | + _retryBtn.layer.cornerRadius = 10; | |
| 125 | + _retryBtn.layer.masksToBounds = YES; | |
| 126 | + _retryBtn.layer.borderColor = [UIColor blackColor].CGColor; | |
| 127 | + _retryBtn.layer.borderWidth = 1; | |
| 128 | + [_retryBtn addTarget:self action:@selector(retryBtnAction) forControlEvents:UIControlEventTouchUpInside]; | |
| 129 | + } | |
| 130 | + return _retryBtn; | |
| 131 | +} | |
| 132 | + | |
| 133 | +/* | |
| 134 | +// Only override drawRect: if you perform custom drawing. | |
| 135 | +// An empty implementation adversely affects performance during animation. | |
| 136 | +- (void)drawRect:(CGRect)rect { | |
| 137 | + // Drawing code | |
| 138 | +} | |
| 139 | +*/ | |
| 140 | + | |
| 141 | +@end | ... | ... |
LiveVideoCloud/LiveVideoCloud/Info.plist
| ... | ... | @@ -2,15 +2,8 @@ |
| 2 | 2 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 3 | 3 | <plist version="1.0"> |
| 4 | 4 | <dict> |
| 5 | - <key>NSAppTransportSecurity</key> | |
| 6 | - <dict> | |
| 7 | - <key>NSAllowsArbitraryLoads</key> | |
| 8 | - <true/> | |
| 9 | - </dict> | |
| 10 | - <key>NSCameraUsageDescription</key> | |
| 11 | - <string></string> | |
| 12 | - <key>NSMicrophoneUsageDescription</key> | |
| 13 | - <string></string> | |
| 5 | + <key>UIViewControllerBasedStatusBarAppearance</key> | |
| 6 | + <false/> | |
| 14 | 7 | <key>CFBundleDevelopmentRegion</key> |
| 15 | 8 | <string>en</string> |
| 16 | 9 | <key>CFBundleExecutable</key> |
| ... | ... | @@ -29,16 +22,25 @@ |
| 29 | 22 | <string>1</string> |
| 30 | 23 | <key>LSRequiresIPhoneOS</key> |
| 31 | 24 | <true/> |
| 25 | + <key>NSAppTransportSecurity</key> | |
| 26 | + <dict> | |
| 27 | + <key>NSAllowsArbitraryLoads</key> | |
| 28 | + <true/> | |
| 29 | + </dict> | |
| 30 | + <key>NSCameraUsageDescription</key> | |
| 31 | + <string></string> | |
| 32 | + <key>NSMicrophoneUsageDescription</key> | |
| 33 | + <string></string> | |
| 32 | 34 | <key>UILaunchStoryboardName</key> |
| 33 | 35 | <string>LaunchScreen</string> |
| 34 | - <key>UIMainStoryboardFile</key> | |
| 35 | - <string>Main</string> | |
| 36 | 36 | <key>UIRequiredDeviceCapabilities</key> |
| 37 | 37 | <array> |
| 38 | 38 | <string>armv7</string> |
| 39 | 39 | </array> |
| 40 | 40 | <key>UISupportedInterfaceOrientations</key> |
| 41 | 41 | <array> |
| 42 | + <string>UIInterfaceOrientationLandscapeLeft</string> | |
| 43 | + <string>UIInterfaceOrientationLandscapeRight</string> | |
| 42 | 44 | <string>UIInterfaceOrientationPortrait</string> |
| 43 | 45 | </array> |
| 44 | 46 | <key>UISupportedInterfaceOrientations~ipad</key> | ... | ... |
LiveVideoCloud/LiveVideoCloud/PrefixHeader.pch
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/littleHeart.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "littleHeart.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/littleHeart.imageset/littleHeart.png
0 → 100644
1009 Bytes
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/littleHeart1.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "littleHeart1.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/littleHeart1.imageset/littleHeart1.png
0 → 100644
680 Bytes
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/littleHeart2.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "littleHeart2.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/Interaction/littleHeart2.imageset/littleHeart2.png
0 → 100644
787 Bytes
LiveVideoCloud/LiveVideoCloud/animation.xcassets/LaunchImage.launchimage/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "orientation" : "portrait", | |
| 5 | + "idiom" : "ipad", | |
| 6 | + "minimum-system-version" : "7.0", | |
| 7 | + "extent" : "full-screen", | |
| 8 | + "scale" : "2x" | |
| 9 | + }, | |
| 10 | + { | |
| 11 | + "orientation" : "landscape", | |
| 12 | + "idiom" : "ipad", | |
| 13 | + "minimum-system-version" : "7.0", | |
| 14 | + "extent" : "full-screen", | |
| 15 | + "scale" : "1x" | |
| 16 | + }, | |
| 17 | + { | |
| 18 | + "orientation" : "landscape", | |
| 19 | + "idiom" : "ipad", | |
| 20 | + "minimum-system-version" : "7.0", | |
| 21 | + "extent" : "full-screen", | |
| 22 | + "scale" : "2x" | |
| 23 | + }, | |
| 24 | + { | |
| 25 | + "orientation" : "portrait", | |
| 26 | + "idiom" : "iphone", | |
| 27 | + "minimum-system-version" : "7.0", | |
| 28 | + "scale" : "2x" | |
| 29 | + }, | |
| 30 | + { | |
| 31 | + "orientation" : "portrait", | |
| 32 | + "idiom" : "iphone", | |
| 33 | + "minimum-system-version" : "7.0", | |
| 34 | + "subtype" : "retina4", | |
| 35 | + "scale" : "2x" | |
| 36 | + }, | |
| 37 | + { | |
| 38 | + "orientation" : "portrait", | |
| 39 | + "idiom" : "ipad", | |
| 40 | + "minimum-system-version" : "7.0", | |
| 41 | + "extent" : "full-screen", | |
| 42 | + "scale" : "1x" | |
| 43 | + } | |
| 44 | + ], | |
| 45 | + "info" : { | |
| 46 | + "version" : 1, | |
| 47 | + "author" : "xcode" | |
| 48 | + } | |
| 49 | +} | |
| 0 | 50 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/Barrage input.imageset/Barrage input.png
0 → 100644
3.78 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/Barrage input.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "Barrage input.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/Contents.json
0 → 100644
LiveVideoCloud/LiveVideoCloud/animation.xcassets/bottom_shadow.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/bottom_shadow.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/bottom_shadow.imageset/bottom_shadow.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/bottom_shadow.imageset/bottom_shadow.png
1.12 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/dot.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/dot.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/dot.imageset/dot@3x.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/dot.imageset/dot@3x.png
335 Bytes
LiveVideoCloud/LiveVideoCloud/animation.xcassets/fullscreen.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/fullscreen.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/fullscreen.imageset/fullscreen@3x.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/fullscreen.imageset/fullscreen@3x.png
1.18 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/load_03.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "load_03.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/load_03.imageset/load_03.png
0 → 100644
3.63 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/nonfullscreen.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/nonfullscreen.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/nonfullscreen.imageset/nonfullscreen@3x.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/nonfullscreen.imageset/nonfullscreen@3x.png
1.19 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/pause.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/pause.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/pause.imageset/pause@3x.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/pause.imageset/pause@3x.png
188 Bytes
LiveVideoCloud/LiveVideoCloud/animation.xcassets/play.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/play.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/play.imageset/play@3x.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/play.imageset/play@3x.png
660 Bytes
LiveVideoCloud/LiveVideoCloud/animation.xcassets/play_back.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/play_back.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/play_back.imageset/play_back.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/play_back.imageset/play_back.png
1.47 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/top_shadow.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/top_shadow.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/top_shadow.imageset/top_shadow.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/top_shadow.imageset/top_shadow.png
2.95 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/全屏加载图.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "全屏加载图.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/全屏加载图.imageset/全屏加载图.png
0 → 100644
23.1 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/弹off.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "弹off.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/弹off.imageset/弹off.png
0 → 100644
1.49 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/弹on.imageset/Contents.json
0 → 100644
| 1 | +{ | |
| 2 | + "images" : [ | |
| 3 | + { | |
| 4 | + "idiom" : "universal", | |
| 5 | + "filename" : "弹on.png", | |
| 6 | + "scale" : "1x" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "idiom" : "universal", | |
| 10 | + "scale" : "2x" | |
| 11 | + }, | |
| 12 | + { | |
| 13 | + "idiom" : "universal", | |
| 14 | + "scale" : "3x" | |
| 15 | + } | |
| 16 | + ], | |
| 17 | + "info" : { | |
| 18 | + "version" : 1, | |
| 19 | + "author" : "xcode" | |
| 20 | + } | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/弹on.imageset/弹on.png
0 → 100644
1.26 KB
LiveVideoCloud/LiveVideoCloud/animation.xcassets/返回.imageset/Contents.json renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/返回.imageset/Contents.json
LiveVideoCloud/LiveVideoCloud/animation.xcassets/返回.imageset/返回@3x.png renamed to LiveVideoCloud/LiveVideoCloud/animation.xcassets/player/返回.imageset/返回@3x.png
1.35 KB