├── LCTableViewVideoPlay.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Lee.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Lee.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist └── LCTableViewVideoPlay ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json ├── video_pause.imageset │ ├── Contents.json │ ├── live_vertical_stop.png │ ├── live_vertical_stop@2x.png │ └── live_vertical_stop@3x.png └── video_play.imageset │ ├── Contents.json │ ├── livecard_play_20.png │ ├── livecard_play_20@2x.png │ └── livecard_play_20@3x.png ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Category ├── UITableView+Video.h └── UITableView+Video.m ├── Info.plist ├── LCVideoCell.h ├── LCVideoCell.m ├── ViewController.h ├── ViewController.m └── main.m /LCTableViewVideoPlay.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9B8C85631FE26CAD007CA4B4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8C85621FE26CAD007CA4B4 /* AppDelegate.m */; }; 11 | 9B8C85661FE26CAD007CA4B4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8C85651FE26CAD007CA4B4 /* ViewController.m */; }; 12 | 9B8C85691FE26CAD007CA4B4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9B8C85671FE26CAD007CA4B4 /* Main.storyboard */; }; 13 | 9B8C856B1FE26CAD007CA4B4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9B8C856A1FE26CAD007CA4B4 /* Assets.xcassets */; }; 14 | 9B8C856E1FE26CAD007CA4B4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9B8C856C1FE26CAD007CA4B4 /* LaunchScreen.storyboard */; }; 15 | 9B8C85711FE26CAD007CA4B4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8C85701FE26CAD007CA4B4 /* main.m */; }; 16 | 9B8C857A1FE26E4A007CA4B4 /* UITableView+Video.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8C85791FE26E4A007CA4B4 /* UITableView+Video.m */; }; 17 | 9B8C857D1FE26F89007CA4B4 /* LCVideoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B8C857C1FE26F89007CA4B4 /* LCVideoCell.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 9B8C855E1FE26CAD007CA4B4 /* LCTableViewVideoPlay.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LCTableViewVideoPlay.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 9B8C85611FE26CAD007CA4B4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | 9B8C85621FE26CAD007CA4B4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | 9B8C85641FE26CAD007CA4B4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 25 | 9B8C85651FE26CAD007CA4B4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 26 | 9B8C85681FE26CAD007CA4B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | 9B8C856A1FE26CAD007CA4B4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 9B8C856D1FE26CAD007CA4B4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | 9B8C856F1FE26CAD007CA4B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 9B8C85701FE26CAD007CA4B4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 31 | 9B8C85781FE26E4A007CA4B4 /* UITableView+Video.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UITableView+Video.h"; sourceTree = ""; }; 32 | 9B8C85791FE26E4A007CA4B4 /* UITableView+Video.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UITableView+Video.m"; sourceTree = ""; }; 33 | 9B8C857B1FE26F89007CA4B4 /* LCVideoCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LCVideoCell.h; sourceTree = ""; }; 34 | 9B8C857C1FE26F89007CA4B4 /* LCVideoCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LCVideoCell.m; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 9B8C855B1FE26CAD007CA4B4 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 9B8C85551FE26CAD007CA4B4 = { 49 | isa = PBXGroup; 50 | children = ( 51 | 9B8C85601FE26CAD007CA4B4 /* LCTableViewVideoPlay */, 52 | 9B8C855F1FE26CAD007CA4B4 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 9B8C855F1FE26CAD007CA4B4 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 9B8C855E1FE26CAD007CA4B4 /* LCTableViewVideoPlay.app */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 9B8C85601FE26CAD007CA4B4 /* LCTableViewVideoPlay */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 9B8C85771FE26E07007CA4B4 /* Category */, 68 | 9B8C85611FE26CAD007CA4B4 /* AppDelegate.h */, 69 | 9B8C85621FE26CAD007CA4B4 /* AppDelegate.m */, 70 | 9B8C857B1FE26F89007CA4B4 /* LCVideoCell.h */, 71 | 9B8C857C1FE26F89007CA4B4 /* LCVideoCell.m */, 72 | 9B8C85641FE26CAD007CA4B4 /* ViewController.h */, 73 | 9B8C85651FE26CAD007CA4B4 /* ViewController.m */, 74 | 9B8C85671FE26CAD007CA4B4 /* Main.storyboard */, 75 | 9B8C856A1FE26CAD007CA4B4 /* Assets.xcassets */, 76 | 9B8C856C1FE26CAD007CA4B4 /* LaunchScreen.storyboard */, 77 | 9B8C856F1FE26CAD007CA4B4 /* Info.plist */, 78 | 9B8C85701FE26CAD007CA4B4 /* main.m */, 79 | ); 80 | path = LCTableViewVideoPlay; 81 | sourceTree = ""; 82 | }; 83 | 9B8C85771FE26E07007CA4B4 /* Category */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9B8C85781FE26E4A007CA4B4 /* UITableView+Video.h */, 87 | 9B8C85791FE26E4A007CA4B4 /* UITableView+Video.m */, 88 | ); 89 | path = Category; 90 | sourceTree = ""; 91 | }; 92 | /* End PBXGroup section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | 9B8C855D1FE26CAD007CA4B4 /* LCTableViewVideoPlay */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = 9B8C85741FE26CAD007CA4B4 /* Build configuration list for PBXNativeTarget "LCTableViewVideoPlay" */; 98 | buildPhases = ( 99 | 9B8C855A1FE26CAD007CA4B4 /* Sources */, 100 | 9B8C855B1FE26CAD007CA4B4 /* Frameworks */, 101 | 9B8C855C1FE26CAD007CA4B4 /* Resources */, 102 | ); 103 | buildRules = ( 104 | ); 105 | dependencies = ( 106 | ); 107 | name = LCTableViewVideoPlay; 108 | productName = LCTableViewVideoPlay; 109 | productReference = 9B8C855E1FE26CAD007CA4B4 /* LCTableViewVideoPlay.app */; 110 | productType = "com.apple.product-type.application"; 111 | }; 112 | /* End PBXNativeTarget section */ 113 | 114 | /* Begin PBXProject section */ 115 | 9B8C85561FE26CAD007CA4B4 /* Project object */ = { 116 | isa = PBXProject; 117 | attributes = { 118 | LastUpgradeCheck = 0920; 119 | ORGANIZATIONNAME = "early bird international"; 120 | TargetAttributes = { 121 | 9B8C855D1FE26CAD007CA4B4 = { 122 | CreatedOnToolsVersion = 9.2; 123 | ProvisioningStyle = Automatic; 124 | }; 125 | }; 126 | }; 127 | buildConfigurationList = 9B8C85591FE26CAD007CA4B4 /* Build configuration list for PBXProject "LCTableViewVideoPlay" */; 128 | compatibilityVersion = "Xcode 8.0"; 129 | developmentRegion = en; 130 | hasScannedForEncodings = 0; 131 | knownRegions = ( 132 | en, 133 | Base, 134 | ); 135 | mainGroup = 9B8C85551FE26CAD007CA4B4; 136 | productRefGroup = 9B8C855F1FE26CAD007CA4B4 /* Products */; 137 | projectDirPath = ""; 138 | projectRoot = ""; 139 | targets = ( 140 | 9B8C855D1FE26CAD007CA4B4 /* LCTableViewVideoPlay */, 141 | ); 142 | }; 143 | /* End PBXProject section */ 144 | 145 | /* Begin PBXResourcesBuildPhase section */ 146 | 9B8C855C1FE26CAD007CA4B4 /* Resources */ = { 147 | isa = PBXResourcesBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | 9B8C856E1FE26CAD007CA4B4 /* LaunchScreen.storyboard in Resources */, 151 | 9B8C856B1FE26CAD007CA4B4 /* Assets.xcassets in Resources */, 152 | 9B8C85691FE26CAD007CA4B4 /* Main.storyboard in Resources */, 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXResourcesBuildPhase section */ 157 | 158 | /* Begin PBXSourcesBuildPhase section */ 159 | 9B8C855A1FE26CAD007CA4B4 /* Sources */ = { 160 | isa = PBXSourcesBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | 9B8C85661FE26CAD007CA4B4 /* ViewController.m in Sources */, 164 | 9B8C857A1FE26E4A007CA4B4 /* UITableView+Video.m in Sources */, 165 | 9B8C857D1FE26F89007CA4B4 /* LCVideoCell.m in Sources */, 166 | 9B8C85711FE26CAD007CA4B4 /* main.m in Sources */, 167 | 9B8C85631FE26CAD007CA4B4 /* AppDelegate.m in Sources */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | /* End PBXSourcesBuildPhase section */ 172 | 173 | /* Begin PBXVariantGroup section */ 174 | 9B8C85671FE26CAD007CA4B4 /* Main.storyboard */ = { 175 | isa = PBXVariantGroup; 176 | children = ( 177 | 9B8C85681FE26CAD007CA4B4 /* Base */, 178 | ); 179 | name = Main.storyboard; 180 | sourceTree = ""; 181 | }; 182 | 9B8C856C1FE26CAD007CA4B4 /* LaunchScreen.storyboard */ = { 183 | isa = PBXVariantGroup; 184 | children = ( 185 | 9B8C856D1FE26CAD007CA4B4 /* Base */, 186 | ); 187 | name = LaunchScreen.storyboard; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXVariantGroup section */ 191 | 192 | /* Begin XCBuildConfiguration section */ 193 | 9B8C85721FE26CAD007CA4B4 /* Debug */ = { 194 | isa = XCBuildConfiguration; 195 | buildSettings = { 196 | ALWAYS_SEARCH_USER_PATHS = NO; 197 | CLANG_ANALYZER_NONNULL = YES; 198 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 199 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 200 | CLANG_CXX_LIBRARY = "libc++"; 201 | CLANG_ENABLE_MODULES = YES; 202 | CLANG_ENABLE_OBJC_ARC = YES; 203 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 204 | CLANG_WARN_BOOL_CONVERSION = YES; 205 | CLANG_WARN_COMMA = YES; 206 | CLANG_WARN_CONSTANT_CONVERSION = YES; 207 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 208 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 209 | CLANG_WARN_EMPTY_BODY = YES; 210 | CLANG_WARN_ENUM_CONVERSION = YES; 211 | CLANG_WARN_INFINITE_RECURSION = YES; 212 | CLANG_WARN_INT_CONVERSION = YES; 213 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 214 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 215 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 216 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 217 | CLANG_WARN_STRICT_PROTOTYPES = YES; 218 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 219 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 220 | CLANG_WARN_UNREACHABLE_CODE = YES; 221 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 222 | CODE_SIGN_IDENTITY = "iPhone Developer"; 223 | COPY_PHASE_STRIP = NO; 224 | DEBUG_INFORMATION_FORMAT = dwarf; 225 | ENABLE_STRICT_OBJC_MSGSEND = YES; 226 | ENABLE_TESTABILITY = YES; 227 | GCC_C_LANGUAGE_STANDARD = gnu11; 228 | GCC_DYNAMIC_NO_PIC = NO; 229 | GCC_NO_COMMON_BLOCKS = YES; 230 | GCC_OPTIMIZATION_LEVEL = 0; 231 | GCC_PREPROCESSOR_DEFINITIONS = ( 232 | "DEBUG=1", 233 | "$(inherited)", 234 | ); 235 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 236 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 237 | GCC_WARN_UNDECLARED_SELECTOR = YES; 238 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 239 | GCC_WARN_UNUSED_FUNCTION = YES; 240 | GCC_WARN_UNUSED_VARIABLE = YES; 241 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 242 | MTL_ENABLE_DEBUG_INFO = YES; 243 | ONLY_ACTIVE_ARCH = YES; 244 | SDKROOT = iphoneos; 245 | }; 246 | name = Debug; 247 | }; 248 | 9B8C85731FE26CAD007CA4B4 /* Release */ = { 249 | isa = XCBuildConfiguration; 250 | buildSettings = { 251 | ALWAYS_SEARCH_USER_PATHS = NO; 252 | CLANG_ANALYZER_NONNULL = YES; 253 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 254 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 255 | CLANG_CXX_LIBRARY = "libc++"; 256 | CLANG_ENABLE_MODULES = YES; 257 | CLANG_ENABLE_OBJC_ARC = YES; 258 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 259 | CLANG_WARN_BOOL_CONVERSION = YES; 260 | CLANG_WARN_COMMA = YES; 261 | CLANG_WARN_CONSTANT_CONVERSION = YES; 262 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 263 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 264 | CLANG_WARN_EMPTY_BODY = YES; 265 | CLANG_WARN_ENUM_CONVERSION = YES; 266 | CLANG_WARN_INFINITE_RECURSION = YES; 267 | CLANG_WARN_INT_CONVERSION = YES; 268 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 269 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 270 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 271 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 272 | CLANG_WARN_STRICT_PROTOTYPES = YES; 273 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 274 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 275 | CLANG_WARN_UNREACHABLE_CODE = YES; 276 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 277 | CODE_SIGN_IDENTITY = "iPhone Developer"; 278 | COPY_PHASE_STRIP = NO; 279 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 280 | ENABLE_NS_ASSERTIONS = NO; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | GCC_C_LANGUAGE_STANDARD = gnu11; 283 | GCC_NO_COMMON_BLOCKS = YES; 284 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 285 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 286 | GCC_WARN_UNDECLARED_SELECTOR = YES; 287 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 288 | GCC_WARN_UNUSED_FUNCTION = YES; 289 | GCC_WARN_UNUSED_VARIABLE = YES; 290 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 291 | MTL_ENABLE_DEBUG_INFO = NO; 292 | SDKROOT = iphoneos; 293 | VALIDATE_PRODUCT = YES; 294 | }; 295 | name = Release; 296 | }; 297 | 9B8C85751FE26CAD007CA4B4 /* Debug */ = { 298 | isa = XCBuildConfiguration; 299 | buildSettings = { 300 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 301 | CODE_SIGN_STYLE = Automatic; 302 | DEVELOPMENT_TEAM = A9ZY4654BA; 303 | INFOPLIST_FILE = LCTableViewVideoPlay/Info.plist; 304 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 305 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 306 | PRODUCT_BUNDLE_IDENTIFIER = com.greatchef.LCTableViewVideoPlay; 307 | PRODUCT_NAME = "$(TARGET_NAME)"; 308 | TARGETED_DEVICE_FAMILY = "1,2"; 309 | }; 310 | name = Debug; 311 | }; 312 | 9B8C85761FE26CAD007CA4B4 /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 316 | CODE_SIGN_STYLE = Automatic; 317 | DEVELOPMENT_TEAM = A9ZY4654BA; 318 | INFOPLIST_FILE = LCTableViewVideoPlay/Info.plist; 319 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 320 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 321 | PRODUCT_BUNDLE_IDENTIFIER = com.greatchef.LCTableViewVideoPlay; 322 | PRODUCT_NAME = "$(TARGET_NAME)"; 323 | TARGETED_DEVICE_FAMILY = "1,2"; 324 | }; 325 | name = Release; 326 | }; 327 | /* End XCBuildConfiguration section */ 328 | 329 | /* Begin XCConfigurationList section */ 330 | 9B8C85591FE26CAD007CA4B4 /* Build configuration list for PBXProject "LCTableViewVideoPlay" */ = { 331 | isa = XCConfigurationList; 332 | buildConfigurations = ( 333 | 9B8C85721FE26CAD007CA4B4 /* Debug */, 334 | 9B8C85731FE26CAD007CA4B4 /* Release */, 335 | ); 336 | defaultConfigurationIsVisible = 0; 337 | defaultConfigurationName = Release; 338 | }; 339 | 9B8C85741FE26CAD007CA4B4 /* Build configuration list for PBXNativeTarget "LCTableViewVideoPlay" */ = { 340 | isa = XCConfigurationList; 341 | buildConfigurations = ( 342 | 9B8C85751FE26CAD007CA4B4 /* Debug */, 343 | 9B8C85761FE26CAD007CA4B4 /* Release */, 344 | ); 345 | defaultConfigurationIsVisible = 0; 346 | defaultConfigurationName = Release; 347 | }; 348 | /* End XCConfigurationList section */ 349 | }; 350 | rootObject = 9B8C85561FE26CAD007CA4B4 /* Project object */; 351 | } 352 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay.xcodeproj/project.xcworkspace/xcuserdata/Lee.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cclbj/LCTableViewVideoPlay/f962973f9cae29ad4854f80cdd47e554cb39a185/LCTableViewVideoPlay.xcodeproj/project.xcworkspace/xcuserdata/Lee.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /LCTableViewVideoPlay.xcodeproj/xcuserdata/Lee.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 72 | 84 | 85 | 86 | 88 | 100 | 101 | 102 | 104 | 116 | 117 | 118 | 120 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay.xcodeproj/xcuserdata/Lee.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LCTableViewVideoPlay.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/video_pause.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "live_vertical_stop.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "live_vertical_stop@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "live_vertical_stop@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/video_pause.imageset/live_vertical_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cclbj/LCTableViewVideoPlay/f962973f9cae29ad4854f80cdd47e554cb39a185/LCTableViewVideoPlay/Assets.xcassets/video_pause.imageset/live_vertical_stop.png -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/video_pause.imageset/live_vertical_stop@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cclbj/LCTableViewVideoPlay/f962973f9cae29ad4854f80cdd47e554cb39a185/LCTableViewVideoPlay/Assets.xcassets/video_pause.imageset/live_vertical_stop@2x.png -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/video_pause.imageset/live_vertical_stop@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cclbj/LCTableViewVideoPlay/f962973f9cae29ad4854f80cdd47e554cb39a185/LCTableViewVideoPlay/Assets.xcassets/video_pause.imageset/live_vertical_stop@3x.png -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/video_play.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "livecard_play_20.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "livecard_play_20@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "livecard_play_20@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/video_play.imageset/livecard_play_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cclbj/LCTableViewVideoPlay/f962973f9cae29ad4854f80cdd47e554cb39a185/LCTableViewVideoPlay/Assets.xcassets/video_play.imageset/livecard_play_20.png -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/video_play.imageset/livecard_play_20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cclbj/LCTableViewVideoPlay/f962973f9cae29ad4854f80cdd47e554cb39a185/LCTableViewVideoPlay/Assets.xcassets/video_play.imageset/livecard_play_20@2x.png -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Assets.xcassets/video_play.imageset/livecard_play_20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cclbj/LCTableViewVideoPlay/f962973f9cae29ad4854f80cdd47e554cb39a185/LCTableViewVideoPlay/Assets.xcassets/video_play.imageset/livecard_play_20@3x.png -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Category/UITableView+Video.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+Video.h 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSInteger,LCSCROLL_DIRECTION) { 12 | 13 | LC_SCROLL_UP, 14 | LC_SCROLL_DOWN, 15 | LC_SCROLL_NONE 16 | 17 | }; 18 | 19 | @interface UITableView (Video) 20 | 21 | /* 正在播放的 cell */ 22 | @property (nonatomic,strong) id playingCell; 23 | 24 | /* 滚动方向*/ 25 | @property (nonatomic,assign) LCSCROLL_DIRECTION scrollDirection; 26 | 27 | /* 屏幕中央的位置 */ 28 | @property (nonatomic,strong) UIView *centerSepLine; 29 | 30 | /* 获取距离屏幕最中间的cell */ 31 | - (id)getMinCenterCell; 32 | 33 | /* 当前播放的视频是否划出屏幕 */ 34 | - (BOOL)playingCellIsOutScreen; 35 | 36 | /* 进行视频自动播放判定逻辑判断 */ 37 | - (void)handleScrollPlay; 38 | 39 | /* 滚动期间判断是否已经移动到屏幕外面 */ 40 | - (void)handleScrollingCellOutScreen; 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Category/UITableView+Video.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+Video.m 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import "UITableView+Video.h" 10 | #import "LCVideoCell.h" 11 | #import 12 | 13 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 14 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 15 | 16 | @implementation UITableView (Video) 17 | 18 | 19 | #pragma public method 20 | - (void)handleScrollingCellOutScreen{ 21 | 22 | if (self.playingCell && [self playingCellIsOutScreen]) { 23 | NSLog(@"移动到屏幕外,停止播放视频"); 24 | LCVideoCell *videoCell = self.playingCell; 25 | videoCell.backgroundColor = [UIColor whiteColor]; 26 | } 27 | 28 | } 29 | 30 | /* 进行视频自动播放判定逻辑判断 */ 31 | - (void)handleScrollPlay{ 32 | 33 | LCVideoCell *cell = (LCVideoCell *)[self getMinCenterCell]; 34 | 35 | if (cell && ![self.playingCell isEqual:cell]) { 36 | 37 | NSLog(@"当前的 cell 存在,是%ld",cell.tag); 38 | cell.backgroundColor = [UIColor redColor]; 39 | 40 | if (self.playingCell) { 41 | LCVideoCell *playingCell = (LCVideoCell *)self.playingCell; 42 | playingCell.backgroundColor = [UIColor whiteColor]; 43 | } 44 | 45 | self.playingCell = cell; 46 | 47 | } 48 | 49 | 50 | 51 | } 52 | 53 | /* 获取距离屏幕最中间的cell */ 54 | - (id)getMinCenterCell{ 55 | 56 | CGFloat minDelta = CGFLOAT_MAX; 57 | 58 | //屏幕中央位置 59 | CGFloat screenCenterY = SCREEN_HEIGHT * 0.5; 60 | //当前距离屏幕中央最近的cell 61 | id minCell = nil; 62 | 63 | for (id cell in self.visibleCells) { 64 | 65 | if ([cell isKindOfClass:[LCVideoCell class]]) { 66 | 67 | LCVideoCell *videoCell = (LCVideoCell *)cell; 68 | //获取当前 cell 的居中点坐标 69 | CGPoint cellCenterPoint = CGPointMake(videoCell.frame.origin.x, videoCell.frame.size.height * 0.5 + videoCell.frame.origin.y); 70 | //转换当前的 cell 的坐标 71 | CGPoint coorPoint = [videoCell.superview convertPoint:cellCenterPoint toView:nil]; 72 | CGFloat deltaTemp = fabs(coorPoint.y - screenCenterY); 73 | 74 | if (deltaTemp < minDelta) { 75 | minCell = videoCell; 76 | minDelta = deltaTemp; 77 | } 78 | 79 | } 80 | 81 | } 82 | 83 | return minCell; 84 | 85 | } 86 | 87 | /* 当前播放的视频是否划出屏幕 */ 88 | - (BOOL)playingCellIsOutScreen{ 89 | 90 | if (!self.playingCell) { 91 | 92 | return YES; 93 | } 94 | 95 | LCVideoCell *videoCell = (LCVideoCell *)self.playingCell; 96 | 97 | //当前显示区域内容 98 | CGRect visiableContentZone = [UIScreen mainScreen].bounds; 99 | 100 | //向上滚动 101 | if(self.scrollDirection == LC_SCROLL_UP){ 102 | 103 | //找到滚动时候的正在播放视频的cell底部的y坐标点,计算出当前播放的视频是否移除到屏幕外 104 | CGRect playingCellFrame = videoCell.frame; 105 | 106 | //当前正在播放视频的坐标 107 | CGPoint cellBottomPoint = CGPointMake(playingCellFrame.origin.x, playingCellFrame.size.height + playingCellFrame.origin.y); 108 | 109 | //坐标系转换(转换到 window坐标) 110 | CGPoint coorPoint = [videoCell.superview convertPoint:cellBottomPoint toView:nil]; 111 | 112 | return CGRectContainsPoint(visiableContentZone, coorPoint); 113 | 114 | 115 | } 116 | 117 | //向下滚动 118 | else if(self.scrollDirection == LC_SCROLL_DOWN){ 119 | 120 | //找到滚动时候的正在播放视频的cell底部的y坐标点,计算出当前播放的视频是否移除到屏幕外 121 | CGRect playingCellFrame = videoCell.frame; 122 | 123 | //当前正在播放视频的坐标 124 | CGPoint orginPoint = CGPointMake(playingCellFrame.origin.x, playingCellFrame.origin.y); 125 | 126 | //坐标系转换(转换到 window坐标) 127 | CGPoint coorPoint = [videoCell.superview convertPoint:orginPoint toView:nil]; 128 | 129 | return CGRectContainsPoint(visiableContentZone, coorPoint); 130 | 131 | } 132 | 133 | else{ 134 | 135 | return NO; 136 | } 137 | 138 | 139 | return YES; 140 | } 141 | 142 | #pragma getter and setter 143 | 144 | - (void)setScrollDirection:(LCSCROLL_DIRECTION)scrollDirection{ 145 | 146 | objc_setAssociatedObject(self, @selector(scrollDirection), @(scrollDirection), OBJC_ASSOCIATION_ASSIGN); 147 | 148 | } 149 | 150 | - (LCSCROLL_DIRECTION)scrollDirection{ 151 | 152 | return [objc_getAssociatedObject(self, _cmd) integerValue]; 153 | 154 | } 155 | 156 | - (void)setPlayingCell:(id)playingCell{ 157 | 158 | objc_setAssociatedObject(self, @selector(playingCell), playingCell, OBJC_ASSOCIATION_RETAIN); 159 | 160 | } 161 | 162 | - (id)playingCell{ 163 | 164 | return objc_getAssociatedObject(self, _cmd); 165 | } 166 | 167 | - (UIView *)centerSepLine{ 168 | 169 | return objc_getAssociatedObject(self, _cmd); 170 | } 171 | 172 | - (void)setCenterSepLine:(UIView *)centerSepLine{ 173 | 174 | objc_setAssociatedObject(self, @selector(centerSepLine), centerSepLine, OBJC_ASSOCIATION_RETAIN); 175 | } 176 | 177 | 178 | 179 | 180 | @end 181 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/LCVideoCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LCVideoCell.h 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LCVideoCell : UITableViewCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/LCVideoCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // LCVideoCell.m 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import "LCVideoCell.h" 10 | 11 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 12 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 13 | 14 | @interface LCVideoCell() 15 | 16 | @property (nonatomic,strong) UIButton *playBtn; 17 | 18 | @end 19 | 20 | @implementation LCVideoCell 21 | 22 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ 23 | 24 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { 25 | 26 | [self creatUI]; 27 | } 28 | 29 | return self; 30 | 31 | } 32 | 33 | - (void)creatUI{ 34 | 35 | [self.contentView addSubview:self.playBtn]; 36 | 37 | 38 | } 39 | 40 | #pragma -mark- Touch event 41 | - (void)playTouch:(UIButton *)button{ 42 | 43 | 44 | } 45 | 46 | #pragma getter 47 | - (UIButton *)playBtn{ 48 | 49 | if (!_playBtn) { 50 | _playBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 51 | _playBtn.center = CGPointMake(SCREEN_WIDTH * 0.5, 75); 52 | _playBtn.bounds = CGRectMake(0, 0, 28, 28); 53 | [_playBtn addTarget:self action:@selector(playTouch:) forControlEvents:UIControlEventTouchDragInside]; 54 | [_playBtn setBackgroundImage:[UIImage imageNamed:@"video_play"] forState:UIControlStateNormal]; 55 | [_playBtn setBackgroundImage:[UIImage imageNamed:@"video_pause"] forState:UIControlStateSelected]; 56 | } 57 | 58 | return _playBtn; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "LCVideoCell.h" 11 | #import "UITableView+Video.h" 12 | 13 | static NSString *cellID = @"videoCellID"; 14 | 15 | @interface ViewController () 16 | 17 | @property (nonatomic,strong) UITableView *tableView; 18 | 19 | @property (nonatomic,assign) CGFloat lastOffsetY; 20 | 21 | @property (nonatomic,strong) UIView *centerSepLine; 22 | 23 | @end 24 | 25 | @implementation ViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | [self.view addSubview:self.tableView]; 30 | [self.view addSubview:self.centerSepLine]; 31 | } 32 | 33 | #pragma -mark- tableView delegate 34 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 35 | 36 | return 20; 37 | } 38 | 39 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 40 | 41 | LCVideoCell *cell = [self.tableView dequeueReusableCellWithIdentifier:cellID]; 42 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 43 | cell.tag = indexPath.row; 44 | 45 | return cell; 46 | 47 | } 48 | 49 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ 50 | 51 | 52 | [self.tableView handleScrollPlay]; 53 | 54 | } 55 | 56 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ 57 | 58 | CGFloat offsetY = scrollView.contentOffset.y; 59 | 60 | CGFloat delaY = offsetY - self.lastOffsetY; 61 | 62 | self.tableView.scrollDirection = delaY > 0 ? LC_SCROLL_UP : LC_SCROLL_DOWN; 63 | 64 | if (delaY == 0) { 65 | self.tableView.scrollDirection = LC_SCROLL_NONE; 66 | } 67 | 68 | self.lastOffsetY = offsetY; 69 | 70 | 71 | //判断快速滑动期间是否移动到屏幕外 72 | [self.tableView handleScrollingCellOutScreen]; 73 | 74 | } 75 | 76 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ 77 | 78 | [self.tableView handleScrollPlay]; 79 | } 80 | 81 | 82 | #pragma -mark- lazy load 83 | - (UIView *)centerSepLine{ 84 | 85 | if (!_centerSepLine) { 86 | _centerSepLine = [UIView new]; 87 | _centerSepLine.backgroundColor = [UIColor orangeColor]; 88 | _centerSepLine.frame = CGRectMake(0,self.view.frame.size.height * 0.5, self.view.frame.size.width, 1); 89 | } 90 | 91 | return _centerSepLine; 92 | } 93 | - (UITableView *)tableView{ 94 | 95 | if (!_tableView) { 96 | _tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped]; 97 | _tableView.delegate = self; 98 | _tableView.dataSource = self; 99 | _tableView.rowHeight = 150; 100 | [_tableView registerClass:[LCVideoCell class] forCellReuseIdentifier:cellID]; 101 | } 102 | 103 | return _tableView; 104 | } 105 | 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /LCTableViewVideoPlay/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LCTableViewVideoPlay 4 | // 5 | // Created by lcc on 2017/12/14. 6 | // Copyright © 2017年 early bird international. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | --------------------------------------------------------------------------------