Code Monkey home page Code Monkey logo

jdplayer's Introduction

JDPlayer

A video player for iOS based on AVFoundation,JDPlayer is powerful and easy to integrate in your project.

Features

  • orientation change support
  • support change small screen to full screen or vice versa
  • play local or remote media over HTTP
  • easy to customizable UI and user interaction
  • support horizontal slide and horizontal gesture to fast forward or backward the playing media
  • support vertical slide to change the volume and brightness
  • so many delegate callbacks
  • pure objective-c code

Quick Try

To run the Demo project; clone the repo,open JDPlayerPro.xcodeproj in Xcode to run Demo Application.

Getting Start

JDVideoModel* videoModel = [[JDVideoModel alloc]init];
videoModel.streamURL = [NSURL URLWithString:@"assetUrl..."];
JDPlayer* player = [[JDPlayer alloc] init];
player.delegate = self;
[player loadVideoModel:videoModel];

Customize

JDPlayer has simple way for customize your own controls.

- (void)addSubviewForControl:(UIView *)view;
- (void)addSubviewForControl:(UIView *)view toView:(UIView*)parentView;
- (void)addSubviewForControl:(UIView *)view toView:(UIView*)parentView forOrientation:(UIInterfaceOrientationMask)orientation;

Callbacks

- (BOOL)shouldVideoPlayer:(JDPlayer*)videoPlayer changeStateTo:(JDPlayerState)toState;
- (void)videoPlayer:(JDPlayer*)videoPlayer willChangeStateTo:(JDPlayerState)toState;
- (void)videoPlayer:(JDPlayer*)videoPlayer didChangeStateFrom:(JDPlayerState)fromState;
- (BOOL)shouldVideoPlayer:(JDPlayer*)videoPlayer startVideo:(JDVideoModel *)videoModel;
- (void)videoPlayer:(JDPlayer*)videoPlayer willStartVideo:(JDVideoModel *)videoModel;
- (void)videoPlayer:(JDPlayer*)videoPlayer didStartVideo:(JDVideoModel *)videoModel;
- (void)videoPlayer:(JDPlayer *)videoPlayer isBuffering:(BOOL)buffering;
- (void)videoPlayer:(JDPlayer*)videoPlayer didPlayFrame:(JDVideoModel *)videoModel time:(NSTimeInterval)time lastTime:(NSTimeInterval)lastTime;
- (void)videoPlayer:(JDPlayer*)videoPlayer didPlayToEnd:(JDVideoModel *)videoModel;
- (void)videoPlayer:(JDPlayer*)videoPlayer didNextVideoButtonPressed:(JDVideoModel *)videoModel;
- (void)videoPlayer:(JDPlayer*)videoPlayer didPreviousVideoButtonPressed:(JDVideoModel *)videoModel;

How to change video quality?

  1. In JDPlayerView, you should custom your own control(such as button),and invoke
- (void)didVideoQualityButtonPressed;

in button's control events(such as UIControlEventTouchUpInside);

  1. In your own Controller,change video quality in delegate
- (void)videoPlayer:(JDPlayer *)videoPlayer didVideoQualityButtonPressed:(JDVideoModel *)videoModel;

License

JDPlayer is released under the MIT license. See LICENSE for details.

jdplayer's People

Contributors

letqingbin avatar

Watchers

 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.