Giter Site home page Giter Site logo

guoshay / srvideoplayer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guowilling/srvideoplayer

0.0 0.0 0.0 13.46 MB

A custom interface video player which has various interactive gestures.

License: MIT License

Ruby 0.57% Objective-C 99.43%

srvideoplayer's Introduction

SRVideoPlayer

A custom video player based on AVFoundation. Automatically distinguish local and network video, cache network video data while playing, next time play directly with cached data, do not have to download again.

Features

  • Support to slide left half of the screen up or down to adjust brightness.
  • Support to slide right half of the screen up or down to adjust sound.
  • Support to slide the screen left or right to seek play progress.

Screenshots

image image

image image

Installation

CocoaPods

Add pod 'SRVideoPlayer' to the Podfile, then run pod install in the terminal.

Manual

Drag the SRVideoPlayer folder to the project.(Note: If the project has already import Masonry, you should remove it which in the SRVideoPlayer folder.)

Usage

/**
 Creates and returns a video player with video's URL, playerView and playerSuperView.

 @param videoURL        The URL of the video.
 @param playerView      The view which you want to display the video.
 @param playerSuperView The playerView's super view.
 @return A newly video player.
 */
+ (instancetype)playerWithVideoURL:(NSURL *)videoURL playerView:(UIView *)playerView playerSuperView:(UIView *)playerSuperView;
UIView *playerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.width)];
playerView.center = self.view.center;
[self.view addSubview:playerView];
_videoPlayer = [SRVideoPlayer playerWithVideoURL:_videoURL playerView:playerView playerSuperView:playerView.superview];
_videoPlayer.videoName = @"Here Is The Video Name";
_videoPlayer.playerEndAction = SRVideoPlayerEndActionStop;
[_videoPlayer play];

Custom

/**
 The action when the video play to end, default is SRVideoPlayerEndActionStop.
 */
@property (nonatomic, assign) SRVideoPlayerEndAction playerEndAction;

/**
 The name of the video which will be displayed in the top center.
 */
@property (nonatomic, copy) NSString *videoName;

Significant Update

2017.04.06

Cache video data while playing, next time play directly with local data, do not have to download again.
But the current cache mode is not perfect, next I will optimize it.

srvideoplayer's People

Contributors

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