android - 如何使用Databinding实现ExoPlayer?

标签 android data-binding kotlin exoplayer exoplayer2.x

我有一个类 activity_player 布局,其中我有 exoplayer2.ui.PlayerView 并且我创建了 exo_player_control_view 以便它覆盖默认控件外部播放器。所以我想在新创建的自定义控件 View 中使用数据绑定(bind),但不知道该怎么做。有什么建议吗?

这实际上是关于 here 的未解决问题,但尚未解决。那么有没有人有使 exo_player_control_view 数据绑定(bind)友好的解决方法?

最佳答案

像这样使用>>>>

private val binding by lazy {
     ActivityPipVideoPlayerBinding.inflate(layoutInflater)}

private val exoPLayerBinding by lazy {
    VdoExoControlViewBinding.inflate(LayoutInflater.from(this), binding.root, true)
}

关于android - 如何使用Databinding实现ExoPlayer?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54739354/

相关文章:

java - 如何通过按下按钮在android中打开pdf?

android - 修改标题附加移动浏览器

wpf - 当 BindingExpression 的来源改变时通知?

kotlin - Android Room 中的 AppDatabase 可以随时为空吗?

android - 无法为 facebook 应用程序生成 HashKey

android - 将图像上传到 Node.js 意外 token

c# - 这是我们可以强制 ObjectDataSource 的唯一方法吗?

java - axis2 中的数据绑定(bind)

kotlin - 如何使用gradle kotlin dsl为简单的控制台应用程序生成 'fatjar'

java - Spring Boot中Kotlin Controller 类可以访问Java服务类吗