本来想手动编译一个ffmpeg的扩展,但试了好多版本,都不成功,后来发现有人上传了.事情就非常容易了.
地址是:
Central Repository: org/jellyfin/exoplayer/exoplayer-ffmpeg-extension/2.18.1+1
在gradle里面添加依赖就可以了.org.jellyfin.exoplayer:exoplayer-ffmpeg-extension:2.18.1+1
或者手动去下载它,直接依赖aar.
使用就比较简单了
val builder=ExoPlayer.Builder(applicationContext, FfmpegRenderersFactory(applicationContext))
var playerView = findViewById<StyledPlayerView>(R.id.styled_player_view)
//exoplayer需要通过上面的builder,否则不生效.
var mExoPlayer = builder.build()
playe