Giter Club home page Giter Club logo

sgplayer-ios's Introduction

SGPlayer-iOS

forked from SGPlayer 在SGPlayer的基础上删除了ffmpeg部分,直接使用avplayer播放VR视频。超轻量级VR视频播放器,编译成动态库后只有2.7M,在项目中没有直播又需要播放VR视频时使用。

功能

  • 支持播放360°全景视频。
  • 支持手势、传感器操控360°全景视频。
  • 支持双眼模式,具有畸变校正、色散校正。

安装

pod 'SGPlayer-iOS','~>1.0.1'

使用

  • demo中有例子,具体请看SGVideoPlayer.m

依赖的库

- CoreMedia.framework
- AudioToolBox.framework
- VideoToolBox.framework
- libiconv.tbd
- libbz2.tbd
- libz.tbd

播放视频

// 初始化
self.player = [SGPlayer player];

// 注册回调,监听进度等
[self.player registerPlayerNotificationTarget:self stateAction:@selector(stateAction:) progressAction:@selector(progressAction:) playableAction:@selector(playableAction:) errorAction:@selector(errorAction:)];

// 响应点击
[self.player setViewTapAction:^(SGPlayer * _Nonnull player, SGPLFView * _Nonnull view) {
NSLog(@"player display view did click!");
}];

// 播放普通视频
[self.player replaceVideoWithURL:contentURL]; // 方式1
[self.player replaceVideoWithURL:contentURL videoType:SGVideoTypeNormal]; // 方式2

// 播放360°全景视频
[self.player replaceVideoWithURL:contentURL videoType:SGVideoTypeVR];

// 开启黑灰滤镜
self.player.hasGrayFilter = YES;

// 播放
[self.player play];

版本信息

v1.0.1

使用CoreImage加入视频黑灰滤镜,使用参数hasGrayFilter开启

sgplayer-ios's People

Contributors

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