Git Product home page Git Product logo

yyeva-android's Introduction

YY-EVA Android

简体中文 | English

轻量级 高性能 跨平台 MP4 礼物播放器

支持本项目

请支持我们的项目,点击 GitHub Star, 让更多的人看到该项目

介绍

  • YYEVAPlayer 是一个轻量的动画渲染库。通过这里导出动画文件
  • YYEVA-Android 使用Native Opengles 渲染视频,为你提供高性能、低开销的动画体验。

平台支持

  • 支持 AndroidIOSWeb 点击了解详细接入
  • 资源制作的AE插件使用规范 详情
  • 数据结构定义 详情
  • 项目相关文章、设计规范等 详情

用法

我们在这里介绍 YYEVA-Android 的用法。想要知道如何导出动画,点击这里

使用Gradle安装依赖

build.gradle

allprojects {
	repositories {
		maven { url 'https://jitpack.io' }
	}
}
dependencies {
	implementation 'com.github.yylive.YYEVA-Android:yyeva:1.0.7'
}

放置混合 mp4 文件 在Assets中

如需要使用SurfaceView可以使用EvaAnimView,需要使用TextureView可以使用EvaAnimViewV3,demo使用EvaAnimViewV3

替换元素接口

interface IEvaFetchResource {
    // 获取图片 (暂时不支持Bitmap.Config.ALPHA_8 主要是因为一些机型opengl兼容问题)
    fun setImage(resource: EvaResource, result:(Bitmap?) -> Unit)

    // 获取文字
    fun setText(resource: EvaResource, result:(String?) -> Unit)

    // 资源释放通知
    fun releaseSrc(resources: List<EvaResource>)
}

具体实现可以参照EvaDemoActivity的代码实验,替换自身mp4中的元素。

播放使用IEvaAnimView接口

interface IEvaAnimView {
    ...
    //播放文件
    fun startPlay(file: File)
    //播放本地文件
    fun startPlay(assetManager: AssetManager, assetsPath: String)
    //停止播放
    fun stopPlay()
    //是否正在运行
    fun isRunning(): Boolean
    //循环播放
    fun setLoop(playLoop: Int)
    //设置背景图
    fun setBgImage(bg: Bitmap)
    ...
}

QQ交流群

qqgroup

鸣谢

  • 感谢 vap 优秀的混合渲染方案、项目Render混合部分重用了 vap的方案

Dev Team


Cangwang

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.