Giter Site home page Giter Site logo

kiesun / zfplayer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from renzifeng/zfplayer

0.0 3.0 0.0 54.26 MB

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.基于AVPlayer,支持横屏、竖屏(全屏播放还可锁定屏幕方向),上下滑动调节音量、屏幕亮度,左右滑动调节播放进度。

License: MIT License

Objective-C 99.54% Ruby 0.46%

zfplayer's Introduction

ZFPlayer

Features

  • Support for horizontal and vertical screen switch, in full screen playback mode can also lock the screen direction
  • Support local video, network video playback
  • Support in TableviewCell playing video
  • The left 1/2 position on the sliding screen brightness adjustment (simulator can't adjust brightness, please in the real machine debugging)
  • The right 1/2 position on the sliding screen volume adjustment (simulator can't adjust the volume, please in the real machine debugging)
  • Left and right sliding adjustment play schedule
  • Breakpoint Download
  • Toggle video resolution

Requirements

  • iOS 8+
  • Xcode 7+

Statistics

What APP using ZFPlayer, and on AppStore, please tell me, help me to statistics.

Component

Language

中文说明

Installation

CocoaPods

pod 'ZFPlayer'

Then, run the following command:

$ pod install

Usage (Support IB and code)

Set status bar color

Please add the "View controller-based status bar appearance" field in info.plist and change it to NO

IB usage

Direct drag IB to UIView, the aspect ratio for the 16:9 constraint (priority to 750, lower than the 1000 line), the code section only needs to achieve

self.playerView.videoURL = self.videoURL;
// Back button event
__weak typeof(self) weakSelf = self;
self.playerView.goBackBlock = ^{
	[weakSelf.navigationController popViewControllerAnimated:YES];
};
Code implementation (Masonry) usage
self.playerView = [[ZFPlayerView alloc] init];
[self.view addSubview:self.playerView];
[self.playerView mas_makeConstraints:^(MASConstraintMaker *make) {
 	make.top.equalTo(self.view).offset(20);
 	make.left.right.equalTo(self.view);
	// Note here, the aspect ratio 16:9 priority is lower than 1000 on the line, because the 4S iPhone aspect ratio is not 16:9
    make.height.equalTo(self.playerView.mas_width).multipliedBy(9.0f/16.0f).with.priority(750);
}];
self.playerView.videoURL = self.videoURL;
// Back button event
__weak typeof(self) weakSelf = self;
self.playerView.goBackBlock = ^{
	[weakSelf.navigationController popViewControllerAnimated:YES];
};
Set the fill mode for the video (optional)
 // (optional settings) you can set the fill mode of the video, the default settings (ZFPlayerLayerGravityResizeAspect: wait for a proportional fill, until a dimension reaches the area boundary).
 self.playerView.playerLayerGravity = ZFPlayerLayerGravityResizeAspect;
Is there a breakpoint download function (optional)
 // Default is to close the breakpoint download function, such as the need for this feature set here
 self.playerView.hasDownload = YES;
Play video from XX seconds (optional)
// Play video from XX seconds
self.playerView.seekTime = 15;
Automatically play the video,not automatically play by default(optional)
// Automatically play the video
[self.playerView autoPlayTheVideo];
Set the video placeholderImage (need to set the video URL before)
// Here is the name of the picture
self.playerView.placeholderImageName = @"...";

Picture effect demonstration

Picture effect

Sound adjustment demonstration

Brightness adjustment demonstration

reference material:


swift project Player:

See the BMPlayer please, thanks the BMPlayer author's open source.

swift project ZFZhiHuDaily:

I recently written ZFZhiHuDaily.


Contact me

License

ZFPlayer is available under the MIT license. See the LICENSE file for more info.

zfplayer's People

Contributors

bb9z avatar djliu328 avatar renzifeng avatar wukwei avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.