Lightweight,High Performance,Cross Platform,MP4 Gift Player
- YYEVAPlayer is a lightweight animation library with a simple yet powerful API。Reference here can easily export animation resources
- YYEVA-iOS render with Metal library , providing you with a high-performance, low-cost animation experience.
我们在这里介绍 YYEVA-Android 的用法。想要知道如何导出动画,点击这里。
build.gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.yylive.YYEVA-Android:yyeva:1.0.17'
}
// 2.0.0-beta
dependencies {
implementation 'com.github.yylive.YYEVA-Android:yyeva:2.0.0-beta'
}
For SurfaceView can use EvaAnimView,For TextureView can useEvaAnimViewV3,demo show use EvaAnimViewV3
change property interface
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>)
}
You can find the example int the project in app module.
Play with IEvaAnimView interface.
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)
...
}
2.0.0-beta use OptionParams to set
class OptionParams {
var frameRate = 30
var playCount = 1
var isMute = false
var isRemoteService = true //使用多进程
var mp4Address = ""
var scaleType = 1 // 1=>裁剪居中, 2=>全屏拉伸 3=>原资源大小
var filterType = "" //高清算法 hermite lagrange
}
- Thanks vap , our decoder module with good experiences of it.
Cangwang |