Code Monkey home page Code Monkey logo

abfplayerkit's Introduction

ABFPlayerKit

引用第三方技术包括:

  • ijkplayer
  • masonry

支持格式

  • ijkplayer支持的所有格式

参考项目

  • 很多代码都是从ZFPlayer这个项目复制过来的,进行ijkplayer改造 。

demo

  • 将ABFPlayerKit目录引入到项目中去
  • #import "ABFPlayerView.h"
  • #import "ABFPlayerModel.h"
-(void)setupPlayerView{
    UIView *displayView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, self.view.bounds.size.width, kScreenWidth*9/16)];
    self.playerView.backgroundColor = [UIColor blackColor];
    self.playerView = displayView;
    [self.mainView addSubview:self.playerView];
    [self.player autoPlayTheVideo];
}

-(ABFPlayerView *)player{
    if(!_player){
        _player = [[ABFPlayerView alloc] init];
        _player.delegate = self;
        [_player playControlView:nil playerModel:self.playerModel];
    }
    return _player;
}

-(ABFPlayerModel *)playerModel{
    if(!_playerModel){
        _playerModel = [[ABFPlayerModel alloc] init];
        _playerModel.fatherView = self.playerView;
        _playerModel.title = self.name;
        NSMutableArray *menus = [NSMutableArray new];
        [menus addObject:self.url_1];
        [menus addObject:self.url_2];
        [menus addObject:self.url_3];
        _playerModel.urlArrays = [menus mutableCopy];
    }
    return _playerModel;
}

效果图

备注

  • 最后如果你觉得不错,那就star一下,非常感谢

abfplayerkit's People

Contributors

clyhs 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.