Code Monkey home page Code Monkey logo

xpvideoplayer's Introduction

XPVideoPlayer

使用AVPlayer自定义播放器,重写网络请求部分,实现边下边播

usage

  • (void)viewDidLoad {

    [super viewDidLoad];

    _VView = [[XPVideoPlayerView alloc]init];

    [self.view setBackgroundColor:[UIColor whiteColor]];

    _VView = [[XPVideoPlayerView alloc] initWithFrame:CGRectMake(0, CGRectGetHeight([[UIApplication sharedApplication]statusBarFrame])+CGRectGetHeight(self.navigationController.navigationBar.frame), CGRectGetWidth(self.view.frame),CGRectGetWidth(self.view.frame)*9/16)];

    _VView.delegate = self;

    [_VView setVideoFillMode:AVLayerVideoGravityResizeAspect];

    XPVideoPlayer * player = [[XPVideoPlayer alloc]init];

    [player enableTimeUpdates];

    [player enableAirplay];

    [player setURL:[NSURL URLWithString:@"https://dn-xpdu.qbox.me/A%20Shaw%20way%20to%20fly%20Alexander%20technique..Butterfly%20lesson%201.mp4"]];

    [player setSupportCache:YES];

    [_VView setPlayer:player];

    [player play];

    [_VView setFrame:[UIScreen mainScreen].bounds];

    [self.view addSubview:_VView];

}

xpvideoplayer's People

Contributors

xiangpdu avatar

Stargazers

 avatar

Watchers

James Cloos 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.