gitmyhub

ZFPlayer

Objective-C ★ 7.1k updated 2y ago

Support customization of any player SDK and control layer(支持定制任何播放器SDK和控制层)

An iOS video player framework in Objective-C that decouples the playback engine from the UI controls so you can swap either layer independently, with built-in support for both single-view and scrollable list playback.

Objective-CiOSCocoaPodsAVPlayerijkplayersetup: easycomplexity 3/5

ZFPlayer is an iOS video player framework written in Objective-C. It is designed around the idea that the playback engine and the playback controls should be completely separate, so that you can swap either one out without rewriting the other. Most video player libraries for iOS tie you to a specific underlying player, and changing it later requires significant rework. ZFPlayer avoids this by defining two protocols: one for the playback engine, one for the control layer.

The playback engine protocol means you can use Apple's built-in AVPlayer, the open source ijkplayer, or other third-party player SDKs simply by wrapping them in a class that conforms to the expected interface. The control layer protocol works the same way: you can use the default control view that ships with the library, or build your own with a completely different look and behavior, without touching the core player code.

The library handles two common usage patterns for iOS apps. The first is a standard single-view player that occupies a fixed area of the screen. The second is a list-style player designed for scroll views, table views, and collection views, where video should play inline as the user scrolls and stop or hand off to a fullscreen view when appropriate. Both modes are initialized through the same main controller class.

ZFPlayer requires iOS 7 or later and Xcode 8 or later. It is distributed through CocoaPods, with separate subspecs for the core template, the default control view, AVPlayer integration, and ijkplayer integration. The README is in both English and Chinese, and the project is released under the MIT license.

Where it fits