explaingit

renzifeng/zfplayer

7,130Objective-CAudience · developerComplexity · 3/5LicenseSetup · easy

TLDR

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.

Mindmap

mindmap
  root((ZFPlayer))
    What it does
      iOS video playback
      Engine swap support
      List video support
    Tech Stack
      Objective-C
      AVPlayer
      ijkplayer
      CocoaPods
    Architecture
      Playback protocol
      Control layer protocol
      Decoupled design
    Use Cases
      Video feed app
      Custom player UI
      Fullscreen player
    Setup
      CocoaPods install
      iOS 7 plus
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add inline video playback to a scrollable iOS feed that smoothly transitions to fullscreen when the user taps.

USE CASE 2

Replace the default video controls with a completely custom UI control layer without touching ZFPlayer's core playback code.

USE CASE 3

Swap Apple's AVPlayer engine for ijkplayer to support additional video formats while reusing the same control layer.

Tech stack

Objective-CiOSCocoaPodsAVPlayerijkplayer

Getting it running

Difficulty · easy Time to first run · 30min

Install via CocoaPods, choose separate subspecs for the default controls, AVPlayer, or ijkplayer integration.

Use freely for any purpose including commercial, as long as you include the MIT license notice.

In plain English

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.

Copy-paste prompts

Prompt 1
Set up ZFPlayer in my iOS app using CocoaPods with the AVPlayer subspec and play a video URL inside a UIView.
Prompt 2
Build a scrollable video feed in my iOS app with ZFPlayer that auto-plays videos inline as the user scrolls past them.
Prompt 3
Create a custom control layer for ZFPlayer that shows a progress bar, video title, and a custom fullscreen toggle button.
Prompt 4
Switch ZFPlayer from the AVPlayer engine to ijkplayer by implementing the player protocol and updating my Podfile subspecs.
Open on GitHub → Explain another repo

← renzifeng on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.