不知 391119fd8b 123 | 4 years ago | |
---|---|---|
.. | ||
ZFPlayer | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago |
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 is available through CocoaPods. To install it,use player template simply add the following line to your Podfile:
pod 'ZFPlayer', '~> 3.0'
Use default controlView simply add the following line to your Podfile:
pod 'ZFPlayer/ControlView', '~> 3.0'
Use AVPlayer simply add the following line to your Podfile:
pod 'ZFPlayer/AVPlayer', '~> 3.0'
Use ijkplayer simply add the following line to your Podfile:
pod 'ZFPlayer/ijkplayer', '~> 3.0'
IJKMediaFramework SDK support cocoapods
Use KSYMediaPlayer simply add the following line to your Podfile:
pod 'ZFPlayer/KSYMediaPlayer', '~> 3.0'
KSYMediaPlayer SDK support cocoapods
边下边播可以参考使用KTVHTTPCache
Main classes,normal style initialization and list style initialization (tableView, collection,scrollView)
Normal style initialization
ZFPlayerController *player = [ZFPlayerController playerWithPlayerManager:playerManager containerView:containerView];
ZFPlayerController *player = [[ZFPlayerController alloc] initwithPlayerManager:playerManager containerView:containerView];
List style initialization
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];
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.
Class<ZFPlayerMediaPlayback> *playerManager = ...;
This class is used to display the control layer, and you must conform the ZFPlayerMediaControl protocol, you can reference the ZFPlayerControlView
class.
UIView<ZFPlayerMediaControl> *controlView = ...;
player.controlView = controlView;
林界:https://github.com/GeekLee609
如果ZFPlayer在开发中有帮助到你、如果你需要技术支持或者你需要定制功能,都可以拼命打赏我!
ZFPlayer is available under the MIT license. See the LICENSE file for more info.