Open mrj976 opened 4 years ago
Im with the same problem.
How can we play the first video when list loaded?
Thanks.
I made a solution:
Inside your RecyclerView class create the method:
fun checkToPlayVideo() {
if (canScrollVertically(1)) {
playVideo(false)
} else {
playVideo(true)
}
}
And when you set RecyclerView "items" you need call:
private fun updateList() {
list?.layoutManager = createLayoutManager()
list?.setListObjects(listData ?: ArrayList())
list?.adapter = adapter
list?.setHasFixedSize(true)
Handler().postDelayed({
list?.checkToPlayVideo()
}, 200)
}
Thanks.
Thank you I have problem When list loaded first video not play and when i scroll list first video playing I want when list loaded first video play without scroll list Please help me Thanks