Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renzifeng/ZFPlayer
Support customization of any player SDK and control layer(支持定制任何播放器SDK和控制层)
https://github.com/renzifeng/ZFPlayer
controlview custom player
Last synced: 6 days ago
JSON representation
Support customization of any player SDK and control layer(支持定制任何播放器SDK和控制层)
- Host: GitHub
- URL: https://github.com/renzifeng/ZFPlayer
- Owner: renzifeng
- License: mit
- Created: 2016-03-03T03:32:48.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-24T02:29:56.000Z (7 months ago)
- Last Synced: 2024-10-29T15:04:24.140Z (about 1 month ago)
- Topics: controlview, custom, player
- Language: Objective-C
- Homepage:
- Size: 153 MB
- Stars: 7,067
- Watchers: 159
- Forks: 1,751
- Open Issues: 242
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - ZFPlayer - Based on AVPlayer, support for the horizontal screen, vertical screen (full screen playback can also lock the screen direction), the upper and lower slide to adjust the volume, the screen brightness, or so slide to adjust the playback progress. (Media / Video)
- awesome-video - renzifeng/ZFPlayer - Support customization of any player SDK and control layer (Players / iOS tvOS)
- awesome-ios-star - ZFPlayer - Based on AVPlayer, support for the horizontal screen, vertical screen (full screen playback can also lock the screen direction), the upper and lower slide to adjust the volume, the screen brightness, or so slide to adjust the playback progress. (Media / Video)
- Awesome-iOS - ZFPlayer - Support customization of any player SDK and control layer(支持定制任何播放器SDK和控制层) (Media)
- awesome - ZFPlayer - Support customization of any player SDK and control layer (支持定制任何播放器SDK和控制层)。【 [Priview 1](https://camo.githubusercontent.com/48200df0498350786ba386f31336f7e6c8f07552/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f3633353934322d303932343237653537313735363330392e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430) | [Priview 2](https://camo.githubusercontent.com/dbee14e8706d7d044c9951be77097aeb2115f5e9/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f3633353934322d653939643736343938636230316166622e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430) | [Priview 3](https://camo.githubusercontent.com/af4de47d93b0b02197464c9118b0081ea51cf59c/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f3633353934322d316230653233623766356561626439652e6a70673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430) 】 (OOM-Leaks-Crash / Player)
- awesome - ZFPlayer - Support customization of any player SDK and control layer (支持定制任何播放器SDK和控制层)。【 [Priview 1](https://camo.githubusercontent.com/48200df0498350786ba386f31336f7e6c8f07552/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f3633353934322d303932343237653537313735363330392e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430) | [Priview 2](https://camo.githubusercontent.com/dbee14e8706d7d044c9951be77097aeb2115f5e9/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f3633353934322d653939643736343938636230316166622e706e673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430) | [Priview 3](https://camo.githubusercontent.com/af4de47d93b0b02197464c9118b0081ea51cf59c/68747470733a2f2f75706c6f61642d696d616765732e6a69616e7368752e696f2f75706c6f61645f696d616765732f3633353934322d316230653233623766356561626439652e6a70673f696d6167654d6f6772322f6175746f2d6f7269656e742f7374726970253743696d61676556696577322f322f772f31323430) 】 (OOM-Leaks-Crash / Player)
README
[中文说明](https://www.jianshu.com/p/90e55deb4d51)
[ZFPlayer 转屏适配](https://github.com/renzifeng/ZFPlayer/wiki/%E8%BD%AC%E5%B1%8F%E9%80%82%E9%85%8D)
Before this, you used ZFPlayer, are you worried about encapsulating avplayer instead of using or modifying the source code to support other players, the control layer is not easy to customize, and so on? In order to solve these problems, I have wrote this player template, for player SDK you can conform the `ZFPlayerMediaPlayback` protocol, for control view you can conform the `ZFPlayerMediaControl` protocol, can custom the player and control view.
![ZFPlayer思维导图](https://upload-images.jianshu.io/upload_images/635942-e99d76498cb01afb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
## 🔨 Requirements
- iOS 7+
- Xcode 8+## 📲 Installation
ZFPlayer is available through [CocoaPods](https://cocoapods.org). To install it,use player template simply add the following line to your Podfile:
```objc
pod 'ZFPlayer', '~> 4.0'
```Use default controlView simply add the following line to your Podfile:
```objc
pod 'ZFPlayer/ControlView', '~> 4.0'
```
Use AVPlayer simply add the following line to your Podfile:```objc
pod 'ZFPlayer/AVPlayer', '~> 4.0'
```Use ijkplayer simply add the following line to your Podfile:
```objc
pod 'ZFPlayer/ijkplayer', '~> 4.0'
```
[IJKMediaFramework SDK](https://gitee.com/renzifeng/IJKMediaFramework) support cocoapods## 🐒 Usage
#### ZFPlayerController
Main classes,normal style initialization and list style initialization (tableView, collection,scrollView)Normal style initialization
```objc
ZFPlayerController *player = [ZFPlayerController playerWithPlayerManager:playerManager containerView:containerView];
ZFPlayerController *player = [[ZFPlayerController alloc] initwithPlayerManager:playerManager containerView:containerView];
```List style initialization
```objc
ZFPlayerController *player = [ZFPlayerController playerWithScrollView:tableView playerManager:playerManager containerViewTag:containerViewTag];
ZFPlayerController *player = [ZFPlayerController alloc] initWithScrollView:tableView playerManager:playerManager containerViewTag:containerViewTag];
ZFPlayerController *player = [ZFPlayerController playerWithScrollView:scrollView playerManager:playerManager containerView:containerView];
ZFPlayerController *player = [ZFPlayerController alloc] initWithScrollView:tableView playerManager:playerManager containerView:containerView];
```#### ZFPlayerMediaPlayback
For the playerMnager,you must conform `ZFPlayerMediaPlayback` protocol,custom playermanager can supports any player SDK,such as `AVPlayer`,`MPMoviePlayerController`,`ijkplayer`,`vlc`,`PLPlayerKit`,`KSYMediaPlayer`and so on,you can reference the `ZFAVPlayerManager`class.```objc
Class *playerManager = ...;
```#### ZFPlayerMediaControl
This class is used to display the control layer, and you must conform the ZFPlayerMediaControl protocol, you can reference the `ZFPlayerControlView` class.```objc
UIView *controlView = ...;
player.controlView = controlView;
```## 📷 Screenshots
![Picture effect](https://upload-images.jianshu.io/upload_images/635942-1b0e23b7f5eabd9e.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
## Reference
- [ijkplayer](https://github.com/Bilibili/ijkplayer)
- [SJVideoPlayer](https://github.com/changsanjiang/SJVideoPlayer)## 👨🏻💻 Author
- Weibo: [@任子丰](https://weibo.com/zifeng1300)
- Email: [email protected]
- QQ群: 123449304## 👮🏻 License
ZFPlayer is available under the MIT license. See the LICENSE file for more info.