Commit 37a14aeba39d2bf80ecce70965ae18ad4c965cec

Authored by 朱林
1 parent 16b03d61

短视频基本功能完成

Showing 41 changed files with 1538 additions and 472 deletions
LiveVideoCloud.xcodeproj/project.pbxproj
... ... @@ -78,6 +78,10 @@
78 78 810B65061E779B1F00133E15 /* View+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64FA1E779B1F00133E15 /* View+MASAdditions.m */; };
79 79 810B65071E779B1F00133E15 /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64FD1E779B1F00133E15 /* ViewController+MASAdditions.m */; };
80 80 811BB68E1E8116C8005C6291 /* NSString+StringSize.m in Sources */ = {isa = PBXBuildFile; fileRef = 811BB68D1E8116C8005C6291 /* NSString+StringSize.m */; };
  81 + 813B33B61F170CD90045FD4B /* LVCVideoConfigView.m in Sources */ = {isa = PBXBuildFile; fileRef = 813B33B51F170CD90045FD4B /* LVCVideoConfigView.m */; };
  82 + 8148C5CF1F18665D003327FF /* LVCShortVideoPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8148C5CE1F18665D003327FF /* LVCShortVideoPlayerView.m */; };
  83 + 8148C5D21F18705C003327FF /* LVCShortVideoPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8148C5D11F18705C003327FF /* LVCShortVideoPlayerController.m */; };
  84 + 8148C5D51F189762003327FF /* LVCShortVideoListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8148C5D41F189762003327FF /* LVCShortVideoListCell.m */; };
81 85 8156A7A91F0F5A1D007EE146 /* LVCShortVideoController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8156A7A81F0F5A1D007EE146 /* LVCShortVideoController.m */; };
82 86 8156A7AC1F0F5AC6007EE146 /* LVCPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8156A7AB1F0F5AC6007EE146 /* LVCPreviewView.m */; };
83 87 8156A7AF1F0F73F7007EE146 /* LVCVideoMgrButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8156A7AE1F0F73F7007EE146 /* LVCVideoMgrButton.m */; };
... ... @@ -90,7 +94,6 @@
90 94 816A78D11F15BE28009A0839 /* DecalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 816A78CF1F15BE28009A0839 /* DecalView.m */; };
91 95 816A78D41F15C349009A0839 /* VideoParamCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 816A78D31F15C349009A0839 /* VideoParamCache.m */; };
92 96 816A78D71F15FC4A009A0839 /* LVCShortVideoListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 816A78D61F15FC4A009A0839 /* LVCShortVideoListViewController.m */; };
93   - 816A78DA1F15FEA7009A0839 /* CfgViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 816A78D91F15FEA7009A0839 /* CfgViewController.m */; };
94 97 816A78DD1F160168009A0839 /* LVCPublishView.m in Sources */ = {isa = PBXBuildFile; fileRef = 816A78DC1F160168009A0839 /* LVCPublishView.m */; };
95 98 8174B10D1F146F49001767F3 /* LVCEditorBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8174B10C1F146F49001767F3 /* LVCEditorBottomView.m */; };
96 99 8174B1101F146FB2001767F3 /* FilterChoiceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8174B10F1F146FB2001767F3 /* FilterChoiceView.m */; };
... ... @@ -119,8 +122,8 @@
119 122 8181D5431F1366F500959E3D /* CNLiveShortVideoSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5401F1366F500959E3D /* CNLiveShortVideoSDK.framework */; };
120 123 8181D5441F1366F500959E3D /* GPUImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5411F1366F500959E3D /* GPUImage.framework */; };
121 124 8181D5451F1366F500959E3D /* libksygpulive.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5421F1366F500959E3D /* libksygpulive.framework */; };
122   - 8181D55C1F13671B00959E3D /* Idina Menzel - Let It Go.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 8181D5461F13671B00959E3D /* Idina Menzel - Let It Go.mp3 */; };
123   - 8181D55D1F13671B00959E3D /* See You Again.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 8181D5471F13671B00959E3D /* See You Again.mp3 */; };
  125 + 8181D55C1F13671B00959E3D /* Let_It_Go.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 8181D5461F13671B00959E3D /* Let_It_Go.mp3 */; };
  126 + 8181D55D1F13671B00959E3D /* See_You_Again.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 8181D5471F13671B00959E3D /* See_You_Again.mp3 */; };
124 127 8181D55E1F13671B00959E3D /* BeagleDog.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8181D54A1F13671B00959E3D /* BeagleDog.bundle */; };
125 128 8181D55F1F13671B00959E3D /* ColorCrown.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8181D54B1F13671B00959E3D /* ColorCrown.bundle */; };
126 129 8181D5601F13671B00959E3D /* Deer.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8181D54C1F13671B00959E3D /* Deer.bundle */; };
... ... @@ -138,14 +141,13 @@
138 141 8181D56C1F13671B00959E3D /* v3.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8181D5581F13671B00959E3D /* v3.bundle */; };
139 142 8181D56D1F13671B00959E3D /* YellowEar.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8181D5591F13671B00959E3D /* YellowEar.bundle */; };
140 143 8181D56E1F13671B00959E3D /* KSYGPUResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8181D55A1F13671B00959E3D /* KSYGPUResource.bundle */; };
141   - 8181D56F1F13671B00959E3D /* Zedd,Alessia Cara - Stay.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 8181D55B1F13671B00959E3D /* Zedd,Alessia Cara - Stay.mp3 */; };
  144 + 8181D56F1F13671B00959E3D /* Stay.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 8181D55B1F13671B00959E3D /* Stay.mp3 */; };
142 145 8181D5711F13673100959E3D /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5701F13673100959E3D /* CNLivePlayerSDK.framework */; };
143 146 8181D5721F13674200959E3D /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5701F13673100959E3D /* CNLivePlayerSDK.framework */; };
144 147 8181D5731F13674200959E3D /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5701F13673100959E3D /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
145 148 8181D5751F13674200959E3D /* CNLiveShortVideoSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5401F1366F500959E3D /* CNLiveShortVideoSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
146 149 8181D5771F13674200959E3D /* GPUImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5411F1366F500959E3D /* GPUImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
147 150 8181D5791F13674200959E3D /* libksygpulive.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8181D5421F1366F500959E3D /* libksygpulive.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
148   - 8181D57C1F1379C400959E3D /* LVCPregressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8181D57B1F1379C400959E3D /* LVCPregressView.m */; };
149 151 8181D57F1F1381D100959E3D /* LVCVideoEditorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8181D57E1F1381D100959E3D /* LVCVideoEditorViewController.m */; };
150 152 81A483081E88B6140097A80A /* UIView+ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81A483071E88B6140097A80A /* UIView+ViewController.m */; };
151 153 81F1C8401E8BC5CC0085C2B8 /* NSArray+Safety.m in Sources */ = {isa = PBXBuildFile; fileRef = 81F1C83F1E8BC5CC0085C2B8 /* NSArray+Safety.m */; };
... ... @@ -502,6 +504,14 @@
502 504 810B64FD1E779B1F00133E15 /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ViewController+MASAdditions.m"; sourceTree = "<group>"; };
503 505 811BB68C1E8116C8005C6291 /* NSString+StringSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+StringSize.h"; sourceTree = "<group>"; };
504 506 811BB68D1E8116C8005C6291 /* NSString+StringSize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+StringSize.m"; sourceTree = "<group>"; };
  507 + 813B33B41F170CD90045FD4B /* LVCVideoConfigView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCVideoConfigView.h; sourceTree = "<group>"; };
  508 + 813B33B51F170CD90045FD4B /* LVCVideoConfigView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCVideoConfigView.m; sourceTree = "<group>"; };
  509 + 8148C5CD1F18665D003327FF /* LVCShortVideoPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCShortVideoPlayerView.h; sourceTree = "<group>"; };
  510 + 8148C5CE1F18665D003327FF /* LVCShortVideoPlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCShortVideoPlayerView.m; sourceTree = "<group>"; };
  511 + 8148C5D01F18705C003327FF /* LVCShortVideoPlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCShortVideoPlayerController.h; sourceTree = "<group>"; };
  512 + 8148C5D11F18705C003327FF /* LVCShortVideoPlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCShortVideoPlayerController.m; sourceTree = "<group>"; };
  513 + 8148C5D31F189762003327FF /* LVCShortVideoListCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCShortVideoListCell.h; sourceTree = "<group>"; };
  514 + 8148C5D41F189762003327FF /* LVCShortVideoListCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCShortVideoListCell.m; sourceTree = "<group>"; };
505 515 8156A7A71F0F5A1D007EE146 /* LVCShortVideoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCShortVideoController.h; sourceTree = "<group>"; };
506 516 8156A7A81F0F5A1D007EE146 /* LVCShortVideoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCShortVideoController.m; sourceTree = "<group>"; };
507 517 8156A7AA1F0F5AC6007EE146 /* LVCPreviewView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPreviewView.h; sourceTree = "<group>"; };
... ... @@ -525,8 +535,6 @@
525 535 816A78D31F15C349009A0839 /* VideoParamCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoParamCache.m; sourceTree = "<group>"; };
526 536 816A78D51F15FC4A009A0839 /* LVCShortVideoListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCShortVideoListViewController.h; sourceTree = "<group>"; };
527 537 816A78D61F15FC4A009A0839 /* LVCShortVideoListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCShortVideoListViewController.m; sourceTree = "<group>"; };
528   - 816A78D81F15FEA7009A0839 /* CfgViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CfgViewController.h; sourceTree = "<group>"; };
529   - 816A78D91F15FEA7009A0839 /* CfgViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CfgViewController.m; sourceTree = "<group>"; };
530 538 816A78DB1F160168009A0839 /* LVCPublishView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPublishView.h; sourceTree = "<group>"; };
531 539 816A78DC1F160168009A0839 /* LVCPublishView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPublishView.m; sourceTree = "<group>"; };
532 540 8174B10B1F146F49001767F3 /* LVCEditorBottomView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCEditorBottomView.h; sourceTree = "<group>"; };
... ... @@ -579,8 +587,8 @@
579 587 8181D5401F1366F500959E3D /* CNLiveShortVideoSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveShortVideoSDK.framework; sourceTree = "<group>"; };
580 588 8181D5411F1366F500959E3D /* GPUImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GPUImage.framework; sourceTree = "<group>"; };
581 589 8181D5421F1366F500959E3D /* libksygpulive.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libksygpulive.framework; sourceTree = "<group>"; };
582   - 8181D5461F13671B00959E3D /* Idina Menzel - Let It Go.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Idina Menzel - Let It Go.mp3"; sourceTree = "<group>"; };
583   - 8181D5471F13671B00959E3D /* See You Again.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "See You Again.mp3"; sourceTree = "<group>"; };
  590 + 8181D5461F13671B00959E3D /* Let_It_Go.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = Let_It_Go.mp3; sourceTree = "<group>"; };
  591 + 8181D5471F13671B00959E3D /* See_You_Again.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = See_You_Again.mp3; sourceTree = "<group>"; };
584 592 8181D54A1F13671B00959E3D /* BeagleDog.bundle */ = {isa = PBXFileReference; lastKnownFileType = file; path = BeagleDog.bundle; sourceTree = "<group>"; };
585 593 8181D54B1F13671B00959E3D /* ColorCrown.bundle */ = {isa = PBXFileReference; lastKnownFileType = file; path = ColorCrown.bundle; sourceTree = "<group>"; };
586 594 8181D54C1F13671B00959E3D /* Deer.bundle */ = {isa = PBXFileReference; lastKnownFileType = file; path = Deer.bundle; sourceTree = "<group>"; };
... ... @@ -598,10 +606,8 @@
598 606 8181D5581F13671B00959E3D /* v3.bundle */ = {isa = PBXFileReference; lastKnownFileType = file; path = v3.bundle; sourceTree = "<group>"; };
599 607 8181D5591F13671B00959E3D /* YellowEar.bundle */ = {isa = PBXFileReference; lastKnownFileType = file; path = YellowEar.bundle; sourceTree = "<group>"; };
600 608 8181D55A1F13671B00959E3D /* KSYGPUResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = KSYGPUResource.bundle; sourceTree = "<group>"; };
601   - 8181D55B1F13671B00959E3D /* Zedd,Alessia Cara - Stay.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Zedd,Alessia Cara - Stay.mp3"; sourceTree = "<group>"; };
  609 + 8181D55B1F13671B00959E3D /* Stay.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = Stay.mp3; sourceTree = "<group>"; };
602 610 8181D5701F13673100959E3D /* CNLivePlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLivePlayerSDK.framework; sourceTree = "<group>"; };
603   - 8181D57A1F1379C400959E3D /* LVCPregressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPregressView.h; sourceTree = "<group>"; };
604   - 8181D57B1F1379C400959E3D /* LVCPregressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPregressView.m; sourceTree = "<group>"; };
605 611 8181D57D1F1381D100959E3D /* LVCVideoEditorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCVideoEditorViewController.h; sourceTree = "<group>"; };
606 612 8181D57E1F1381D100959E3D /* LVCVideoEditorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCVideoEditorViewController.m; sourceTree = "<group>"; };
607 613 81A483061E88B6140097A80A /* UIView+ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+ViewController.h"; sourceTree = "<group>"; };
... ... @@ -1022,12 +1028,12 @@
1022 1028 D209AD701EC583D100D82E3B /* MineAccountController.m */,
1023 1029 816A78D51F15FC4A009A0839 /* LVCShortVideoListViewController.h */,
1024 1030 816A78D61F15FC4A009A0839 /* LVCShortVideoListViewController.m */,
1025   - 816A78D81F15FEA7009A0839 /* CfgViewController.h */,
1026   - 816A78D91F15FEA7009A0839 /* CfgViewController.m */,
1027 1031 8156A7A71F0F5A1D007EE146 /* LVCShortVideoController.h */,
1028 1032 8156A7A81F0F5A1D007EE146 /* LVCShortVideoController.m */,
1029 1033 8181D57D1F1381D100959E3D /* LVCVideoEditorViewController.h */,
1030 1034 8181D57E1F1381D100959E3D /* LVCVideoEditorViewController.m */,
  1035 + 8148C5D01F18705C003327FF /* LVCShortVideoPlayerController.h */,
  1036 + 8148C5D11F18705C003327FF /* LVCShortVideoPlayerController.m */,
1031 1037 );
1032 1038 path = Controllers;
1033 1039 sourceTree = "<group>";
... ... @@ -1114,8 +1120,6 @@
1114 1120 8156A7B91F0F9541007EE146 /* AECommonCell.m */,
1115 1121 8181D53D1F135FFC00959E3D /* LVCRecordProgressView.h */,
1116 1122 8181D53E1F135FFC00959E3D /* LVCRecordProgressView.m */,
1117   - 8181D57A1F1379C400959E3D /* LVCPregressView.h */,
1118   - 8181D57B1F1379C400959E3D /* LVCPregressView.m */,
1119 1123 810899C51F13856A003E989C /* LVCEditorTopView.h */,
1120 1124 810899C61F13856A003E989C /* LVCEditorTopView.m */,
1121 1125 810899C81F138E48003E989C /* TrimMaskView.h */,
... ... @@ -1136,6 +1140,12 @@
1136 1140 816A78CF1F15BE28009A0839 /* DecalView.m */,
1137 1141 816A78DB1F160168009A0839 /* LVCPublishView.h */,
1138 1142 816A78DC1F160168009A0839 /* LVCPublishView.m */,
  1143 + 813B33B41F170CD90045FD4B /* LVCVideoConfigView.h */,
  1144 + 813B33B51F170CD90045FD4B /* LVCVideoConfigView.m */,
  1145 + 8148C5CD1F18665D003327FF /* LVCShortVideoPlayerView.h */,
  1146 + 8148C5CE1F18665D003327FF /* LVCShortVideoPlayerView.m */,
  1147 + 8148C5D31F189762003327FF /* LVCShortVideoListCell.h */,
  1148 + 8148C5D41F189762003327FF /* LVCShortVideoListCell.m */,
1139 1149 );
1140 1150 path = Views;
1141 1151 sourceTree = "<group>";
... ... @@ -2142,10 +2152,10 @@
2142 2152 D25BF88A1E7F7F77007FB138 /* Resource */ = {
2143 2153 isa = PBXGroup;
2144 2154 children = (
2145   - 8181D5461F13671B00959E3D /* Idina Menzel - Let It Go.mp3 */,
2146   - 8181D5471F13671B00959E3D /* See You Again.mp3 */,
  2155 + 8181D5461F13671B00959E3D /* Let_It_Go.mp3 */,
  2156 + 8181D5471F13671B00959E3D /* See_You_Again.mp3 */,
2147 2157 8181D5481F13671B00959E3D /* ShortVideoResources */,
2148   - 8181D55B1F13671B00959E3D /* Zedd,Alessia Cara - Stay.mp3 */,
  2158 + 8181D55B1F13671B00959E3D /* Stay.mp3 */,
2149 2159 8178D4671F021C4500AA78A4 /* TelevisionData.json */,
2150 2160 D25BF88C1E7F7F77007FB138 /* Images */,
2151 2161 D25BF88B1E7F7F77007FB138 /* Fonts */,
... ... @@ -2451,7 +2461,7 @@
2451 2461 8181D5601F13671B00959E3D /* Deer.bundle in Resources */,
2452 2462 8181D5641F13671B00959E3D /* item0204.bundle in Resources */,
2453 2463 8181D56E1F13671B00959E3D /* KSYGPUResource.bundle in Resources */,
2454   - 8181D55C1F13671B00959E3D /* Idina Menzel - Let It Go.mp3 in Resources */,
  2464 + 8181D55C1F13671B00959E3D /* Let_It_Go.mp3 in Resources */,
2455 2465 D2575C7F1E76A4F300E3A8FC /* NHPlaneViews.xib in Resources */,
2456 2466 D2393D0F1F0250A100D3EE17 /* read_me.txt in Resources */,
2457 2467 D2393D1E1F0250A700D3EE17 /* WeiboSDK.bundle in Resources */,
... ... @@ -2461,7 +2471,7 @@
2461 2471 D25BF8901E7F7F8F007FB138 /* UGCLoading.jpeg in Resources */,
2462 2472 8181D56B1F13671B00959E3D /* tiara.bundle in Resources */,
2463 2473 D25BF8A51E80EC76007FB138 /* 头像.jpg in Resources */,
2464   - 8181D55D1F13671B00959E3D /* See You Again.mp3 in Resources */,
  2474 + 8181D55D1F13671B00959E3D /* See_You_Again.mp3 in Resources */,
2465 2475 8181D55E1F13671B00959E3D /* BeagleDog.bundle in Resources */,
2466 2476 D2029CC91E6EADE10027CD92 /* SVProgressHUD.bundle in Resources */,
2467 2477 D2575C801E76A4F300E3A8FC /* resource.bundle in Resources */,
... ... @@ -2474,7 +2484,7 @@
2474 2484 8181D5651F13671B00959E3D /* item0208.bundle in Resources */,
2475 2485 D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */,
2476 2486 D2029CB01E6EADE10027CD92 /* MJRefresh.bundle in Resources */,
2477   - 8181D56F1F13671B00959E3D /* Zedd,Alessia Cara - Stay.mp3 in Resources */,
  2487 + 8181D56F1F13671B00959E3D /* Stay.mp3 in Resources */,
2478 2488 8181D55F1F13671B00959E3D /* ColorCrown.bundle in Resources */,
2479 2489 D2575C7C1E76A4F300E3A8FC /* NHFighterView.nib in Resources */,
2480 2490 8181D5631F13671B00959E3D /* hartshorn.bundle in Resources */,
... ... @@ -2530,6 +2540,7 @@
2530 2540 4B45CE981EB86A760079AFB7 /* UILabel+createLabel.m in Sources */,
2531 2541 D2029C9C1E6EADE10027CD92 /* MJPropertyType.m in Sources */,
2532 2542 D22831091E77D8D500627701 /* GiftModel.m in Sources */,
  2543 + 813B33B61F170CD90045FD4B /* LVCVideoConfigView.m in Sources */,
2533 2544 4BD8560F1EBACEF80082061D /* CNLiveWebView.m in Sources */,
2534 2545 8174B1131F14B932001767F3 /* BeautyConfigView.m in Sources */,
2535 2546 810B65051E779B1F00133E15 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */,
... ... @@ -2591,7 +2602,6 @@
2591 2602 D2029BCE1E6EADD70027CD92 /* ZXNavigationController.m in Sources */,
2592 2603 D2029CA21E6EADE10027CD92 /* MJRefreshAutoFooter.m in Sources */,
2593 2604 D2029CC71E6EADE10027CD92 /* SVIndefiniteAnimatedView.m in Sources */,
2594   - 8181D57C1F1379C400959E3D /* LVCPregressView.m in Sources */,
2595 2605 D2029CA31E6EADE10027CD92 /* MJRefreshBackFooter.m in Sources */,
2596 2606 4B45CE7E1EB86A590079AFB7 /* LoginViewController.m in Sources */,
2597 2607 D255300C1E793F8200DF38A5 /* NHFighterView+animDelegagte.m in Sources */,
... ... @@ -2608,7 +2618,6 @@
2608 2618 D2EBC8881F0225D900F198FB /* LVCVodPlayerListController.m in Sources */,
2609 2619 4B45CE831EB86A590079AFB7 /* LVCMineModel.m in Sources */,
2610 2620 4B45CE791EB86A590079AFB7 /* MineAboutUsController.m in Sources */,
2611   - 816A78DA1F15FEA7009A0839 /* CfgViewController.m in Sources */,
2612 2621 81A483081E88B6140097A80A /* UIView+ViewController.m in Sources */,
2613 2622 D2EBC8721F02108000F198FB /* LVCLiveActivityInfoService.m in Sources */,
2614 2623 D2029CC81E6EADE10027CD92 /* SVProgressAnimatedView.m in Sources */,
... ... @@ -2662,6 +2671,7 @@
2662 2671 D2B7B2511E8247D400ED084E /* ChatBarrageManager.m in Sources */,
2663 2672 D2029CAC1E6EADE10027CD92 /* MJRefreshBackStateFooter.m in Sources */,
2664 2673 D2029CB11E6EADE10027CD92 /* MJRefreshConst.m in Sources */,
  2674 + 8148C5CF1F18665D003327FF /* LVCShortVideoPlayerView.m in Sources */,
2665 2675 D2029CAD1E6EADE10027CD92 /* MJRefreshGifHeader.m in Sources */,
2666 2676 D2029CB31E6EADE10027CD92 /* UIScrollView+MJRefresh.m in Sources */,
2667 2677 4BD856151EBAD31A0082061D /* NSString+UrlEncode.m in Sources */,
... ... @@ -2713,6 +2723,7 @@
2713 2723 D25BF87A1E7B8A82007FB138 /* FilterFunctionView.m in Sources */,
2714 2724 D207BEA11E84C1EC006A0CE8 /* AnimationBaseView.m in Sources */,
2715 2725 4B45CE971EB86A760079AFB7 /* UIButton+createButton.m in Sources */,
  2726 + 8148C5D51F189762003327FF /* LVCShortVideoListCell.m in Sources */,
2716 2727 D2029D001E6EAE2E0027CD92 /* NSNumber+ScaleHeight.m in Sources */,
2717 2728 4BD856041EBACD530082061D /* UIActivityIndicatorView+AFNetworking.m in Sources */,
2718 2729 4B45CE781EB86A590079AFB7 /* LVCMineViewController.m in Sources */,
... ... @@ -2745,6 +2756,7 @@
2745 2756 4B45CE881EB86A590079AFB7 /* LVCMineShowCell.m in Sources */,
2746 2757 D2029CD41E6EADE70027CD92 /* HttpService.m in Sources */,
2747 2758 8156A7C01F0F9589007EE146 /* AEModelTemplate.m in Sources */,
  2759 + 8148C5D21F18705C003327FF /* LVCShortVideoPlayerController.m in Sources */,
2748 2760 );
2749 2761 runOnlyForDeploymentPostprocessing = 0;
2750 2762 };
... ...
LiveVideoCloud.xcodeproj/xcuserdata/iOS.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
... ... @@ -19,29 +19,13 @@
19 19 shouldBeEnabled = "Yes"
20 20 ignoreCount = "0"
21 21 continueAfterRunningActions = "No"
22   - filePath = "LiveVideoCloud/Classes/Sections/Mine/Views/LVCVideoMgrButton.m"
23   - timestampString = "521361420.44809"
  22 + filePath = "LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCShortVideoController.m"
  23 + timestampString = "521715609.61753"
24 24 startingColumnNumber = "9223372036854775807"
25 25 endingColumnNumber = "9223372036854775807"
26   - startingLineNumber = "21"
27   - endingLineNumber = "21"
28   - landmarkName = "-initWithFrame:left:"
29   - landmarkType = "7">
30   - </BreakpointContent>
31   - </BreakpointProxy>
32   - <BreakpointProxy
33   - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
34   - <BreakpointContent
35   - shouldBeEnabled = "Yes"
36   - ignoreCount = "0"
37   - continueAfterRunningActions = "No"
38   - filePath = "LiveVideoCloud/Classes/Sections/Mine/Views/LVCVideoMgrButton.m"
39   - timestampString = "521361430.079111"
40   - startingColumnNumber = "9223372036854775807"
41   - endingColumnNumber = "9223372036854775807"
42   - startingLineNumber = "46"
43   - endingLineNumber = "46"
44   - landmarkName = "-setVideoMgrState:"
  26 + startingLineNumber = "230"
  27 + endingLineNumber = "230"
  28 + landmarkName = "-p_setupPreViewEvent"
45 29 landmarkType = "7">
46 30 </BreakpointContent>
47 31 </BreakpointProxy>
... ...
LiveVideoCloud/Classes/Sections/Mine/Controllers/CfgViewController.h deleted 100644 → 0
1   -//
2   -// CfgViewController.h
3   -// CNShortVideoDemo
4   -//
5   -// Created by iOS on 2017/6/9.
6   -// Copyright © 2017年 zl. All rights reserved.
7   -//
8   -
9   -#import <UIKit/UIKit.h>
10   -
11   -@interface CfgViewController : UIViewController
12   -
13   -@end
LiveVideoCloud/Classes/Sections/Mine/Controllers/CfgViewController.m deleted 100644 → 0
1   -//
2   -// CfgViewController.m
3   -// CNShortVideoDemo
4   -//
5   -// Created by iOS on 2017/6/9.
6   -// Copyright © 2017年 zl. All rights reserved.
7   -//
8   -
9   -#import "CfgViewController.h"
10   -#import "VideoParamCache.h"
11   -#import "LVCShortVideoController.h"
12   -
13   -@interface CfgViewController ()
14   -
15   -@property (nonatomic, strong) UILabel *frameLabel;
16   -@property (nonatomic, strong) UILabel *resLabel;
17   -@property (nonatomic, strong) UILabel *vbpsLabel;
18   -@property (nonatomic, strong) UILabel *abpsLabel;
19   -@property (nonatomic, strong) UILabel *codecLabel;
20   -@property (nonatomic, strong) UISegmentedControl *titleSegmentedControl; //配置参数
21   -@property (nonatomic, strong) UISegmentedControl *resolutionSegmentedControl; //分辨率
22   -@property (nonatomic, strong) UISegmentedControl *codecSegmentedControl; //编码方式
23   -@property (nonatomic, strong) UITextField *frameRateTextView; //帧率
24   -@property (nonatomic, strong) UITextField *vbpsTextView; //视频码率
25   -@property (nonatomic, strong) UITextField *abpsTextView; //音频码率
26   -@property (nonatomic, strong) UIButton *startBtn; //开始
27   -@property (nonatomic, strong) UIButton *saveBtn; //保存
28   -@property (nonatomic, strong) UIButton *backBtn; //返回
29   -
30   -@end
31   -
32   -@implementation CfgViewController
33   -
34   -- (void)dealloc
35   -{
36   - NSLog(@"CfgViewController dealloc");
37   -}
38   -
39   -- (void)viewDidLoad {
40   - [super viewDidLoad];
41   - // Do any additional setup after loading the view.
42   - self.view.backgroundColor = [UIColor whiteColor];
43   - self.navigationController.navigationBar.translucent = NO;
44   -
45   - [self.view addSubview:self.frameLabel];
46   - [self.view addSubview:self.frameRateTextView];
47   - [self.view addSubview:self.resLabel];
48   - [self.view addSubview:self.vbpsLabel];
49   - [self.view addSubview:self.vbpsTextView];
50   - [self.view addSubview:self.abpsLabel];
51   - [self.view addSubview:self.abpsTextView];
52   - [self.view addSubview:self.resolutionSegmentedControl];
53   - [self.view addSubview:self.startBtn];
54   - [self.view addSubview:self.titleSegmentedControl];
55   - [self.view addSubview:self.saveBtn];
56   - [self.view addSubview:self.backBtn];
57   -
58   -}
59   -
60   -#pragma mark -
61   -#pragma mark - action
62   -- (void)startRecord {
63   - LVCShortVideoController *preVC = [[LVCShortVideoController alloc] init];
64   - [self presentViewController:preVC animated:YES completion:NULL];
65   -}
66   -
67   -- (void)onParamTypeChange:(UISegmentedControl *)ctl
68   -{
69   -
70   - switch (ctl.selectedSegmentIndex) {
71   - case 0: {
72   - self.codecLabel.hidden = YES;
73   - self.codecSegmentedControl.hidden = YES;
74   - self.frameRateTextView.hidden = NO;
75   - self.frameLabel.hidden = NO;
76   - self.resolutionSegmentedControl.selectedSegmentIndex = [VideoParamCache sharedInstance].captureParam.level;
77   - self.codecSegmentedControl.selectedSegmentIndex = [VideoParamCache sharedInstance].captureParam.codec;
78   - self.frameRateTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].captureParam.frame)];
79   - self.abpsTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].captureParam.abps)];
80   - self.vbpsTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].captureParam.vbps)];
81   - }break;
82   -
83   - case 1: {
84   - self.codecLabel.hidden = NO;
85   - self.codecSegmentedControl.hidden = NO;
86   - self.frameRateTextView.hidden = YES;
87   - self.frameLabel.hidden = YES;
88   - self.resolutionSegmentedControl.selectedSegmentIndex = [VideoParamCache sharedInstance].exportParam.level;
89   - self.codecSegmentedControl.selectedSegmentIndex = [VideoParamCache sharedInstance].exportParam.codec;
90   - self.frameRateTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].exportParam.frame)];
91   - self.abpsTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].exportParam.abps)];
92   - self.vbpsTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].exportParam.vbps)];
93   - }break;
94   -
95   - case UISegmentedControlNoSegment:
96   - break;
97   - default:
98   - break;
99   - }
100   -}
101   -
102   -
103   -- (void)onSave:(id)sender
104   -{
105   - //录制
106   - if (self.titleSegmentedControl.selectedSegmentIndex == 0){
107   - [VideoParamCache sharedInstance].captureParam.level = self.resolutionSegmentedControl.selectedSegmentIndex;
108   -
109   - [VideoParamCache sharedInstance].captureParam.codec = self.codecSegmentedControl.selectedSegmentIndex;
110   - if ([self.frameRateTextView.text integerValue] > 0){
111   - [VideoParamCache sharedInstance].captureParam.frame = [self.frameRateTextView.text integerValue];
112   - }
113   - if ([self.abpsTextView.text integerValue] > 0){
114   - [VideoParamCache sharedInstance].captureParam.abps = [self.abpsTextView.text integerValue];
115   - }
116   - if ([self.vbpsTextView.text integerValue] > 0){
117   - [VideoParamCache sharedInstance].captureParam.vbps = [self.vbpsTextView.text integerValue];
118   - }
119   - }
120   - //输出
121   - if (self.titleSegmentedControl.selectedSegmentIndex == 1){
122   - [VideoParamCache sharedInstance].exportParam.level = self.resolutionSegmentedControl.selectedSegmentIndex;
123   -
124   - [VideoParamCache sharedInstance].exportParam.codec = self.codecSegmentedControl.selectedSegmentIndex;
125   - if ([self.frameRateTextView.text integerValue] > 0){
126   - [VideoParamCache sharedInstance].exportParam.frame = [self.frameRateTextView.text integerValue];
127   - }
128   - if ([self.abpsTextView.text integerValue] > 0){
129   - [VideoParamCache sharedInstance].exportParam.abps = [self.abpsTextView.text integerValue];
130   - }
131   - if ([self.vbpsTextView.text integerValue] > 0){
132   - [VideoParamCache sharedInstance].exportParam.vbps = [self.vbpsTextView.text integerValue];
133   - }
134   - }
135   -}
136   -
137   -- (void)back {
138   - [self dismissViewControllerAnimated:YES completion:NULL];
139   -}
140   -
141   -- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
142   - [self.view endEditing:YES];
143   -}
144   -
145   -#pragma mark -
146   -#pragma mark - getter
147   -- (UIButton *)saveBtn
148   -{
149   - if (!_saveBtn) {
150   - _saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
151   - _saveBtn.frame = CGRectMake((KScreenWidth-240)/4*2+80, KScreenHeight/3*2, 80, 35);
152   - [_saveBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
153   - [_saveBtn setTitle:@"save" forState:UIControlStateNormal];
154   - [_saveBtn addTarget:self action:@selector(onSave:) forControlEvents:UIControlEventTouchUpInside];
155   - _saveBtn.layer.cornerRadius = 7;
156   - _saveBtn.layer.borderColor = [UIColor blackColor].CGColor;
157   - _saveBtn.layer.borderWidth = 1;
158   - _saveBtn.layer.masksToBounds = YES;
159   - }
160   - return _saveBtn;
161   -}
162   -
163   -- (UISegmentedControl *)titleSegmentedControl
164   -{
165   - if (!_titleSegmentedControl) {
166   - NSArray *array = [[NSArray alloc] initWithObjects:@"录制",@"输出",nil];
167   - _titleSegmentedControl = [[UISegmentedControl alloc]initWithItems:array];
168   - _titleSegmentedControl.frame = CGRectMake(10, 70, KScreenWidth-20, 30);
169   - _titleSegmentedControl.selectedSegmentIndex = 1;
170   - _titleSegmentedControl.tintColor= [UIColor blackColor];
171   - [_titleSegmentedControl addTarget:self action:@selector(onParamTypeChange:) forControlEvents:UIControlEventValueChanged];
172   - }
173   - return _titleSegmentedControl;
174   -}
175   -
176   -- (UILabel *)frameLabel
177   -{
178   - if (!_frameLabel) {
179   - _frameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 200, 60, 30)];
180   - _frameLabel.text = @"帧率";
181   - _frameLabel.hidden = YES;
182   - }
183   - return _frameLabel;
184   -}
185   -
186   -
187   -- (UILabel *)resLabel
188   -{
189   - if (!_resLabel) {
190   - _resLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 150, 60, 30)];
191   - _resLabel.text = @"分辨率";
192   - }
193   - return _resLabel;
194   -}
195   -
196   -- (UILabel *)vbpsLabel
197   -{
198   - if (!_vbpsLabel) {
199   - _vbpsLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 240, 130, 30)];
200   - _vbpsLabel.text = @"视频码率(kbps)";
201   - }
202   - return _vbpsLabel;
203   -}
204   -
205   -- (UILabel *)abpsLabel
206   -{
207   - if (!_abpsLabel) {
208   - _abpsLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 280, 130, 30)];
209   - _abpsLabel.text = @"音频码率(kbps)";
210   - }
211   - return _abpsLabel;
212   -}
213   -
214   -- (UILabel *)codecLabel
215   -{
216   - if (!_codecLabel) {
217   - _codecLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 160, 60, 30)];
218   - _codecLabel.text = @"编码";
219   - }
220   - return _codecLabel;
221   -}
222   -
223   -- (UISegmentedControl *)resolutionSegmentedControl
224   -{
225   - if (!_resolutionSegmentedControl) {
226   - NSArray *array = [[NSArray alloc] initWithObjects:@"360p",@"480p",@"540p",@"720p",nil];
227   - _resolutionSegmentedControl = [[UISegmentedControl alloc] initWithItems:array];
228   - _resolutionSegmentedControl.frame = CGRectMake(80, 150, 200, 30);
229   - _resolutionSegmentedControl.selectedSegmentIndex = 3;
230   - _resolutionSegmentedControl.tintColor= [UIColor blackColor];
231   - }
232   - return _resolutionSegmentedControl;
233   -}
234   -
235   -- (UISegmentedControl *)codecSegmentedControl
236   -{
237   - if (!_codecSegmentedControl) {
238   - NSArray *array = [[NSArray alloc] initWithObjects:@"H.264",@"H.265",nil];
239   - _codecSegmentedControl = [[UISegmentedControl alloc]initWithItems:array];
240   - _codecSegmentedControl.frame = CGRectMake(80, 160, 150, 30);
241   - _codecSegmentedControl.selectedSegmentIndex = 0;
242   - _codecSegmentedControl.tintColor= [UIColor blackColor];
243   - }
244   - return _codecSegmentedControl;
245   -}
246   -
247   -- (UITextField *)vbpsTextView
248   -{
249   - if (!_vbpsTextView) {
250   - _vbpsTextView = [[UITextField alloc] initWithFrame:CGRectMake(140, 240, 60, 30)];
251   - _vbpsTextView.tag = 1;
252   - _vbpsTextView.keyboardType = UIKeyboardTypeNumberPad;
253   - _vbpsTextView.borderStyle = UITextBorderStyleRoundedRect;
254   - _vbpsTextView.placeholder = @"4096";
255   - }
256   - return _vbpsTextView;
257   -}
258   -
259   -- (UITextField *)abpsTextView
260   -{
261   - if (!_abpsTextView) {
262   - _abpsTextView = [[UITextField alloc] initWithFrame:CGRectMake(140, 280, 60, 30)];
263   - _abpsTextView.keyboardType = UIKeyboardTypeNumberPad;
264   - _abpsTextView.borderStyle = UITextBorderStyleRoundedRect;
265   - _abpsTextView.tag = 2;
266   - _abpsTextView.placeholder = @"96";
267   - }
268   - return _abpsTextView;
269   -}
270   -
271   -- (UITextField *)frameRateTextView
272   -{
273   - if (!_frameRateTextView) {
274   - _frameRateTextView = [[UITextField alloc] initWithFrame:CGRectMake(80, 200, 60, 30)];
275   - _frameRateTextView.keyboardType = UIKeyboardTypeNumberPad;
276   - _frameRateTextView.borderStyle = UITextBorderStyleRoundedRect;
277   - _frameRateTextView.tag = 2;
278   - _frameRateTextView.hidden = YES;
279   - _frameRateTextView.placeholder = @"30";
280   - }
281   - return _frameRateTextView;
282   -}
283   -
284   -- (UIButton *)startBtn
285   -{
286   - if (!_startBtn) {
287   - _startBtn = [UIButton buttonWithType:UIButtonTypeCustom];
288   - _startBtn.frame = CGRectMake((KScreenWidth-240)/4*3+80*2, KScreenHeight/3*2, 80, 35);
289   - [_startBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
290   - [_startBtn setTitle:@"start" forState:UIControlStateNormal];
291   - [_startBtn addTarget:self action:@selector(startRecord) forControlEvents:UIControlEventTouchUpInside];
292   - _startBtn.layer.cornerRadius = 7;
293   - _startBtn.layer.borderColor = [UIColor blackColor].CGColor;
294   - _startBtn.layer.borderWidth = 1;
295   - _startBtn.layer.masksToBounds = YES;
296   - }
297   - return _startBtn;
298   -}
299   -
300   -- (UIButton *)backBtn
301   -{
302   - if (!_backBtn) {
303   - _backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
304   - _backBtn.frame = CGRectMake((KScreenWidth-240)/4, KScreenHeight/3*2, 80, 35);
305   - [_backBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
306   - [_backBtn setTitle:@"back" forState:UIControlStateNormal];
307   - [_backBtn addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
308   - _backBtn.layer.cornerRadius = 7;
309   - _backBtn.layer.borderColor = [UIColor blackColor].CGColor;
310   - _backBtn.layer.borderWidth = 1;
311   - _backBtn.layer.masksToBounds = YES;
312   - }
313   - return _backBtn;
314   -}
315   -
316   -- (void)didReceiveMemoryWarning {
317   - [super didReceiveMemoryWarning];
318   - // Dispose of any resources that can be recreated.
319   -}
320   -
321   -/*
322   -#pragma mark - Navigation
323   -
324   -// In a storyboard-based application, you will often want to do a little preparation before navigation
325   -- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
326   - // Get the new view controller using [segue destinationViewController].
327   - // Pass the selected object to the new view controller.
328   -}
329   -*/
330   -
331   -@end
LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCMineViewController.m
... ... @@ -131,7 +131,7 @@
131 131 {
132 132 _loginShowView = [LVCLoginShowView new];
133 133  
134   - _loginShowView.backgroundColor =[UIColor yellowColorCNLive];
  134 + _loginShowView.backgroundColor =[UIColor colorWithHexString:@"#ffba00"];
135 135  
136 136 _loginShowView.frame = CGRectMake(0, -LoginViewHeight, SCREEN_W, LoginViewHeight);
137 137 _loginShowView.delegate = self;
... ...
LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCShortVideoController.h
... ... @@ -10,4 +10,6 @@
10 10  
11 11 @interface LVCShortVideoController : UIViewController
12 12  
  13 +@property (nonatomic, strong) NSString *maxDuration;
  14 +
13 15 @end
... ...
LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCShortVideoController.m
... ... @@ -23,6 +23,9 @@
23 23  
24 24 @interface LVCShortVideoController ()<CNLiveCameraRecorderDelegate, UINavigationControllerDelegate,
25 25 UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegate, CNLiveMediaEditorDelegate>
  26 +{
  27 +
  28 +}
26 29  
27 30 @property (nonatomic, strong) LVCPreviewView *previewView;
28 31 @property (nonatomic, strong) LVCAERootView *aeRootView;
... ... @@ -33,7 +36,10 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
33 36 @property (nonatomic, strong) NSURL *filePath;
34 37 @property (nonatomic, assign) long startTime;
35 38 @property (nonatomic, strong) NSTimer *recordTimer;
36   -@property (nonatomic, strong) NSString *maxDuration; //最大时长
  39 +@property (nonatomic, assign) int count;
  40 +@property (nonatomic, strong) UILabel *timeLab;
  41 +@property (nonatomic, assign) int tempTime;
  42 +@property (nonatomic, strong) NSMutableArray *timesArr;
37 43  
38 44 @end
39 45  
... ... @@ -42,9 +48,14 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
42 48 - (void)viewWillAppear:(BOOL)animated
43 49 {
44 50 [super viewWillAppear:animated];
45   - [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
46 51 [_previewView initRecrdProgress:self.recorder.minRecDuration/self.recorder.maxRecDuration];
47 52 [_recorder startPreview:self.previewView.previewView];
  53 + _recorder.delegate = self;
  54 +}
  55 +
  56 +- (void)viewDidAppear:(BOOL)animated {
  57 + [super viewDidAppear:animated];
  58 + [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
48 59 }
49 60  
50 61 - (void)viewWillDisappear:(BOOL)animated
... ... @@ -66,20 +77,12 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
66 77 [self.view addSubview:self.aeRootView];
67 78 [self.view addSubview:self.beautyView];
68 79 [self.view addSubview:self.faceUView];
  80 + [self.view addSubview:self.timeLab];
69 81  
70 82 [self p_initCamera];
71 83 [self p_setupPreViewEvent];
72 84  
73   - [CNLiveMediaEditor shareInstance].delegate = self;
74   -
75   - //鉴权
76   - [[CNLiveMediaEditor shareInstance] registerCNMediaEditorKit:^(NSString *maxDuration) {
77   -
78   - _maxDuration = maxDuration;
79   -
80   - } failure:^(NSDictionary *errorDic) {
81   - NSLog(@"鉴权失败:%@", errorDic[@"errorMessage"]);
82   - }];
  85 + _timesArr = [[NSMutableArray alloc] init];
83 86 }
84 87  
85 88 - (void)p_initCamera
... ... @@ -115,8 +118,8 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
115 118  
116 119 // 默认开启 前置摄像头
117 120 _recorder.cameraPosition = AVCaptureDevicePositionFront;
118   - _recorder.minRecDuration = 10;
119   - _recorder.maxRecDuration = 60;
  121 + _recorder.minRecDuration = 3;
  122 + _recorder.maxRecDuration = [_maxDuration intValue];
120 123  
121 124 }
122 125  
... ... @@ -130,11 +133,20 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
130 133 __weak typeof(self) weakSelf = self;
131 134  
132 135 self.previewView.onEvent = ^(PreViewSubViewIdx idx, int extra) {
133   - NSLog(@"index ------- %lu", (unsigned long)idx);
134 136  
135 137 switch (idx) {
136 138 case PreViewSubViewIdx_Close:
137 139  
  140 + //退出结束预览,停止录制,删除片段
  141 + [weakSelf.recorder stopPreview];
  142 + [weakSelf.recorder stopRecord:^{
  143 +
  144 + }];
  145 +
  146 + if (weakSelf.recorder.recordedVideos.count > 0) {
  147 + [weakSelf.recorder deleteAllRecordedVideo];
  148 + }
  149 + weakSelf.recorder = nil;
138 150 [weakSelf dismissViewControllerAnimated:YES completion:NULL];
139 151  
140 152 break;
... ... @@ -162,10 +174,8 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
162 174  
163 175 case PreViewSubViewIdx_Flash: {
164 176  
165   - __strong __typeof(weakSelf) strongSelf = weakSelf;
166   - if ([strongSelf.recorder isTorchSupported]){
167   - weakSelf.previewView.flashBtn.selected = !weakSelf.previewView.flashBtn.selected;
168   - [strongSelf.recorder toggleTorch];
  177 + if ([weakSelf.recorder isTorchSupported]){
  178 + [weakSelf.recorder toggleTorch];
169 179 }
170 180  
171 181 }
... ... @@ -177,8 +187,9 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
177 187 [strongSelf.recorder switchCamera];
178 188 if (strongSelf.recorder.isTorchSupported) {
179 189 // 显示闪光灯按钮
180   - weakSelf.previewView.flashBtn.hidden = NO;
181   - }
  190 + if (strongSelf.recorder.isTorchSupported) {
  191 + weakSelf.previewView.flashBtn.hidden = NO;
  192 + } }
182 193 else{
183 194 // 隐藏闪光灯按钮
184 195 weakSelf.previewView.flashBtn.hidden = YES;
... ... @@ -217,6 +228,11 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
217 228  
218 229 case PreViewSubViewIdx_Delete: {
219 230  
  231 + int timeCount = weakSelf.count - [[weakSelf.timesArr lastObject] intValue];
  232 + weakSelf.count = timeCount;
  233 + weakSelf.timeLab.text = [NSString stringWithFormat:@"%02d:%02d",timeCount/60, timeCount%60];
  234 + [weakSelf.timesArr removeLastObject];
  235 +
220 236 //删除该文件
221 237 [weakSelf.recorder deleteRecordedVideoAt:weakSelf.recorder.recordedVideos.count -1];
222 238 [weakSelf.previewView.progress removeLastRangeView];
... ... @@ -234,13 +250,18 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
234 250 break;
235 251  
236 252 case PreViewSubViewIdx_Record: {
237   -
  253 +
238 254 __strong __typeof(weakSelf) strongSelf = weakSelf;
  255 +
239 256 if (extra == 0) {//开始录制
  257 +
  258 + weakSelf.tempTime = 0;
  259 +
240 260 if (weakSelf.previewView.progress.lastRangeViewSelected){
241 261 weakSelf.previewView.progress.lastRangeViewSelected = NO;
242 262 weakSelf.previewView.effectsBtn.videoMgrState = kBackSelect;
243 263 }
  264 +
244 265 AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
245 266 if (status != AVAuthorizationStatusAuthorized){
246 267 MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:weakSelf.view animated:YES];
... ... @@ -266,16 +287,16 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
266 287 NSString *strFilePath = [NSString stringWithFormat:@"%@/%@", path,fileName];
267 288 weakSelf.filePath = [NSURL URLWithString:strFilePath];
268 289 weakSelf.startTime = time(0);
269   -// weakSelf.previewView.recordTimeLabel.text = [NSString stringWithHMS:0];
270   - weakSelf.previewView.recordTimeLabel.hidden = NO;
271 290 [weakSelf.recorder startRecord];
272 291  
273 292 if (!weakSelf.recordTimer){
274   - weakSelf.recordTimer = [NSTimer scheduledTimerWithTimeInterval:0.3
  293 + weakSelf.recordTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
275 294 target:weakSelf
276 295 selector:@selector(onCountUp:)
277 296 userInfo:nil
278 297 repeats:YES];
  298 + } else {
  299 + [weakSelf.recordTimer setFireDate:[NSDate date]];
279 300 }
280 301  
281 302 [weakSelf.previewView.progress addRangeView];
... ... @@ -287,6 +308,11 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
287 308 weakSelf.previewView.nextBtn.videoMgrState = kNextSelect;
288 309 }
289 310 if (extra == 1){//停止录制
  311 +
  312 + [weakSelf.timesArr addObject:[NSString stringWithFormat:@"%d", weakSelf.tempTime]];
  313 + NSLog(@"timesArr======%@---%d----%d",weakSelf.timesArr, weakSelf.tempTime, weakSelf.count);
  314 +
  315 + [weakSelf.recordTimer setFireDate:[NSDate distantFuture]];
290 316  
291 317 weakSelf.previewView.recordBtn.enabled = NO;
292 318 [weakSelf.recorder stopRecord:^{
... ... @@ -299,7 +325,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
299 325 weakSelf.previewView.effectsBtn.enabled = YES;
300 326 });
301 327 }];
302   - weakSelf.previewView.recordTimeLabel.hidden = YES;
  328 +
303 329 if (strongSelf.recordTimer && strongSelf.recordTimer.isValid){
304 330 [strongSelf.recordTimer invalidate];
305 331 strongSelf.recordTimer = nil;
... ... @@ -315,6 +341,15 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
315 341  
316 342 case PreViewSubViewIdx_Next: {
317 343  
  344 + if (![CNLiveMediaEditor shareInstance].delegate) {
  345 + [CNLiveMediaEditor shareInstance].delegate = weakSelf;
  346 + }
  347 +
  348 + if (weakSelf.recordTimer) {
  349 + [weakSelf.recordTimer invalidate];
  350 + weakSelf.recordTimer = nil;
  351 + }
  352 +
318 353 NSArray<CNLiveMediaUnit *> * recordedVideos = weakSelf.recorder.recordedVideos;
319 354 if (recordedVideos.count <= 0) return ;
320 355 else{
... ... @@ -397,7 +432,11 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
397 432  
398 433 - (void)onCountUp:(NSTimer *)sender
399 434 {
400   -// self.previewView.recordTimeLabel.text = [NSString stringWithHMS:(int)(time(0) - _startTime)];
  435 + self.count ++;
  436 + self.tempTime ++;
  437 + NSLog(@"tempTime--------%d", _tempTime);
  438 +
  439 + self.timeLab.text = [NSString stringWithFormat:@"%02d:%02d",self.count/60,self.count%60];
401 440 }
402 441  
403 442  
... ... @@ -440,7 +479,6 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
440 479 LVCVideoEditorViewController *vc = [[LVCVideoEditorViewController alloc] initWithUrl:path maxDuration:weakSelf.maxDuration];
441 480 [weakSelf presentViewController:vc animated:YES completion:nil];
442 481 });
443   -
444 482 }
445 483  
446 484 //内部错误回调
... ... @@ -612,6 +650,8 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
612 650 {
613 651 if (!_aeRootView){
614 652 _aeRootView = [[LVCAERootView alloc] initWithFrame:kAERootViewHideFrame];
  653 + _aeRootView.bgmView.originVolumeSlider.value = 1;
  654 + _aeRootView.bgmView.dubVolumeSlider.value = 0.5;
615 655 [(UIView *)[_aeRootView valueForKey:@"decalBtn"] setHidden:YES];
616 656 [(UIView *)[_aeRootView valueForKey:@"textDecalBtn"] setHidden:YES];
617 657 _aeRootView.userInteractionEnabled = YES;
... ... @@ -630,7 +670,6 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
630 670 }else{
631 671 [weakSelf.recorder startPlayBgm:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",model.path] ofType:@"mp3"] isLoop:YES];
632 672 }
633   - weakSelf.aeRootView.bgmView.dubVolumeSlider.value = 0.5;
634 673 weakSelf.aeRootView.bgmView.dubVolumeSlider.enabled = YES;
635 674 [weakSelf.recorder adjustVolume:weakSelf.aeRootView.bgmView.originVolumeSlider.value bgm:0.5];
636 675 }
... ... @@ -674,17 +713,32 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
674 713 return _faceUView;
675 714 }
676 715  
  716 +- (UILabel *)timeLab
  717 +{
  718 + if (!_timeLab) {
  719 + _timeLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 50, KScreenWidth, 20)];
  720 + _timeLab.textColor = [UIColor redColor];
  721 + _timeLab.font = [UIFont systemFontOfSize:14];
  722 + _timeLab.textAlignment = NSTextAlignmentCenter;
  723 + _timeLab.text = @"00:00";
  724 + }
  725 + return _timeLab;
  726 +}
  727 +
677 728 - (void)dealloc
678 729 {
679 730 if (self.recorder){
680 731 [self.recorder stopPreview];
681 732 [self.recorder stopRecord:nil];
682 733 self.recorder = nil;
  734 + self.recorder.delegate = nil;
683 735 }
684   -
  736 + _faceUView.delegate = nil;
  737 + _beautyView.delegate = nil;
  738 + [CNLiveMediaEditor shareInstance].delegate = nil;
  739 +
685 740 NSLog(@"PreviewViewController dealloc");
686 741  
687   - [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
688 742 }
689 743  
690 744 - (void)didReceiveMemoryWarning {
... ...
LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCShortVideoListViewController.m
... ... @@ -7,30 +7,262 @@
7 7 //
8 8  
9 9 #import "LVCShortVideoListViewController.h"
10   -#import "CfgViewController.h"
  10 +#import "LVCShortVideoController.h"
  11 +#import "LVCVideoConfigView.h"
  12 +#import "LVCShortVideoPlayerController.h"
  13 +#import "CommonCrypto/CommonDigest.h"
  14 +#import "LVCShortVideoListCell.h"
11 15  
12   -@interface LVCShortVideoListViewController ()
  16 +#define ListUrl @"http://test.open.cnlive.com/openapi/api2/vod_epg/sp/shortVideoList4APP"
  17 +
  18 +@interface LVCShortVideoListViewController ()<UITableViewDelegate, UITableViewDataSource>
  19 +
  20 +@property (nonatomic, strong) LVCVideoConfigView *videoCfgView;
  21 +@property (nonatomic, strong) NSMutableArray *listArr;
  22 +@property (nonatomic, strong) UITableView *tableView;
13 23  
14 24 @end
15 25  
16 26 @implementation LVCShortVideoListViewController
17 27  
  28 +- (void)viewWillAppear:(BOOL)animated {
  29 + [super viewWillAppear:animated];
  30 + [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
  31 +
  32 + [self.tableView.header beginRefreshing];
  33 +
  34 +}
  35 +
18 36 - (void)viewDidLoad {
19 37 [super viewDidLoad];
20 38 // Do any additional setup after loading the view.
21 39  
  40 + self.title = @"我的视频";
  41 +
22 42 UIButton *recordBtn = [UIButton buttonWithType:UIButtonTypeCustom];
23 43 recordBtn.frame = CGRectMake(0, 0, 30, 30);
24 44 [recordBtn setImage:[UIImage imageNamed:@"REC"] forState:UIControlStateNormal];
25 45 [recordBtn addTarget:self action:@selector(recordBtnAction) forControlEvents:UIControlEventTouchUpInside];
26 46 UIBarButtonItem *recordBtnItem = [[UIBarButtonItem alloc] initWithCustomView:recordBtn];
27 47 self.navigationItem.rightBarButtonItem = recordBtnItem;
  48 +
  49 +
  50 + [self videoCfgViewAction];
28 51  
  52 +
  53 + [self.view addSubview:self.tableView];
  54 +
  55 +}
  56 +
  57 +- (void)requestListPage:(NSString *)page isRefresh:(BOOL)refresh {
  58 +
  59 + NSDate *curDate = [NSDate date];
  60 + NSInteger time = [curDate timeIntervalSince1970];
  61 + NSString *timeString = [NSString stringWithFormat:@"%ld", (long)time];
  62 +
  63 + NSMutableDictionary *parameter = [@{@"appId":UserAppId,
  64 + @"page":page ? page : @"1",
  65 + @"pageSize":@"15",
  66 + @"platform_id":[NSBundle mainBundle].bundleIdentifier,
  67 + @"timestamp":timeString
  68 + } copy];
  69 +
  70 + NSMutableDictionary *para = [self encryptionSignWithParameter:parameter];
  71 +
  72 + [[AFHTTPRequestOperationManager manager] GET:ListUrl parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) {
  73 +
  74 + if (responseObject[@"errorCode"] && [responseObject[@"errorCode"]isEqualToString:@"0"]) {
  75 +
  76 + if (refresh) {
  77 + [self.listArr removeAllObjects];
  78 + }
  79 +
  80 + for (NSDictionary *dic in responseObject[@"data"][@"list"]) {
  81 + ShortVideoModel *model = [ShortVideoModel mj_objectWithKeyValues:dic];
  82 + model.des = dic[@"description"];
  83 + [self.listArr addObject:model];
  84 + }
  85 +
  86 + [self.tableView.header endRefreshing];
  87 + [self.tableView reloadData];
  88 +
  89 + } else {
  90 +
  91 + [self.tableView.header endRefreshing];
  92 +
  93 + }
  94 +
  95 + } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
  96 +
  97 + NSLog(@"error--%@", error);
  98 +
  99 + [_tableView.header endRefreshing];
  100 +
  101 + }];
  102 +
  103 +}
  104 +
  105 +#pragma mark -
  106 +#pragma mark - Action
  107 +- (void)videoCfgViewAction {
  108 +
  109 + __weak typeof(self) weakSelf = self;
  110 +
  111 + self.videoCfgView.VideoCfgViewBlock = ^(VideoCfgViewAction event) {
  112 + if (event == VideoCfgViewActionCancel) {
  113 + [weakSelf.videoCfgView removeFromSuperview];
  114 + } else {
  115 +
  116 + //鉴权
  117 + [[CNLiveMediaEditor shareInstance] registerCNMediaEditorKit:^(NSString *maxDuration) {
  118 +
  119 + dispatch_async(dispatch_get_main_queue(), ^{
  120 +
  121 + LVCShortVideoController *cfgVC = [[LVCShortVideoController alloc] init];
  122 + cfgVC.maxDuration = maxDuration;
  123 + [weakSelf presentViewController:cfgVC animated:YES completion:NULL];
  124 + [weakSelf.videoCfgView removeFromSuperview];
  125 +
  126 + });
  127 +
  128 + } failure:^(NSDictionary *errorDic) {
  129 +
  130 + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"鉴权失败, 请重试!" delegate:nil cancelButtonTitle:@"好 的" otherButtonTitles:nil, nil];
  131 + [alertView show];
  132 + [weakSelf.videoCfgView removeFromSuperview];
  133 + }];
  134 +
  135 + }
  136 + };
29 137 }
30 138  
31 139 - (void)recordBtnAction {
32   - CfgViewController *cfgVC = [[CfgViewController alloc] init];
33   - [self presentViewController:cfgVC animated:YES completion:NULL];
  140 +
  141 + [UIView animateWithDuration:0.25 animations:^{
  142 + self.videoCfgView.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
  143 + [self.view addSubview:self.videoCfgView];
  144 + }];
  145 +
  146 +}
  147 +
  148 +- (void)refresh {
  149 + [self requestListPage:@"1" isRefresh:YES];
  150 +}
  151 +
  152 +#pragma mark -
  153 +#pragma mark -
  154 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  155 + return _listArr.count;
  156 +}
  157 +
  158 +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  159 +
  160 + static NSString *cellId = @"ShortVideoListCell";
  161 + LVCShortVideoListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
  162 +
  163 + if (!cell) {
  164 + cell = [[LVCShortVideoListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
  165 + }
  166 + cell.selectionStyle = UITableViewCellSelectionStyleNone;
  167 + ShortVideoModel *model = _listArr[indexPath.row];
  168 + cell.model = model;
  169 +
  170 + return cell;
  171 +}
  172 +
  173 +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  174 + return 100;
  175 +}
  176 +
  177 +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  178 + ShortVideoModel *model = _listArr[indexPath.row];
  179 + LVCShortVideoPlayerController *playerVC = [[LVCShortVideoPlayerController alloc] initWithModel:model];
  180 + [self presentViewController:playerVC animated:YES completion:NULL];
  181 +}
  182 +
  183 +#pragma mark -
  184 +#pragma mark - 加密
  185 +- (NSMutableDictionary *)encryptionSignWithParameter:(NSMutableDictionary *)parameter
  186 +{
  187 + NSString *string = [NSString stringWithFormat:@"%@&key=%@",[self signvalue:parameter],UserAppKey];
  188 + NSString *signString = [[self sha1:string] uppercaseString];
  189 + NSMutableDictionary *startPara = [NSMutableDictionary dictionaryWithDictionary:parameter];
  190 + [startPara setObject:signString forKey:@"sign"];
  191 + return startPara;
  192 +}
  193 +
  194 +- (NSString*)sha1:(NSString *)string
  195 +{
  196 + NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
  197 +
  198 + uint8_t digest[CC_SHA1_DIGEST_LENGTH];
  199 +
  200 + CC_SHA1(data.bytes, data.length, digest);
  201 +
  202 + NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2];
  203 +
  204 + for(int i = 0; i < CC_SHA1_DIGEST_LENGTH; i++)
  205 + [output appendFormat:@"%02x", digest[i]];
  206 +
  207 + while ([[output substringToIndex:1] isEqualToString:@"0"]) {
  208 + output = [[NSMutableString alloc] initWithString:[output substringFromIndex:1]];
  209 + }
  210 +
  211 + return output;
  212 +}
  213 +
  214 +- (NSString *)signvalue:(NSDictionary*)parameter
  215 +{
  216 + //对所有传入参数按照字段名的 ASCII 码从小到大排序
  217 + NSArray *keyArr=[parameter allKeys];
  218 + NSArray *arr = [keyArr sortedArrayUsingSelector:@selector(compare:)];
  219 +
  220 + NSMutableString *string1 = [[NSMutableString alloc]init];
  221 + for (int i=0; i<arr.count; i++) {
  222 +
  223 + NSString *parameterString = parameter[[arr objectAtIndex:i]];
  224 + if (parameterString.length > 0) {
  225 + [string1 appendString:[NSString stringWithFormat:@"%@=%@&",[arr objectAtIndex:i],parameter[[arr objectAtIndex:i]]]];
  226 + }
  227 + }
  228 +
  229 + if (string1.length > 0) {
  230 + [string1 deleteCharactersInRange:NSMakeRange(string1.length-1, 1)];
  231 + }
  232 +
  233 + return string1;
  234 +}
  235 +
  236 +#pragma mark -
  237 +#pragma mark - getter
  238 +- (LVCVideoConfigView *)videoCfgView
  239 +{
  240 + if (!_videoCfgView) {
  241 + _videoCfgView = [[LVCVideoConfigView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
  242 + }
  243 + return _videoCfgView;
  244 +}
  245 +
  246 +- (UITableView *)tableView
  247 +{
  248 + if (!_tableView) {
  249 + _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight-64) style:UITableViewStylePlain];
  250 + _tableView.tableFooterView = [[UIView alloc] init];
  251 + _tableView.delegate = self;
  252 + _tableView.dataSource = self;
  253 +
  254 + _tableView.header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refresh)];
  255 +
  256 + }
  257 + return _tableView;
  258 +}
  259 +
  260 +- (NSMutableArray *)listArr
  261 +{
  262 + if (!_listArr) {
  263 + _listArr = [[NSMutableArray alloc] init];
  264 + }
  265 + return _listArr;
34 266 }
35 267  
36 268 - (void)didReceiveMemoryWarning {
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPregressView.h renamed to LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCShortVideoPlayerController.h
1 1 //
2   -// LVCPregressView.h
  2 +// LVCShortVideoPlayerController.h
3 3 // LiveVideoCloud
4 4 //
5   -// Created by iOS on 2017/7/10.
  5 +// Created by iOS on 2017/7/14.
6 6 // Copyright © 2017年 cnlive. All rights reserved.
7 7 //
8 8  
9 9 #import <UIKit/UIKit.h>
  10 +#import "LVCShortVideoListCell.h"
10 11  
11   -@interface LVCPregressView : UIView
  12 +@interface LVCShortVideoPlayerController : UIViewController
  13 +
  14 +- (instancetype)initWithModel:(ShortVideoModel *)model;
12 15  
13 16 @end
... ...
LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCShortVideoPlayerController.m 0 → 100644
  1 +//
  2 +// LVCShortVideoPlayerController.m
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by iOS on 2017/7/14.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "LVCShortVideoPlayerController.h"
  10 +#import "LVCShortVideoPlayerView.h"
  11 +
  12 +@interface LVCShortVideoPlayerController ()<LVCShortVideoPlayerViewDelegate>
  13 +
  14 +@property (nonatomic, strong) LVCShortVideoPlayerView *playerView;
  15 +@property (nonatomic, strong) ShortVideoModel *model;
  16 +
  17 +@end
  18 +
  19 +@implementation LVCShortVideoPlayerController
  20 +
  21 +- (instancetype)initWithModel:(ShortVideoModel *)model {
  22 +
  23 + if (self = [super init]){
  24 + _model = model;
  25 +
  26 + }
  27 + return self;
  28 +}
  29 +
  30 +- (void)viewDidLoad {
  31 + [super viewDidLoad];
  32 + // Do any additional setup after loading the view.
  33 + self.view.backgroundColor = [UIColor whiteColor];
  34 +
  35 + [self.view addSubview:self.playerView];
  36 +
  37 +
  38 +}
  39 +
  40 +#pragma mark -
  41 +#pragma mark - LVCShortVideoPlayerViewDelegate
  42 +- (void)closeShaortVideoPlayerView:(LVCShortVideoPlayerView *)playerView {
  43 + [self dismissViewControllerAnimated:YES completion:NULL];
  44 +}
  45 +
  46 +#pragma mark -
  47 +#pragma mark - getter
  48 +- (LVCShortVideoPlayerView *)playerView
  49 +{
  50 + if (!_playerView) {
  51 + _playerView = [[LVCShortVideoPlayerView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
  52 + _playerView.delegate = self;
  53 + _playerView.model = _model;
  54 + }
  55 + return _playerView;
  56 +}
  57 +
  58 +- (void)didReceiveMemoryWarning {
  59 + [super didReceiveMemoryWarning];
  60 + // Dispose of any resources that can be recreated.
  61 +}
  62 +
  63 +/*
  64 +#pragma mark - Navigation
  65 +
  66 +// In a storyboard-based application, you will often want to do a little preparation before navigation
  67 +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  68 + // Get the new view controller using [segue destinationViewController].
  69 + // Pass the selected object to the new view controller.
  70 +}
  71 +*/
  72 +
  73 +@end
... ...
LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCVideoEditorViewController.m
... ... @@ -21,7 +21,6 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
21 21  
22 22 @interface LVCVideoEditorViewController ()<TrimViewDelegate, CNLiveMediaEditorDelegate, CNLiveVideoPreviewPlayerDelegate, FilterChoiceViewDelegate>
23 23 {
24   - NSURL *_videoPath; //文件路径
25 24 NSString *_maxDuration; //最大时长
26 25  
27 26 VideoMetaInfos *videoMeta;
... ... @@ -43,6 +42,7 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
43 42 @property (nonatomic, assign) CGPoint ori_center;
44 43 @property (nonatomic, assign) CGFloat curScale;
45 44 @property (nonatomic, weak) MBProgressHUD *progressHud;
  45 +@property (nonatomic, strong) NSURL *videoPath; //文件路径
46 46  
47 47 @end
48 48  
... ... @@ -54,7 +54,7 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
54 54  
55 55 _videoPath = path;
56 56 isThumbnailListAdd = NO;
57   - _maxDuration = @"5";
  57 + _maxDuration = maxDuration;
58 58  
59 59 CNLiveStatusCode rc = [[CNLiveMediaEditor shareInstance] addVideo:path];
60 60  
... ... @@ -83,6 +83,10 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
83 83 [self mediaEditorCfg];
84 84 [self getThumbnails];
85 85 [self topViewAction];
  86 +
  87 + if (CMTimeGetSeconds(videoMeta.duration) > [_maxDuration floatValue]) {
  88 + [_topView showError:[NSString stringWithFormat:@"最大时长为:%@s",_maxDuration]];
  89 + }
86 90 }
87 91  
88 92 - (void)mediaEditorCfg {
... ... @@ -188,12 +192,17 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
188 192 _topView.EditorTopViewBlock = ^(EditorTopStytle type) {
189 193 switch (type) {
190 194 case EditorTopStytleBack: { //返回
  195 +
191 196 [[CNLiveMediaEditor shareInstance] stopPreview];
  197 +
  198 + //删除合成后文件
  199 + NSFileManager *fileManager = [NSFileManager defaultManager];
  200 + [fileManager removeItemAtPath:[weakSelf.videoPath path] error:nil];
192 201 [weakSelf dismissViewControllerAnimated:YES completion:nil];
193 202 }
194 203 break;
195 204  
196   - case EditorTopStytleNext: { //下一页
  205 + case EditorTopStytleNext: {
197 206 [weakSelf onProcessVideo];
198 207 }
199 208 break;
... ... @@ -282,6 +291,12 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
282 291 }
283 292  
284 293 - (void)onComposeFinish:(NSURL *)path thumbnail:(UIImage *)thumbnail {
  294 +
  295 + //删除合成后文件
  296 + NSFileManager *fileManager = [NSFileManager defaultManager];
  297 + [fileManager removeItemAtPath:[self.videoPath path] error:nil];
  298 + self.videoPath = path;
  299 +
285 300 dispatch_async(dispatch_get_main_queue(), ^{
286 301 [MBProgressHUD hideHUDForView:self.view animated:YES];
287 302 [self.view addSubview:self.publishView];
... ... @@ -398,6 +413,9 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
398 413 dispatch_async(dispatch_get_main_queue(), ^{
399 414 [_progressHud hideAnimated:YES];
400 415 [_publishView setPublishStatus:PublishStatusFinish];
  416 +
  417 + [(UIView *)[_publishView valueForKey:@"cancelBtn"] setHidden:YES];
  418 +
401 419 //删除合成后文件
402 420 NSFileManager *fileManager = [NSFileManager defaultManager];
403 421 [fileManager removeItemAtPath:[_videoPath path] error:nil];
... ... @@ -674,6 +692,8 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
674 692 {
675 693 if (!_bottomView) {
676 694 _bottomView = [[LVCEditorBottomView alloc] initWithFrame:CGRectMake(0, KScreenHeight-262, KScreenWidth, 262)];
  695 + _bottomView.aeView.bgmView.originVolumeSlider.value = 1;
  696 + _bottomView.aeView.bgmView.dubVolumeSlider.value = 0.5;
677 697 _bottomView.trimView.delegate = self;
678 698 _bottomView.filterView.delegate = self;
679 699  
... ... @@ -687,8 +707,7 @@ FOUNDATION_EXPORT NSString *const KSYThumbnailHeight;
687 707 [[CNLiveMediaEditor shareInstance] addBgm:nil loop:YES];
688 708 }else{
689 709 [[CNLiveMediaEditor shareInstance] addBgm:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",model.path] ofType:@"mp3"] loop:YES];
690   - weakSelf.bottomView.aeView.bgmView.originVolumeSlider.value = 1;
691   - weakSelf.bottomView.aeView.bgmView.dubVolumeSlider.value = 0.5;
  710 +
692 711 weakSelf.bottomView.aeView.bgmView.dubVolumeSlider.enabled = YES;
693 712 [[CNLiveMediaEditor shareInstance] adjustVolume:weakSelf.bottomView.aeView.bgmView.originVolumeSlider.value bgm:0.5];
694 713 }
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPregressView.m deleted 100644 → 0
1   -//
2   -// LVCPregressView.m
3   -// LiveVideoCloud
4   -//
5   -// Created by iOS on 2017/7/10.
6   -// Copyright © 2017年 cnlive. All rights reserved.
7   -//
8   -
9   -#import "LVCPregressView.h"
10   -
11   -@implementation LVCPregressView
12   -
13   -/*
14   -// Only override drawRect: if you perform custom drawing.
15   -// An empty implementation adversely affects performance during animation.
16   -- (void)drawRect:(CGRect)rect {
17   - // Drawing code
18   -}
19   -*/
20   -
21   -@end
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPreviewView.h
... ... @@ -33,7 +33,6 @@ typedef NS_ENUM(NSUInteger, PreViewSubViewIdx){
33 33 @property (nonatomic, strong) UIButton *beautyBtn; //美颜滤镜
34 34 @property (nonatomic, strong) UIButton *recordBtn; //录制
35 35 @property (nonatomic, strong) LVCVideoMgrButton *effectsBtn; //动态贴纸
36   -@property (nonatomic, strong) UILabel *recordTimeLabel; //时间
37 36 @property (nonatomic, strong) LVCVideoMgrButton *nextBtn; //next
38 37 @property (nonatomic, strong) UIButton *funcBtn; //更多功能
39 38 @property (nonatomic, strong) UIButton *localBtn; //更多功能
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPreviewView.m
... ... @@ -193,18 +193,6 @@
193 193 return _effectsBtn;
194 194 }
195 195  
196   --(UILabel *)recordTimeLabel
197   -{
198   - if (!_recordTimeLabel){
199   - _recordTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(KScreenWidth-120, 75, 100, 20)];
200   -// _recordTimeLabel.text = [NSString stringWithHMS:0];
201   - _recordTimeLabel.textColor = [UIColor redColor];
202   - _recordTimeLabel.font = [UIFont systemFontOfSize:20];
203   - _recordTimeLabel.textAlignment = NSTextAlignmentRight;
204   - _recordTimeLabel.hidden = YES;
205   - }
206   - return _recordTimeLabel;
207   -}
208 196  
209 197 /*
210 198 // Only override drawRect: if you perform custom drawing.
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPublishView.m
... ... @@ -121,6 +121,8 @@
121 121 _titleField.layer.borderWidth = 1;
122 122 _titleField.layer.borderColor = [UIColor colorWithHexString:@"#dededd"].CGColor;
123 123 _titleField.text = @"cnlive ios title";
  124 + _titleField.clearButtonMode = UITextFieldViewModeWhileEditing;
  125 +
124 126  
125 127 UILabel *desLab = [[UILabel alloc] initWithFrame:CGRectMake(10, self.thumbView.bottom+2, self.baseView.width-20, 30)];
126 128 desLab.text = @"标题:";
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCShortVideoListCell.h 0 → 100644
  1 +//
  2 +// LVCShortVideoListCell.h
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by iOS on 2017/7/14.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +@class ShortVideoModel;
  12 +
  13 +@interface LVCShortVideoListCell : UITableViewCell
  14 +
  15 +@property (nonatomic, strong) ShortVideoModel *model;
  16 +
  17 +@end
  18 +
  19 +//视频model
  20 +@interface ShortVideoModel : NSObject
  21 +
  22 +@property (nonatomic, strong) NSString *img;
  23 +@property (nonatomic, strong) NSString *name;
  24 +@property (nonatomic, strong) NSString *des;
  25 +@property (nonatomic, strong) NSString *createTime;
  26 +@property (nonatomic, strong) NSString *videoId;
  27 +@end
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCShortVideoListCell.m 0 → 100644
  1 +//
  2 +// LVCShortVideoListCell.m
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by iOS on 2017/7/14.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "LVCShortVideoListCell.h"
  10 +
  11 +@interface LVCShortVideoListCell ()
  12 +
  13 +@property (nonatomic, strong) UIImageView *imgView;
  14 +@property (nonatomic, strong) UILabel *titleLab;
  15 +@property (nonatomic, strong) UILabel *descLab;
  16 +@property (nonatomic, strong) UILabel *createTimeLab;
  17 +
  18 +@end
  19 +
  20 +@implementation LVCShortVideoListCell
  21 +
  22 +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
  23 +
  24 + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  25 +
  26 + if (self) {
  27 +
  28 + [self.contentView addSubview:self.imgView];
  29 + [self.contentView addSubview:self.titleLab];
  30 + [self.contentView addSubview:self.descLab];
  31 + [self.contentView addSubview:self.createTimeLab];
  32 +
  33 + }
  34 + return self;
  35 +}
  36 +
  37 +- (void)setModel:(ShortVideoModel *)moedel {
  38 + _titleLab.text = moedel.name ? moedel.name : @"我是标题";
  39 + _descLab.text = moedel.des ? moedel.des : @"我是描述";
  40 + _createTimeLab.text = [self convertStrToTime:moedel.createTime];
  41 + [_imgView sd_setImageWithURL:[NSURL URLWithString:moedel.img] placeholderImage:[UIImage imageNamed:@"sv_ placeholder"]];
  42 +}
  43 +
  44 +
  45 +- (NSString *)convertStrToTime:(NSString *)timeStr {
  46 +
  47 + long long time=[timeStr longLongValue];
  48 +
  49 + NSDate *d = [[NSDate alloc]initWithTimeIntervalSince1970:time/1000.0];
  50 +
  51 + NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
  52 +
  53 + [formatter setDateFormat:@"yyyy/MM/dd HH:mm:ss"];
  54 +
  55 + NSString*timeString=[formatter stringFromDate:d];
  56 +
  57 + return timeString;
  58 +
  59 +}
  60 +
  61 +#pragma mark -
  62 +#pragma mark - getter
  63 +- (UIImageView *)imgView
  64 +{
  65 + if (!_imgView) {
  66 + _imgView = [[UIImageView alloc] initWithFrame:CGRectMake(20, 10, 140, 140*9/16)];
  67 + }
  68 + return _imgView;
  69 +}
  70 +
  71 +- (UILabel *)titleLab
  72 +{
  73 + if (!_titleLab) {
  74 + _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(_imgView.right+15, 20, KScreenWidth-150, 20)];
  75 + _titleLab.text = @"我是标题~~~~";
  76 + }
  77 + return _titleLab;
  78 +}
  79 +
  80 +- (UILabel *)descLab
  81 +{
  82 + if (!_descLab) {
  83 + _descLab = [[UILabel alloc] initWithFrame:CGRectMake(_imgView.right+15, _titleLab.bottom+10, KScreenWidth-160, 15)];
  84 + _descLab.textColor = [UIColor lightGrayColor];
  85 + _descLab.text = @"我是描述~~~~";
  86 + _descLab.font = [UIFont systemFontOfSize:13];
  87 + }
  88 + return _descLab;
  89 +}
  90 +
  91 +- (UILabel *)createTimeLab
  92 +{
  93 + if (!_createTimeLab) {
  94 + _createTimeLab = [[UILabel alloc] initWithFrame:CGRectMake(KScreenWidth-210, _descLab.bottom+5, 200, 20)];
  95 + _createTimeLab.textAlignment = NSTextAlignmentRight;
  96 + _createTimeLab.font = [UIFont systemFontOfSize:12];
  97 + _createTimeLab.textColor = [UIColor lightGrayColor];
  98 + }
  99 + return _createTimeLab;
  100 +}
  101 +
  102 +- (void)awakeFromNib {
  103 + [super awakeFromNib];
  104 + // Initialization code
  105 +}
  106 +
  107 +- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  108 + [super setSelected:selected animated:animated];
  109 +
  110 + // Configure the view for the selected state
  111 +}
  112 +
  113 +@end
  114 +
  115 +@implementation ShortVideoModel
  116 +
  117 +@end
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCShortVideoPlayerView.h 0 → 100644
  1 +//
  2 +// LVCShortVideoPlayerView.h
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by iOS on 2017/7/14.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +#import "LVCShortVideoListCell.h"
  11 +
  12 +@class LVCShortVideoPlayerView;
  13 +
  14 +@protocol LVCShortVideoPlayerViewDelegate <NSObject>
  15 +
  16 +- (void)closeShaortVideoPlayerView:(LVCShortVideoPlayerView *)playerView;
  17 +
  18 +@end
  19 +
  20 +@interface LVCShortVideoPlayerView : UIView
  21 +
  22 +@property (nonatomic, assign) id<LVCShortVideoPlayerViewDelegate> delegate;
  23 +
  24 +@property (nonatomic, strong) ShortVideoModel *model;
  25 +
  26 +@end
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCShortVideoPlayerView.m 0 → 100644
  1 +//
  2 +// LVCShortVideoPlayerView.m
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by iOS on 2017/7/14.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "LVCShortVideoPlayerView.h"
  10 +#import "LVCPlayerLoadingView.h"
  11 +
  12 +@interface LVCShortVideoPlayerView ()<UIGestureRecognizerDelegate>
  13 +{
  14 + BOOL _hidenToolBar;
  15 + BOOL _noInternet;
  16 + NSTimer *_currentTimer;
  17 +}
  18 +
  19 +@property (nonatomic, strong) UIView *topView;
  20 +@property (nonatomic, strong) UIView *bottomView;
  21 +@property (nonatomic, strong) UILabel *descLab;
  22 +@property (nonatomic, strong) UILabel *titleLab;
  23 +@property (nonatomic, strong) UIButton *playBtn;
  24 +@property (nonatomic, strong) UILabel *startLab;
  25 +@property (nonatomic, strong) UILabel *endLab;
  26 +@property (nonatomic, strong) UISlider *slider;
  27 +@property (nonatomic, strong) UIButton *backBtn;
  28 +@property (nonatomic, strong) UIView *bottomToolBar;
  29 +@property (nonatomic, strong) CNLiveMoviePlayerController *player;
  30 +@property (nonatomic, strong) LVCPlayerLoadingView *loadingView; //加载图
  31 +@property (nonatomic, strong) UITapGestureRecognizer *singleTap; //单击手势
  32 +@property (nonatomic, strong) UIProgressView *bufferProgress;
  33 +
  34 +@end
  35 +
  36 +@implementation LVCShortVideoPlayerView
  37 +
  38 +- (instancetype)initWithFrame:(CGRect)frame
  39 +{
  40 + self = [super initWithFrame:frame];
  41 + if (self) {
  42 +
  43 + self.backgroundColor = [UIColor blackColor];
  44 +
  45 + [self addSubview:self.loadingView];
  46 + [self addSubview:self.topView];
  47 + [self addSubview:self.bottomView];
  48 +
  49 + [self.topView addSubview:self.backBtn];
  50 + [self.topView addSubview:self.titleLab];
  51 + [self.bottomView addSubview:self.bottomToolBar];
  52 + [self.bottomView addSubview:self.descLab];
  53 + [self.bottomToolBar addSubview:self.playBtn];
  54 + [self.bottomToolBar addSubview:self.startLab];
  55 + [self.bottomToolBar addSubview:self.endLab];
  56 + [self.bottomToolBar addSubview:self.slider];
  57 + [self addGestureRecognizer:self.singleTap];
  58 +
  59 + _currentTimer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(timeChange) userInfo:nil repeats:YES];
  60 + }
  61 + return self;
  62 +}
  63 +
  64 +- (void)initPlayerWithVid:(NSString *)vid {
  65 + if (!_player) {
  66 + _player.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
  67 + _player = [[CNLiveMoviePlayerController alloc] initVodPlayWithVId:vid authSuccess:^{
  68 + _player.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight);
  69 + [self addObservers];
  70 + _player.videoDecoderMode = CNLiveMovieVideoDecoderMode_AUTO; //自动解码
  71 + _player.shouldAutoplay = YES; //自动播放
  72 + [_player prepareToPlay];
  73 + [self addSubview:_player.view];
  74 + [self sendSubviewToBack:_player.view];
  75 +
  76 + NSLog(@"播放器初始化成功");
  77 +
  78 + } authFailed:^(NSDictionary *errorInfo) {
  79 +
  80 + NSLog(@"初始化点播播放器失败%@", errorInfo);
  81 + [SVProgressHUD showInfoWithStatus:@"抱歉,加载失败~"];
  82 + [_loadingView stopLoading];
  83 +
  84 + }];
  85 + }
  86 +}
  87 +
  88 +- (void)setModel:(ShortVideoModel *)model {
  89 + [self initPlayerWithVid:model.videoId];
  90 + _titleLab.text = model.name;
  91 + _descLab.text = model.des;
  92 +}
  93 +
  94 +#pragma mark -
  95 +#pragma mark - Action
  96 +//播放/暂停
  97 +- (void)playOrPauseBtnAction:(UIButton *)btn
  98 +{
  99 + if (btn.selected) {
  100 + [_player pause];
  101 + } else {
  102 + [_player play];
  103 + }
  104 +
  105 + btn.selected =! btn.selected;
  106 +
  107 +}
  108 +
  109 +- (void)backBtnAction {
  110 +
  111 + if (_player.isPlaying) {
  112 + [_player pause];
  113 + }
  114 + [_player stop];
  115 + [_player destroyPlayer];
  116 + _player = nil;
  117 +
  118 + if (_currentTimer && [_currentTimer isValid]) {
  119 + [_currentTimer invalidate];
  120 + _currentTimer = nil;
  121 + }
  122 +
  123 + [self removeMovieNotificationObservers];
  124 +
  125 + if (self.delegate && [self.delegate respondsToSelector:@selector(closeShaortVideoPlayerView:)]) {
  126 + [self.delegate closeShaortVideoPlayerView:self];
  127 + }
  128 +}
  129 +
  130 +- (void)singleTapView {
  131 +
  132 + if (_hidenToolBar) {
  133 +
  134 + [UIView animateWithDuration:0.25 animations:^{
  135 + _topView.y = 0;
  136 + _bottomView.y = KScreenHeight-90;
  137 + }];
  138 +
  139 + } else {
  140 +
  141 + [UIView animateWithDuration:0.25 animations:^{
  142 + _topView.y = -64;
  143 + _bottomView.y = KScreenHeight-40;
  144 + }];
  145 + }
  146 +
  147 + _hidenToolBar = !_hidenToolBar;
  148 +}
  149 +
  150 +- (void)beginScrubbing
  151 +{
  152 + [_player pause];
  153 +}
  154 +
  155 +- (void)endScrubbing
  156 +{
  157 + [_player setCurrentPlaybackTime:_slider.value];
  158 + [_player play];
  159 +}
  160 +
  161 +
  162 +- (void)timeChange
  163 +{
  164 + _bufferProgress.progress = _player.playableDuration/_player.duration;
  165 + if (!_player.isPreparedToPlay) {
  166 + return;
  167 + }
  168 +
  169 + _slider.value = _player.currentPlaybackTime;
  170 + _slider.maximumValue = _player.duration;
  171 +
  172 + NSInteger currentSeconds = (NSInteger)_player.currentPlaybackTime;
  173 + NSInteger seconds = currentSeconds % 60;
  174 + NSInteger minutes = currentSeconds / 60;
  175 + NSInteger hours = minutes / 60;
  176 +
  177 + NSInteger durationall = (NSInteger)_player.duration;
  178 + NSInteger durationSeconds = durationall % 60;
  179 + NSInteger durationMinutes = durationall / 60;
  180 + NSInteger durationHours = durationMinutes / 60;
  181 +
  182 + _startLab.text = [NSString stringWithFormat:@"%02ld:%02ld:%02ld", (long)hours, (long)minutes%60, (long)seconds];
  183 + _endLab.text = [NSString stringWithFormat:@"%02ld:%02ld:%02ld", (long)durationHours, (long)durationMinutes%60, (long)durationSeconds];
  184 +}
  185 +
  186 +
  187 +#pragma mark -
  188 +#pragma mark - Notification
  189 +- (void)addObservers
  190 +{
  191 + //视频加载状态改变
  192 + [[NSNotificationCenter defaultCenter] addObserver:self
  193 + selector:@selector(loadStateDidChange:)
  194 + name:MPMoviePlayerLoadStateDidChangeNotification
  195 + object:nil];
  196 +
  197 + //视频播放错误及结束原因
  198 + [[NSNotificationCenter defaultCenter] addObserver:self
  199 + selector:@selector(moviePlayBackDidFinish:)
  200 + name:MPMoviePlayerPlaybackDidFinishNotification
  201 + object:nil];
  202 +
  203 + //视频缓冲至可播放状态
  204 + [[NSNotificationCenter defaultCenter] addObserver:self
  205 + selector:@selector(mediaIsPreparedToPlayDidChange:)
  206 + name:MPMediaPlaybackIsPreparedToPlayDidChangeNotification
  207 + object:nil];
  208 +
  209 + //视频播放状态改变
  210 + [[NSNotificationCenter defaultCenter] addObserver:self
  211 + selector:@selector(moviePlayBackStateDidChange:)
  212 + name:MPMoviePlayerPlaybackStateDidChangeNotification
  213 + object:nil];
  214 +
  215 + //网络状态改变
  216 + [[NSNotificationCenter defaultCenter] addObserver:self
  217 + selector:@selector(moviePlayerNetworkStatusChange:)
  218 + name:MPMoviePlayerNetworkStatusChangeNotification
  219 + object:nil];
  220 +
  221 + [[NSNotificationCenter defaultCenter] addObserver:self
  222 + selector:@selector(appResignActive:)
  223 + name:UIApplicationWillResignActiveNotification
  224 + object:nil];
  225 +
  226 + [[NSNotificationCenter defaultCenter] addObserver:self
  227 + selector:@selector(appBecomeActive:)
  228 + name:UIApplicationDidBecomeActiveNotification
  229 + object:nil];
  230 +}
  231 +
  232 +//加载状态通知
  233 +- (void)loadStateDidChange:(NSNotification *)notification
  234 +{
  235 + if (_player) {
  236 + MPMovieLoadState loadState = _player.loadState;
  237 + if ((loadState & MPMovieLoadStatePlaythroughOK) != 0) { //加载完成
  238 + [_loadingView setLVCPlayerStatus:LVCPlayerStatusStopLoading];
  239 +
  240 + NSLog(@"loadStateDidChange: MPMovieLoadStatePlaythroughOK: %d\n", (int)loadState);
  241 +
  242 + } else if ((loadState & MPMovieLoadStateStalled) != 0) { //视频正在加载中
  243 + [_loadingView setLVCPlayerStatus:LVCPlayerStatusStartLoading];
  244 + NSLog(@"loadStateDidChange: MPMovieLoadStateStalled: %d\n", (int)loadState);
  245 +
  246 + } else {
  247 + NSLog(@"loadStateDidChange: ???: %d\n", (int)loadState);
  248 + }
  249 + }
  250 +}
  251 +
  252 +//播放完成通知,当状态为MPMovieFinishReasonPlaybackError时为异常结束,应显示重试页面
  253 +- (void)moviePlayBackDidFinish:(NSNotification *)notification
  254 +{
  255 + if (_player) {
  256 + int reason = [[[notification userInfo] valueForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] intValue];
  257 + if (MPMovieFinishReasonPlaybackError == reason) {
  258 + if (_noInternet) {
  259 + [_loadingView setLVCPlayerStatus:LVCPlayerStatusNoNetwork];
  260 + } else {
  261 + [_loadingView setLVCPlayerStatus:LVCPlayerStatusStopError];
  262 + }
  263 + } else {
  264 + [_loadingView setLVCPlayerStatus:LVCPlayerStatusStopLoading];
  265 + }
  266 + }
  267 +}
  268 +
  269 +- (void)mediaIsPreparedToPlayDidChange:(NSNotification *)notification
  270 +{
  271 + if (_player) {
  272 + NSLog(@"isPreparedToPlay");
  273 + }
  274 +}
  275 +
  276 +//播放状态改变通知
  277 +- (void)moviePlayBackStateDidChange:(NSNotification *)notification
  278 +{
  279 + if (_player) {
  280 +
  281 + if (_player.playbackState == MPMoviePlaybackStatePlaying) {
  282 + _playBtn.selected = YES;
  283 + [_loadingView setLVCPlayerStatus:LVCPlayerStatusStopLoading];
  284 + } else if (_player.playbackState == MPMoviePlaybackStateSeekingForward || _player.playbackState == MPMoviePlaybackStateSeekingBackward) {
  285 + [_loadingView setLVCPlayerStatus:LVCPlayerStatusStartLoading];
  286 + } else {
  287 + _playBtn.selected = NO;
  288 + }
  289 +
  290 + NSLog(@"moviePlayBackStateDidChange : %ld",(long)_player.playbackState);
  291 +
  292 + }
  293 +}
  294 +
  295 +//网络状态监听
  296 +- (void)moviePlayerNetworkStatusChange:(NSNotification *)notify {
  297 + int currStatus = [[[notify userInfo] valueForKey:MPMoviePlayerCurrNetworkStatusUserInfoKey] intValue];
  298 + int lastStatus = [[[notify userInfo] valueForKey:MPMoviePlayerLastNetworkStatusUserInfoKey] intValue];
  299 +
  300 + if (currStatus == CNLiveNotReachable) {
  301 + _noInternet = YES;
  302 + } else {
  303 + _noInternet = NO;
  304 + }
  305 +
  306 + NSLog(@"network reachable change from %@ to %@\n", [self netStatus2Str:lastStatus], [self netStatus2Str:currStatus]);
  307 +}
  308 +
  309 +- (NSString *) netStatus2Str:(CNLiveNetworkStatus)networkStatus{
  310 + NSString *netString = nil;
  311 +
  312 + if(networkStatus == CNLiveNotReachable){
  313 + netString = @"NO INTERNET";
  314 + } else if(networkStatus == CNLiveReachableViaWiFi) {
  315 + netString = @"WIFI";
  316 + } else if(networkStatus == CNLiveReachableViaWWAN) {
  317 + netString = @"WWAN";
  318 + } else {
  319 + netString = @"Unknown";
  320 + }
  321 + return netString;
  322 +}
  323 +
  324 +//退到后台将播放器暂停
  325 +- (void)appResignActive:(NSNotification *)noti
  326 +{
  327 + if (_player.playbackState == MPMoviePlaybackStatePlaying) {
  328 + [_player pause];
  329 + }
  330 +}
  331 +
  332 +//回到前台继续播放
  333 +- (void)appBecomeActive:(NSNotification *)noti
  334 +{
  335 + if (_player.playbackState == MPMoviePlaybackStatePaused) {
  336 + [_player play];
  337 + }
  338 +}
  339 +
  340 +- (void)removeMovieNotificationObservers
  341 +{
  342 + [[NSNotificationCenter defaultCenter] removeObserver:self];
  343 +}
  344 +
  345 +#pragma mark -
  346 +#pragma mark - getter
  347 +- (UIView *)topView
  348 +{
  349 + if (!_topView) {
  350 + _topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 64)];
  351 + _topView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
  352 + }
  353 + return _topView;
  354 +}
  355 +
  356 +- (UIView *)bottomView
  357 +{
  358 + if (!_bottomView) {
  359 + _bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, KScreenHeight-90, KScreenWidth, 90)];
  360 + _bottomView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
  361 + }
  362 + return _bottomView;
  363 +}
  364 +
  365 +- (UIView *)bottomToolBar
  366 +{
  367 + if (!_bottomToolBar) {
  368 + _bottomToolBar = [[UIView alloc] initWithFrame:CGRectMake(0, 40, KScreenWidth, 50)];
  369 + _bottomToolBar.backgroundColor = [UIColor clearColor];
  370 + }
  371 + return _bottomToolBar;
  372 +}
  373 +
  374 +- (UILabel *)descLab
  375 +{
  376 + if (!_descLab) {
  377 + _descLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, 40)];
  378 + _descLab.backgroundColor = [UIColor colorWithWhite:0 alpha:0.1];
  379 + _descLab.font = [UIFont systemFontOfSize:14];
  380 + _descLab.textColor = [UIColor whiteColor];
  381 + _descLab.text = @"我是描述,啦啦啦啦";
  382 + }
  383 + return _descLab;
  384 +}
  385 +
  386 +- (UILabel *)titleLab
  387 +{
  388 + if (!_titleLab) {
  389 + _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(_backBtn.right+10, 20, KScreenWidth-50, 44)];
  390 + _titleLab.text = @"我是标题";
  391 + _titleLab.textColor = [UIColor whiteColor];
  392 + }
  393 + return _titleLab;
  394 +}
  395 +
  396 +- (UIButton *)backBtn
  397 +{
  398 + if (!_backBtn) {
  399 + _backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  400 + _backBtn.frame = CGRectMake(10, 27, 30, 30);
  401 + [_backBtn setImage:[UIImage imageNamed:@"play_back"] forState:UIControlStateNormal];
  402 + [_backBtn addTarget:self action:@selector(backBtnAction) forControlEvents:UIControlEventTouchUpInside];
  403 + }
  404 + return _backBtn;
  405 +}
  406 +
  407 +- (UIButton *)playBtn
  408 +{
  409 + if (!_playBtn) {
  410 + _playBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  411 + _playBtn.frame = CGRectMake(10, 10, 30, 30);
  412 + [_playBtn setImage:[UIImage imageNamed:@"sv_play"] forState:UIControlStateNormal];
  413 + [_playBtn setImage:[UIImage imageNamed:@"sv_pause"] forState:UIControlStateSelected];
  414 + [_playBtn addTarget:self action:@selector(playOrPauseBtnAction:) forControlEvents:UIControlEventTouchUpInside];
  415 + }
  416 + return _playBtn;
  417 +}
  418 +
  419 +- (UILabel *)startLab
  420 +{
  421 + if (!_startLab) {
  422 + _startLab = [[UILabel alloc] initWithFrame:CGRectMake(_playBtn.right+10, 0, 55, 50)];
  423 + _startLab.font = [UIFont systemFontOfSize:12];
  424 + _startLab.textColor = [UIColor whiteColor];
  425 + _startLab.text = @"00:00:00";
  426 + }
  427 + return _startLab;
  428 +}
  429 +
  430 +- (UILabel *)endLab
  431 +{
  432 + if (!_endLab) {
  433 + _endLab = [[UILabel alloc] initWithFrame:CGRectMake(KScreenWidth-70, 0, 55, 50)];
  434 + _endLab.font = [UIFont systemFontOfSize:12];
  435 + _endLab.textColor = [UIColor whiteColor];
  436 + _endLab.text = @"00:00:00";
  437 + }
  438 + return _endLab;
  439 +}
  440 +
  441 +- (UISlider *)slider
  442 +{
  443 + if (!_slider) {
  444 + _slider = [[UISlider alloc] initWithFrame:CGRectMake(_startLab.right+5, 0, KScreenWidth-_startLab.right-85, 50)];
  445 + _slider.minimumValue = 0;
  446 + _slider.maximumValue = 1;
  447 +
  448 + _slider.thumbTintColor = [UIColor colorWithHexString:@"#ffba00"];
  449 + _slider.maximumTrackTintColor = [UIColor colorWithHexString:@"#999999"];
  450 + _slider.minimumTrackTintColor = [UIColor colorWithHexString:@"#ffba00"];
  451 + [_slider setThumbImage:[UIImage imageNamed:@"thumb"] forState:UIControlStateNormal];
  452 + [_slider setThumbImage:[UIImage imageNamed:@"thumb"] forState:UIControlStateHighlighted];
  453 + [_slider addTarget:self action:@selector(beginScrubbing) forControlEvents:UIControlEventTouchDown];
  454 + [_slider addTarget:self action:@selector(endScrubbing) forControlEvents:UIControlEventTouchUpInside];
  455 + [_slider addTarget:self action:@selector(endScrubbing) forControlEvents:UIControlEventTouchUpOutside];
  456 + }
  457 + return _slider;
  458 +}
  459 +
  460 +- (LVCPlayerLoadingView *)loadingView
  461 +{
  462 + if (!_loadingView) {
  463 + _loadingView = [[LVCPlayerLoadingView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
  464 + }
  465 + return _loadingView;
  466 +}
  467 +
  468 +- (UIProgressView *)bufferProgress
  469 +{
  470 + if (!_bufferProgress) {
  471 + _bufferProgress = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleDefault];
  472 + _bufferProgress.frame = CGRectMake(130+2, 29, self.frame.size.width-130-80-4, 1);
  473 + _bufferProgress.trackTintColor = [UIColor darkGrayColor];
  474 + _bufferProgress.progressTintColor = [UIColor lightGrayColor];
  475 + _bufferProgress.progress = 0;
  476 + }
  477 + return _bufferProgress;
  478 +}
  479 +
  480 +- (UITapGestureRecognizer *)singleTap
  481 +{
  482 + if (!_singleTap) {
  483 + _singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapView)];
  484 + _singleTap.delegate = self;
  485 + }
  486 + return _singleTap;
  487 +}
  488 +
  489 +/*
  490 +// Only override drawRect: if you perform custom drawing.
  491 +// An empty implementation adversely affects performance during animation.
  492 +- (void)drawRect:(CGRect)rect {
  493 + // Drawing code
  494 +}
  495 +*/
  496 +
  497 +@end
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCVideoConfigView.h 0 → 100644
  1 +//
  2 +// LVCVideoConfigView.h
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by iOS on 2017/7/13.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +typedef NS_ENUM(NSUInteger, VideoCfgViewAction) {
  12 + VideoCfgViewActionCancel,
  13 + VideoCfgViewActionStart,
  14 +};
  15 +
  16 +@interface LVCVideoConfigView : UIView
  17 +
  18 +@property (nonatomic, copy) void(^VideoCfgViewBlock)(VideoCfgViewAction event);
  19 +
  20 +@end
... ...
LiveVideoCloud/Classes/Sections/Mine/Views/LVCVideoConfigView.m 0 → 100644
  1 +//
  2 +// LVCVideoConfigView.m
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by iOS on 2017/7/13.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "LVCVideoConfigView.h"
  10 +#import "VideoParamCache.h"
  11 +
  12 +@interface LVCVideoConfigView ()
  13 +
  14 +@property (nonatomic, strong) UIView *baseView;
  15 +@property (nonatomic, strong) UISegmentedControl *titleSegmentedControl; //配置参数
  16 +@property (nonatomic, strong) UISegmentedControl *resolutionSegmentedControl; //分辨率
  17 +@property (nonatomic, strong) UITextField *frameRateTextView; //帧率
  18 +@property (nonatomic, strong) UITextField *vbpsTextView; //视频码率
  19 +@property (nonatomic, strong) UITextField *abpsTextView; //音频码率
  20 +@property (nonatomic, strong) UIButton *startBtn; //开始
  21 +@property (nonatomic, strong) UIButton *backBtn; //返回
  22 +@property (nonatomic, strong) UIButton *saveBtn;
  23 +
  24 +@end
  25 +
  26 +@implementation LVCVideoConfigView
  27 +
  28 +- (instancetype)initWithFrame:(CGRect)frame
  29 +{
  30 + self = [super initWithFrame:frame];
  31 + if (self) {
  32 +
  33 + self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.9];
  34 +
  35 + [self addSubview:self.baseView];
  36 + [self.baseView addSubview:self.titleSegmentedControl];
  37 + [self.baseView addSubview:self.resolutionSegmentedControl];
  38 + [self.baseView addSubview:self.titleSegmentedControl];
  39 + [self.baseView addSubview:self.frameRateTextView];
  40 + [self.baseView addSubview:self.vbpsTextView];
  41 + [self.baseView addSubview:self.abpsTextView];
  42 + [self.baseView addSubview:self.startBtn];
  43 + [self.baseView addSubview:self.backBtn];
  44 + [self.baseView addSubview:self.saveBtn];
  45 +
  46 + }
  47 + return self;
  48 +}
  49 +
  50 +#pragma mark -
  51 +#pragma mark - Action
  52 +- (void)onParamTypeChange:(UISegmentedControl *)ctl
  53 +{
  54 + switch (ctl.selectedSegmentIndex) {
  55 + case 0: {
  56 + self.frameRateTextView.hidden = NO;
  57 + self.resolutionSegmentedControl.selectedSegmentIndex = [VideoParamCache sharedInstance].captureParam.level;
  58 + self.frameRateTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].captureParam.frame)];
  59 + self.abpsTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].captureParam.abps)];
  60 + self.vbpsTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].captureParam.vbps)];
  61 + }break;
  62 +
  63 + case 1: {
  64 + self.frameRateTextView.hidden = YES;
  65 + self.resolutionSegmentedControl.selectedSegmentIndex = [VideoParamCache sharedInstance].exportParam.level;
  66 + self.frameRateTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].exportParam.frame)];
  67 + self.abpsTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].exportParam.abps)];
  68 + self.vbpsTextView.text = [NSString stringWithFormat:@"%@", @([VideoParamCache sharedInstance].exportParam.vbps)];
  69 + }break;
  70 +
  71 + case UISegmentedControlNoSegment:
  72 + break;
  73 + default:
  74 + break;
  75 + }
  76 +}
  77 +
  78 +- (void)onSave
  79 +{
  80 + //录制
  81 + if (self.titleSegmentedControl.selectedSegmentIndex == 0){
  82 + [VideoParamCache sharedInstance].captureParam.level = self.resolutionSegmentedControl.selectedSegmentIndex;
  83 +
  84 + if ([self.frameRateTextView.text integerValue] > 0){
  85 + [VideoParamCache sharedInstance].captureParam.frame = [self.frameRateTextView.text integerValue];
  86 + }
  87 + if ([self.abpsTextView.text integerValue] > 0){
  88 + [VideoParamCache sharedInstance].captureParam.abps = [self.abpsTextView.text integerValue];
  89 + }
  90 + if ([self.vbpsTextView.text integerValue] > 0){
  91 + [VideoParamCache sharedInstance].captureParam.vbps = [self.vbpsTextView.text integerValue];
  92 + }
  93 + }
  94 + //输出
  95 + if (self.titleSegmentedControl.selectedSegmentIndex == 1){
  96 + [VideoParamCache sharedInstance].exportParam.level = self.resolutionSegmentedControl.selectedSegmentIndex;
  97 +
  98 + if ([self.frameRateTextView.text integerValue] > 0){
  99 + [VideoParamCache sharedInstance].exportParam.frame = [self.frameRateTextView.text integerValue];
  100 + }
  101 + if ([self.abpsTextView.text integerValue] > 0){
  102 + [VideoParamCache sharedInstance].exportParam.abps = [self.abpsTextView.text integerValue];
  103 + }
  104 + if ([self.vbpsTextView.text integerValue] > 0){
  105 + [VideoParamCache sharedInstance].exportParam.vbps = [self.vbpsTextView.text integerValue];
  106 + }
  107 + }
  108 +}
  109 +
  110 +
  111 +- (void)onClick:(UIButton *)btn {
  112 + if (self.VideoCfgViewBlock) {
  113 + self.VideoCfgViewBlock(btn.tag);
  114 + }
  115 +}
  116 +
  117 +- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
  118 + [self endEditing:YES];
  119 +}
  120 +
  121 +- (void)saveBtnAction {
  122 + [self onSave];
  123 +}
  124 +
  125 +#pragma mark -
  126 +#pragma mark - getter
  127 +- (UIView *)baseView
  128 +{
  129 + if (!_baseView) {
  130 + _baseView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 280, 400)];
  131 + _baseView.backgroundColor = [UIColor whiteColor];
  132 + _baseView.center = CGPointMake(KScreenWidth/2, KScreenHeight/2-32);
  133 + }
  134 + return _baseView;
  135 +}
  136 +
  137 +- (UISegmentedControl *)titleSegmentedControl
  138 +{
  139 + if (!_titleSegmentedControl) {
  140 + NSArray *array = [[NSArray alloc] initWithObjects:@"录制",@"输出",nil];
  141 + _titleSegmentedControl = [[UISegmentedControl alloc]initWithItems:array];
  142 + _titleSegmentedControl.frame = CGRectMake(20, 50, self.baseView.width-40, 30);
  143 + _titleSegmentedControl.selectedSegmentIndex = 1;
  144 + _titleSegmentedControl.tintColor= [UIColor colorWithHexString:@"#ffba00"];
  145 + [_titleSegmentedControl addTarget:self action:@selector(onParamTypeChange:) forControlEvents:UIControlEventValueChanged];
  146 + }
  147 + return _titleSegmentedControl;
  148 +}
  149 +
  150 +- (UISegmentedControl *)resolutionSegmentedControl
  151 +{
  152 + if (!_resolutionSegmentedControl) {
  153 + NSArray *array = [[NSArray alloc] initWithObjects:@"360p",@"480p",@"540p",@"720p",nil];
  154 + _resolutionSegmentedControl = [[UISegmentedControl alloc] initWithItems:array];
  155 + _resolutionSegmentedControl.frame = CGRectMake(60, _titleSegmentedControl.bottom+20, self.baseView.width-70, 30);
  156 + _resolutionSegmentedControl.selectedSegmentIndex = 3;
  157 + _resolutionSegmentedControl.tintColor= [UIColor colorWithHexString:@"#ffba00"];
  158 +
  159 + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(-50, 0, 50, 30)];
  160 + label.text = @"分辨率:";
  161 + label.font = [UIFont systemFontOfSize:14];
  162 + [self.resolutionSegmentedControl addSubview:label];
  163 + }
  164 + return _resolutionSegmentedControl;
  165 +}
  166 +
  167 +- (UITextField *)frameRateTextView
  168 +{
  169 + if (!_frameRateTextView) {
  170 + _frameRateTextView = [[UITextField alloc] initWithFrame:CGRectMake(60, _resolutionSegmentedControl.bottom+20, 60, 30)];
  171 + _frameRateTextView.keyboardType = UIKeyboardTypeNumberPad;
  172 + _frameRateTextView.borderStyle = UITextBorderStyleRoundedRect;
  173 + _frameRateTextView.tag = 2;
  174 + _frameRateTextView.hidden = YES;
  175 + _frameRateTextView.placeholder = @"30";
  176 +
  177 + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(-50, 0, 50, 30)];
  178 + label.text = @"帧率:";
  179 + label.font = [UIFont systemFontOfSize:14];
  180 + [self.frameRateTextView addSubview:label];
  181 + }
  182 + return _frameRateTextView;
  183 +}
  184 +
  185 +- (UITextField *)vbpsTextView
  186 +{
  187 + if (!_vbpsTextView) {
  188 + _vbpsTextView = [[UITextField alloc] initWithFrame:CGRectMake(130, _frameRateTextView.bottom+20, self.baseView.width-160, 30)];
  189 + _vbpsTextView.tag = 1;
  190 + _vbpsTextView.keyboardType = UIKeyboardTypeNumberPad;
  191 + _vbpsTextView.borderStyle = UITextBorderStyleRoundedRect;
  192 + _vbpsTextView.placeholder = @"4096";
  193 +
  194 + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(-120, 0, 120, 30)];
  195 + label.text = @"视频码率(kbps):";
  196 + label.font = [UIFont systemFontOfSize:14];
  197 + [self.vbpsTextView addSubview:label];
  198 + }
  199 + return _vbpsTextView;
  200 +}
  201 +
  202 +- (UITextField *)abpsTextView
  203 +{
  204 + if (!_abpsTextView) {
  205 + _abpsTextView = [[UITextField alloc] initWithFrame:CGRectMake(130, _vbpsTextView.bottom+20, self.baseView.width-160, 30)];
  206 + _abpsTextView.keyboardType = UIKeyboardTypeNumberPad;
  207 + _abpsTextView.borderStyle = UITextBorderStyleRoundedRect;
  208 + _abpsTextView.tag = 2;
  209 + _abpsTextView.placeholder = @"96";
  210 +
  211 +
  212 + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(-120, 0, 120, 30)];
  213 + label.text = @"音频码率(kbps):";
  214 + label.font = [UIFont systemFontOfSize:14];
  215 + [self.abpsTextView addSubview:label];
  216 + }
  217 + return _abpsTextView;
  218 +}
  219 +
  220 +- (UIButton *)startBtn
  221 +{
  222 + if (!_startBtn) {
  223 + _startBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  224 + _startBtn.frame = CGRectMake(self.baseView.width/2, self.baseView.height-40, self.baseView.width/2, 40);
  225 + _startBtn.backgroundColor = [UIColor colorWithHexString:@"#ffba00"];
  226 + [_startBtn setTitle:@"start" forState:UIControlStateNormal];
  227 + _startBtn.tag = VideoCfgViewActionStart;
  228 + [_startBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  229 + [_startBtn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
  230 + }
  231 + return _startBtn;
  232 +}
  233 +
  234 +- (UIButton *)backBtn
  235 +{
  236 + if (!_backBtn) {
  237 + _backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  238 + _backBtn.frame = CGRectMake(0, self.baseView.height-40, self.baseView.width/2, 40);
  239 + _backBtn.backgroundColor = [UIColor colorWithHexString:@"#ffba00"];
  240 + [_backBtn setTitle:@"cancel" forState:UIControlStateNormal];
  241 + _backBtn.tag = VideoCfgViewActionCancel;
  242 + [_backBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  243 + [_backBtn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
  244 +
  245 + UIView *line = [[UIView alloc] initWithFrame:CGRectMake(self.baseView.width/2-0.5, self.baseView.height-40, 1, 40)];
  246 + line.backgroundColor = [UIColor whiteColor];
  247 + [self.baseView addSubview:line];
  248 + }
  249 + return _backBtn;
  250 +}
  251 +
  252 +- (UIButton *)saveBtn
  253 +{
  254 + if (!_saveBtn) {
  255 + _saveBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  256 + _saveBtn.frame = CGRectMake(_baseView.width-40, _baseView.height-40-40, 30, 30);
  257 + [_saveBtn setImage:[UIImage imageNamed:@"cfg save"] forState:UIControlStateNormal];
  258 + [_saveBtn addTarget:self action:@selector(saveBtnAction) forControlEvents:UIControlEventTouchUpInside];
  259 + }
  260 + return _saveBtn;
  261 +}
  262 +
  263 +/*
  264 +// Only override drawRect: if you perform custom drawing.
  265 +// An empty implementation adversely affects performance during animation.
  266 +- (void)drawRect:(CGRect)rect {
  267 + // Drawing code
  268 +}
  269 +*/
  270 +
  271 +@end
... ...
LiveVideoCloud/Resource/Idina Menzel - Let It Go.mp3 renamed to LiveVideoCloud/Resource/Let_It_Go.mp3
No preview for this file type
LiveVideoCloud/Resource/See You Again.mp3 renamed to LiveVideoCloud/Resource/See_You_Again.mp3
No preview for this file type
LiveVideoCloud/Resource/Zedd,Alessia Cara - Stay.mp3 renamed to LiveVideoCloud/Resource/Stay.mp3
No preview for this file type
LiveVideoCloud/ShortVideoData.plist
... ... @@ -253,7 +253,7 @@
253 253 </dict>
254 254 <dict>
255 255 <key>path</key>
256   - <string>Idina Menzel - Let It Go</string>
  256 + <string>Let_It_Go</string>
257 257 <key>txt</key>
258 258 <string>Frozen</string>
259 259 <key>image</key>
... ... @@ -263,7 +263,7 @@
263 263 </dict>
264 264 <dict>
265 265 <key>path</key>
266   - <string>See You Again</string>
  266 + <string>See_You_Again</string>
267 267 <key>txt</key>
268 268 <string>See You Again</string>
269 269 <key>image</key>
... ... @@ -273,7 +273,7 @@
273 273 </dict>
274 274 <dict>
275 275 <key>path</key>
276   - <string>Zedd,Alessia Cara - Stay</string>
  276 + <string>Stay</string>
277 277 <key>txt</key>
278 278 <string>Stay</string>
279 279 <key>image</key>
... ...
LiveVideoCloud/animation.xcassets/ShortVideo/record.imageset/开吃圆圈.png deleted 100644 → 0

6.32 KB

LiveVideoCloud/animation.xcassets/ShortVideo/record.imageset/Contents.json renamed to LiveVideoCloud/animation.xcassets/ShortVideo/sv_ placeholder.imageset/Contents.json
... ... @@ -2,7 +2,7 @@
2 2 "images" : [
3 3 {
4 4 "idiom" : "universal",
5   - "filename" : "开吃圆圈.png",
  5 + "filename" : "sv_ placeholder.png",
6 6 "scale" : "1x"
7 7 },
8 8 {
... ...
LiveVideoCloud/animation.xcassets/ShortVideo/sv_ placeholder.imageset/sv_ placeholder.png 0 → 100644

3.16 KB

LiveVideoCloud/animation.xcassets/ShortVideo/sv_ placeholder1.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "filename" : "sv_ placeholder.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/animation.xcassets/ShortVideo/sv_ placeholder1.imageset/sv_ placeholder.png 0 → 100644

3.2 KB

LiveVideoCloud/animation.xcassets/ShortVideo/sv_pause.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "filename" : "sv_pause.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/animation.xcassets/ShortVideo/sv_pause.imageset/sv_pause.png 0 → 100644

2.53 KB

LiveVideoCloud/animation.xcassets/ShortVideo/sv_play.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "filename" : "sv_play.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/animation.xcassets/ShortVideo/sv_play.imageset/sv_play.png 0 → 100644

1.99 KB

LiveVideoCloud/animation.xcassets/ShortVideo/功能.imageset/Contents.json
... ... @@ -2,7 +2,7 @@
2 2 "images" : [
3 3 {
4 4 "idiom" : "universal",
5   - "filename" : "更多.png",
  5 + "filename" : "功能.png",
6 6 "scale" : "1x"
7 7 },
8 8 {
... ...
LiveVideoCloud/animation.xcassets/ShortVideo/功能.imageset/功能.png 0 → 100644

3.77 KB

LiveVideoCloud/animation.xcassets/ShortVideo/功能.imageset/更多.png deleted 100644 → 0

3.06 KB

LiveVideoCloud/animation.xcassets/cfg save.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "filename" : "cfg save.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/animation.xcassets/cfg save.imageset/cfg save.png 0 → 100644

1.21 KB

LiveVideoCloud/animation.xcassets/record.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "filename" : "record.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/animation.xcassets/record.imageset/record.png 0 → 100644

8.91 KB